GPU Passthrough Custom OS Template
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 needed, for example OpenCL, etc.)
- Image processing (like OBS Studio, Blender, Video Editing, Multiverse presentations, and so on)
The Machine Learning use case is a bit simpler since the display doesn't rely on the GPU, but we'll walk through the full process to cover both situations.
Supported GPU
If you're running DaDesktop on your own hardware, or you've asked to buy specific cards for your private server, here are a few things to think about.
We mainly test DaDesktop with AMD Radeon RX 6000 series cards (especially the RX 6400) and Nvidia RTX cards. Generally, models released before 2018 aren't supported.
Also, the integrated GPUs found in Ryzen 7/9 and Intel iGPUs should work without issues, although we don't run automated tests on them.
DD Node side
The dadesktop_npnode_deploy/modules/build-os-template directory includes scripts that modify the Linux guest to use the GPU as the main display. It can also switch between GPU-powered machines and a CPU-rendered screen.
Guest Settings
Make sure that the "support_qemu" setting in /var/lib/kvm/templatename/sysinfo.json is set to false. This allows you to connect via VNC inside the guest, because qemu vnc can't 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 use IddSampleDriver to set up a display adapter and virtual monitor in the Windows 10 template. If your GPU doesn't have a monitor connected, simply install it.
-
Place IddSampleDriver in the c:\IddSampleDriver folder
-
Install the certificate
-
Install the driver
-
Head to "Display Settings" where you'll spot several displays. Open "Advanced display settings". Typically, Display 2 or 3, labelled as "Linux FHD", is the virtual display we've made. Take note of that display number, which we'll call 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 it's available. Also, set this as your main display and adjust its resolution.
-
If you don't see a Display named "Linux FHD":
Navigate to "Device Manager" -> "Display Adapters" -> "IddSampleDriver Device": right-click and select enable device. (If you're not using the virtual display, you can disable the device.)
-
If there is a Display name reading "AMD vDisplay", Usually it's Display 2:
this one will be slow, and you can "Disconnect this display" if the option is there.
(Choose Display x, and under the "Multiple displays" section, use the drop-down to pick the Disconnect this display option.)
-
There might be a Display named "Qemu Monitor", Usually it's Display 1:
You could also "Disconnect this display" if the option shows up.