GPU Passthrough Custom OS Template
When prepping your custom template for GPU support, follow the steps below.
Keep in mind there are two main scenarios for GPU passthrough:
- Machine Learning (no display required, e.g. OpenCL, etc.)
- Image processing (e.g. OBS Studio, Blender, Video Editing, Multiverse presentations, etc.)
The Machine Learning scenario involves less effort (since the display doesn't need to rely on the GPU), but we'll walk through the entire process to cover both situations.
Supported GPU
If you're running DaDesktop on-premise, or requesting the purchase of specific cards for your private server here in New Zealand, here are a few things to think about.
We mainly test the DaDesktop system against AMD Radeon RX 6000 series cards (particularly the RX 6400) and Nvidia RTX cards. Models released before 2018 generally aren't supported.
Integrated GPUs from Ryzen 7/9 and Intel iGPUs should also work fine, though we don't run automated tests against them.
DD Node side
dadesktop_npnode_deploy/modules/build-os-template includes scripts to adjust 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" in /var/lib/kvm/templatename/sysinfo.json is set to false, so you can connect to the VNC inside the guest, because qemu vnc can't display 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 use IddSampleDriver to set up a display adapter and virtual monitor in the Windows 10 template. Simply install it if your GPU doesn't have a monitor plugged in.
-
Extract IddSampleDriver to the c:\IddSampleDriver folder
-
Install the certificate
-
Install the driver
-
Head to "Display Settings" – you’ll see multiple displays. Check "Advanced display settings". Usually Display 2 or 3, named "Linux FHD", is the virtual display we've created. Make a note of the display number as N, then go back to the "Select and rearrange displays" section, pick display N, and under the "Multiple displays" section, set "Show only on N" if that option is available and make it the main display. Adjust its resolution.
-
If you can't find a display named "Linux FHD":
Go to "Device Manager" -> "Display Adapters" -> "IddSampleDriver Device": right-click and enable the device. (You can disable the device if you're not using the virtual display.)
-
If a display named "AMD vDisplay", usually Display 2:
it will be slow, and you can "Disconnect this display" if that option is available.
(Choose Display x, under the "Multiple displays" section, use the drop-down menu and select the Disconnect this display option.)
-
If a display named "Qemu Monitor", usually Display 1:
You can also "Disconnect this display" if that option is available.