Custom OS Template for GPU Passthrough
To enable GPU support in your custom template, you must adhere to the steps outlined below.
Keep in mind that GPU passthrough is typically used for two primary scenarios:
- Machine learning tasks (display output not required, e.g., OpenCL)
- Image processing workloads (such as OBS Studio, Blender, video editing, Multiverse presentations, etc.)
While the machine learning use case is less complex (as it does not require GPU for display), we will provide a complete walkthrough covering both scenarios.
Supported GPU
If you operate DaDesktop on your own infrastructure, or if you ask for particular cards for a private server, these points are important.
Our testing primarily covers AMD Radeon RX 6000 series (especially RX 6400) and Nvidia RTX cards. As a rule, GPUs manufactured before 2018 are not supported.
Integrated GPUs found in Ryzen 7/9 processors and Intel iGPUs should function properly, though we do not perform automated testing on them.
DD Node side
In the dadesktop_npnode_deploy/modules/build-os-template path, there are scripts that configure a Linux guest to use the GPU as the primary display and to toggle between GPU-accelerated and CPU-rendered modes.
Guest Settings
Make sure that the "support_qemu" in /var/lib/kvm/templatename/sysinfo.json has been set to false. This allows you to connect to the VNC server within the guest, since the QEMU VNC cannot show the passthrough GPU display.
Testing
Method 1: vblank_mode=0 glxgears
Second method:
/apps/dd-guest/check-gpu
Windows guest settings when no physical monitor is attached (most cases)
We rely on IddSampleDriver to add a display adapter and virtual monitor within the Windows 10 template. Install it if no physical monitor is connected to your GPU.
-
Extract IddSampleDriver to the C:\IddSampleDriver folder
-
Install the certificate
-
Install the driver
-
Navigate to 'Display Settings' and review the multiple displays. Click 'Advanced display settings'. Typically, Display 2 or 3 with the name "Linux FHD" is the virtual display we've created. Note this display number as N. Then return to 'Select and rearrange displays', choose display N. In the 'Multiple displays' section, select 'Show only on N' if available, and designate it as the main display. Change its resolution .
-
If you cannot locate a display named "Linux FHD":
In Device Manager, under Display Adapters, find 'IddSampleDriver Device'. Right-click and enable it. (You may disable this device when the virtual display is not required.)
-
If you see a display called "AMD vDisplay", typically Display 2:
This display will be sluggish, and you can "Disconnect this display" if that option appears.
(Choose Display x, then in the 'Multiple displays' section, use the dropdown to pick the Disconnect this display option.)
-
If a display named "Qemu Monitor", appears, generally Display 1:
You can also "Disconnect this display" if that option is present.