{"id":29,"date":"2025-01-12T19:36:26","date_gmt":"2025-01-12T19:36:26","guid":{"rendered":"https:\/\/homelab.computer\/?p=29"},"modified":"2025-01-13T19:57:53","modified_gmt":"2025-01-13T19:57:53","slug":"qubes-os-gpu-pass-through-for-gaming","status":"publish","type":"post","link":"https:\/\/homelab.computer\/index.php\/2025\/01\/12\/qubes-os-gpu-pass-through-for-gaming\/","title":{"rendered":"Qubes OS: GPU pass-through for gaming"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This guide is intended for Qubes OS users who struggle with configuring GPU passthrough, particularly for enhancing video game performance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> You need to have the following hardware:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>GPU capable of doing pass-through.<\/li>\n\n\n\n<li>USB controller capable of doing pass-through.<\/li>\n\n\n\n<li>Display that can be dedicated to the GPU, while the qube is active.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Although laptop GPUs can sometimes be used with pass-through, this guide focuses on desktops due to their simplified hardware setup.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t have a free USB controller, you can purchase a cheap USB PCIe expansion card.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Most displays offer multiple input ports (HDMI, DisplayPort, etc.). Connect a free port to the GPU and simply switch your display input when using the qube for GPU acceleration.<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>Setting up the qube<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><em>Before you can pass the GPU it needs to be hidden from dom0<\/em><\/strong>, <a href=\"https:\/\/homelab.computer\/index.php\/2025\/01\/05\/qubes-os-hiding-a-pcie-device-from-dom0\/\" data-type=\"link\" data-id=\"https:\/\/homelab.computer\/index.php\/2025\/01\/05\/qubes-os-hiding-a-pcie-device-from-dom0\/\">How to hide  the GPU<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a streamlined installation process, this guide uses an NVIDIA GPU and Ubuntu Linux. You can use a different version of Linux, or a different GPU, and most of the installation steps will still be the same.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/releases.ubuntu.com\/24.04.1\/ubuntu-24.04.1-desktop-amd64.iso\">Download<\/a> the latest Ubuntu ISO.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"641\" height=\"393\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-1-create-qube-1.png\" alt=\"\" class=\"wp-image-31\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-1-create-qube-1.png 641w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-1-create-qube-1-300x184.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-1-create-qube-1-550x337.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-1-create-qube-1-160x98.png 160w\" sizes=\"auto, (max-width: 641px) 100vw, 641px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Step 1: Create a new qube of the type Standalone, do not select a template, proceed to Advanced tab.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"645\" height=\"398\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-2-create-qube-2.png\" alt=\"\" class=\"wp-image-32\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-2-create-qube-2.png 645w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-2-create-qube-2-300x185.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-2-create-qube-2-550x339.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-2-create-qube-2-160x99.png 160w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Step 2: In the Advanced tab, deselect the option &#8220;Install system from device&#8221;, click Ok.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"726\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-3-qube-settings-1.png\" alt=\"\" class=\"wp-image-33\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-3-qube-settings-1.png 868w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-3-qube-settings-1-300x251.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-3-qube-settings-1-768x642.png 768w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-3-qube-settings-1-550x460.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-3-qube-settings-1-160x134.png 160w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Step 3: After the qube is created, open the settings menu. Increase the System storage max size, the base system will be around 10 GB without any games installed, proceed to Advanced tab.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"865\" height=\"720\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-4-qube-settings-2.png\" alt=\"\" class=\"wp-image-34\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-4-qube-settings-2.png 865w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-4-qube-settings-2-300x250.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-4-qube-settings-2-768x639.png 768w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-4-qube-settings-2-550x458.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-4-qube-settings-2-160x133.png 160w\" sizes=\"auto, (max-width: 865px) 100vw, 865px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Step 4: In the advanced tab, deselect Include memory balancing, set kernel to provided by qube, and mode to HVM. Increase the memory and number of VCPUs, proceed to Devices tab.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"867\" height=\"724\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-41-qube-settings-21.png\" alt=\"\" class=\"wp-image-45\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-41-qube-settings-21.png 867w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-41-qube-settings-21-300x251.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-41-qube-settings-21-768x641.png 768w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-41-qube-settings-21-550x459.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-41-qube-settings-21-160x134.png 160w\" sizes=\"auto, (max-width: 867px) 100vw, 867px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Step 5: In the Devices tab, add the GPU and USB controller to the qube, return to Advanced tab.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"724\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-5-qube-settings-3.png\" alt=\"\" class=\"wp-image-35\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-5-qube-settings-3.png 862w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-5-qube-settings-3-300x252.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-5-qube-settings-3-768x645.png 768w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-5-qube-settings-3-550x462.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-5-qube-settings-3-160x134.png 160w\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Step 6: In the advacned tab, click the button Boot qube from CD-ROM, select the ubuntu.iso, click Ok.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"459\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-6-ubuntu-install-1.png\" alt=\"\" class=\"wp-image-36\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-6-ubuntu-install-1.png 746w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-6-ubuntu-install-1-300x185.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-6-ubuntu-install-1-550x338.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-6-ubuntu-install-1-160x98.png 160w\" sizes=\"auto, (max-width: 746px) 100vw, 746px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Step 7: At this point the Ubuntu install should start.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"439\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3-1024x439.png\" alt=\"\" class=\"wp-image-38\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3-1024x439.png 1024w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3-300x129.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3-768x329.png 768w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3-1536x658.png 1536w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3-1100x471.png 1100w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3-550x236.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3-160x69.png 160w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-8-ubuntu-install-3.png 1956w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Step 8: During the installation, go to the network settings, set the IPv4 method to manual, enter the network settings from the qube settings.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"804\" src=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-9-ubuntu-drivers-1024x804.png\" alt=\"\" class=\"wp-image-39\" srcset=\"https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-9-ubuntu-drivers-1024x804.png 1024w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-9-ubuntu-drivers-300x236.png 300w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-9-ubuntu-drivers-768x603.png 768w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-9-ubuntu-drivers-550x432.png 550w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-9-ubuntu-drivers-160x126.png 160w, https:\/\/homelab.computer\/wp-content\/uploads\/2025\/01\/step-9-ubuntu-drivers.png 1057w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Step 9: After the installation is complete, open the software update tool, in the additional drivers tab select the Nvidia driver.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 10: Reboot the qube, you might need kill the qube from Qubes Manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 11: After Ubuntu has rebooted, open the terminal and run the following commands:<\/p>\n\n\n\n<p class=\"has-background has-small-font-size wp-block-paragraph\" style=\"background-color:#eaeaea\"><code>sudo X :1 -configure<br>sudo cp \/root\/xorg.conf.new \/etc\/X11\/xorg.conf<br>sudo vim \/etc\/X11\/xorg.conf<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In xorg.conf delete the device, screen, and monitor that isn&#8217;t the GPU, and change the GPU driver from noveau to nvidia.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save xorg.conf, and shutdown the system. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 12: Before you start the qube, enable audio by running the following command in dom0:<\/p>\n\n\n\n<p class=\"has-background has-small-font-size wp-block-paragraph\" style=\"background-color:#eaeaea\"><code>qvm-features your-gpu-qube-name audio-model ich6<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 13: When you start the qube the output will come from the GPU, make sure the dedicated display is connected. Connect mouse and keyboard the to USB controller passed to the qube, and it&#8217;s ready for use.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to achieve near-bare-metal gaming performance in your Qube OS environment using GPU pass-through.<\/p>\n<a class=\"read-more-link\" href=\" https:\/\/homelab.computer\/index.php\/2025\/01\/12\/qubes-os-gpu-pass-through-for-gaming\/ \">Read more<\/a>","protected":false},"author":1,"featured_media":47,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3,2],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gaming","category-pcie-pass-through","category-qubes-os"],"_links":{"self":[{"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":14,"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":59,"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions\/59"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/media\/47"}],"wp:attachment":[{"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/homelab.computer\/index.php\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}