Custom OS Template for GPU Passthrough
To prepare your custom template for GPU support, follow the steps below.
Please note the two main GPU passthrough scenarios:
- Machine learning (no display required, e.g., OpenCL, etc.)
- Image processing (e.g., OBS Studio, Blender, video editing, Multiverse presentations, etc.)
Although the machine learning use case requires less effort (since the display doesn’t need to use the GPU), we’ll walk through the entire process to enable both scenarios.
Supported GPU
If you operate DaDesktop on-premises or buy specific cards for a private server, consider the following:
Our testing mostly targets DaDesktop with AMD Radeon RX 6000 series GPUs (especially the RX 6400) and Nvidia RTX cards. Generally, models prior to 2018 are not supported.
Integrated GPUs from Ryzen 7/9 and Intel iGPUs should work, though we don’t run automated tests on them.
DD Node side
The scripts in dadesktop_npnode_deploy/modules/build-os-template modify the Linux guest to use the GPU as the primary display and to switch between GPU-accelerated and CPU-rendered outputs.
Guest Settings
Ensure that the "support_qemu" field in /var/lib/kvm/templatename/sysinfo.json is set to false; this allows you to connect to the guest’s VNC, as the qemu VNC cannot display the passthrough GPU’s 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 create a display adapter and virtual monitor in the Windows 10 template. Simply install it when no physical monitor is connected to your GPU.
-
Place the IddSampleDriver files into the c:\IddSampleDriver folder.
-
Install the certificate.
-
Install the driver.
-
Go to "Display Settings"; you will see multiple displays. Click "Advanced display settings". Typically, Display 2 or 3, labelled "Linux FHD", is the virtual display we created. Note this display number as N, then return to the "Select and rearrange displays" area, choose display N, and in the "Multiple displays" section select "Show only on N" if available, and make it the main display. Adjust its resolution.
-
If you can't find a display named "Linux FHD":
Open "Device Manager" > "Display Adapters", locate "IddSampleDriver Device", right-click, and choose enable. (You can disable this device when not using the virtual display.)
-
If a display named "AMD vDisplay" appears, usually it is Display 2:
this display may be slow, and you can "Disconnect this display" if the option is available.
(Choose Display x, go to the "Multiple displays" section, use the dropdown and select the Disconnect this display option.)
-
If a display named "Qemu Monitor" appears, typically it is Display 1:
You can also "Disconnect this display" if that option is available.
