GPU Passthrough Custom OS Template
When building your custom template to work with GPU passthrough, stick to the steps outlined below.
Broadly speaking, there are two key scenarios for GPU passthrough:
- Machine Learning (no display attached, e.g. OpenCL, etc...)
- Visual processing (e.g. OBS Studio, Blender, Video Editing, Multiverse presentations, etc...)
While the Machine Learning case is simpler (the monitor doesn't need to leverage the GPU), we'll walk through a complete process that handles both situations.
Supported GPU
If you're running DaDesktop on your own hardware, or asking for specific cards to be bought for a private server, keep the following in mind.
Our main testing focuses on AMD Radeon RX 6000 series (particularly the RX 6400) and Nvidia RTX cards within the DaDesktop setup. Generally, models released before 2018 won't be supported.
Integrated graphics on Ryzen 7/9 and Intel iGPUs should also operate correctly, though we don't run automated tests against them.
DD Node side
The dadesktop_npnode_deploy/modules/build-os-template contains scripts that tweak the Linux guest to support the GPU as the main display and toggle between GPU-accelerated machines and a CPU-rendered screen.
Guest Settings
Make sure you confirm that "support_qemu" inside /var/lib/kvm/templatename/sysinfo.json is set to false, as this lets you access the VNC within the guest—qemu vnc is unable to show 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 set up a display adapter and a visual monitor in the Windows 10 template. Just install it if your GPU doesn't have a physical monitor connected.
-
Drop the extra IddSampleDriver into the c:\IddSampleDriver folder
-
Install the certificate
-
Install the driver
-
Head to "Display Settings" and you can spot multiple displays. Check out "Advanced display settings". Typically Display 2 or 3, labelled as "Linux FHD", is the virtual display we've set up. Take note of that display number as N, then pop back to the "Select and rearrange displays" area, pick display N, and under the "Multiple displays" section, set it to "Show only on N" if that choice appears, and mark it as the main display. Adjust its resolution as well.
-
If a Display named "Linux FHD" is nowhere to be seen:
Open "Device Manager" -> "Display Adapters" -> "IddSampleDriver Device": do a right-click and enable the device. (If you have no use for the virtual display, you can just disable the device.)
-
If there's a Display labelled "AMD vDisplay", generally this is Display 2:
it will feel sluggish and you can "Disconnect this display" if that option is there.
(Select Display x, jump to the "Multiple displays" area, use the drop-down to pick the Disconnect this display option.)
-
There is a Display named "Qemu Monitor", mostly this is Display 1:
You can also "Disconnect this display" if the option is available.