GPU Passthrough Custom OS Template
When building your custom template to work with GPU, follow these steps.
GPU passthrough generally falls into two main scenarios:
- Machine Learning (no display required, e.g., OpenCL, etc.)
- Image processing (e.g., OBS Studio, Blender, Video Editing, Multiverse presentations, etc.)
While the Machine Learning scenario involves fewer steps (since the display doesn't rely on the GPU), we'll walk through the complete procedure to handle both use cases.
Supported GPU
If you're running DaDesktop on-premises or asking for specific cards for your private server, keep these points in mind.
Our testing for the DaDesktop system is mainly done on AMD Radeon RX 6000 series cards (especially the RX 6400) and Nvidia RTX cards. Typically, models released before 2018 aren't supported.
Additionally, integrated GPUs from Ryzen 7/9 and Intel iGPUs should work without issues, though we don't run automated tests on them.
DD Node side
The path dadesktop_npnode_deploy/modules/build-os-template includes scripts that modify a Linux guest so it can use the GPU as the primary display and toggle between GPU-accelerated machines and CPU-rendered screens.
Guest Settings
Make sure that "support_qemu" inside /var/lib/kvm/templatename/sysinfo.json is set to false, allowing you to connect via VNC within the guest, because qemu vnc cannot render the passthrough GPU screen.
Testing
Method 1: vblank_mode=0 glxgears
Method 2:
/apps/dd-guest/check-gpu
Windows guest settings when no physical monitor is attached (most cases)
We rely on IddSampleDriver to create a display adapter and virtual monitor inside the Windows 10 template. Just install it if your GPU doesn't have a physical monitor connected.
-
Copy IddSampleDriver to the c:\IddSampleDriver folder
-
Install the certificate
-
Install the driver
-
Go to "Display Settings" and you'll see several displays. Check "Advanced display settings". Usually Display 2 or 3, labeled "Linux FHD", is the virtual display we've set up. Note the display number as N, then return to "Select and rearrange displays", pick display N, and under "Multiple displays", choose "Show only on N" if it's available, and set it as the main display. Adjust its resolution accordingly.
-
If you can't locate a display named "Linux FHD":
Head to "Device Manager" -> "Display Adapters" -> "IddSampleDriver Device": right-click and enable the device. (You can disable it when the virtual display isn't needed.)
-
If you see a display named "AMD vDisplay", usually Display 2:
it will be slow, and you can "Disconnect this display" if the option is available.
(Choose Display x, under "Multiple displays", use the drop-down and pick the Disconnect this display option.)
-
If a display named "Qemu Monitor" appears, usually Display 1:
You can also "Disconnect this display" if that option is present.