Custom OS Template for GPU Passthrough
To get your custom template ready for GPU support, just follow the steps below.
Keep in mind, there are two main scenarios for GPU passthrough:
- Machine Learning (no display required, for example OpenCL, etc.)
- Image processing (like OBS Studio, Blender, video editing, Multiverse presentations, and similar tasks)
While the Machine Learning case is simpler (since the display doesn't need to use the GPU), we'll walk through the full process to cover both situations.
Compatible GPUs
If you're running DaDesktop on your own hardware, or asking to buy specific cards for your private server, here are a few things to think about.
We mainly test the DaDesktop system with AMD Radeon RX 6000 series cards (especially the RX 6400) and Nvidia RTX cards. Generally, models released before 2018 won't be supported.
Also, integrated GPUs on Ryzen 7/9 and Intel iGPUs should work fine, but we don't run automated tests on those.
DD Node Side
The dadesktop_npnode_deploy/modules/build-os-template folder includes scripts that modify a Linux guest to use the GPU as the primary display, and to switch 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. This lets you connect via 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 Connected (Most Cases)
We use IddSampleDriver to create a display adapter and virtual monitor in the Windows 10 template. Just 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" 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 that display number as N. Then, go back to the "Select and rearrange displays" area, pick display N, and under the "Multiple displays" section, choose "Show only on N" if that option is there, and make it the main display. Adjust its resolution too.
-
If you can't spot a display named "Linux FHD":
Open "Device Manager" → "Display Adapters" → "IddSampleDriver Device": right-click it and enable the device. (You can disable the device when you're not using the virtual display.)
-
If you see a display called "AMD vDisplay", which is usually Display 2:
It'll run slowly, and you can select "Disconnect this display" if that choice is available.
(Pick Display x, then under the "Multiple displays" area, use the dropdown menu and select the Disconnect this display option.)
-
There may be a display labeled "Qemu Monitor", ordinarily Display 1:
You can also hit "Disconnect this display" if the option shows up.