Hello,
I have found guides on this forum for GPU passthrough for non-display purposes, but they only cover Nvidia/CUDA. I also have searched for specifically AMD GPUs non-display purposes, but all I can find seem to be for specifically gaming. I hope to enable GPU passthrough to allow me to write GPU-accelerated code (via AMD’s ROCm HIP, or otherwise) without messing with the video output itself. While I am sure the answer to my problem lies somewhere between these solutions, I would like to avoid spending hours of trial and error (as well as potentially having to reinstall QubesOS as a whole).
I am running on a Framework 16, with the associated GPU being an AMD Radeon™ RX 7700S. The QubesOS version installed is R4.2.3.
Additionally, because of the modular nature of Framework laptops I would like to avoid any unnecessary disaster if I were to launch a GPU-enabled qube without the GPU installed. Is this something I can safeguard against more than just remembering not to launch it?
Please let me know if more information is needed, and thank you.
That is not going to be just press the button kind of solution and you will probably have to trial and error a little bit, and also follow those guides. I don’t think that starting VM without extra GPU would normally be a huge disaster or cause of big problems.
I’m not very familiar with Framework but it seems that you can have pass-through with dGPU graphics module. Basic idea is always the same anyway and it doesn’t really matter what you use the device for.
Your VM needs to be in HVM mode to be able to use devices. Then you block your dom0 from initializing that device with rd.qubes.hide_pci
and pass that device(s) to VM. I did StandaloneVM to get persistent root filesystem to make things easier for me while I was fighting with other things and also used kernel provided by qube option in settings.
It shouldn’t make much difference which PCI device you are passing so following those guides should be fine. You obviously have to replace nouveau with amdgpu though.
- figure out device id/address with
lspci
- hide pci device with grub line (update with
grub2-mkconfig -o /boot/grub2/grub.cfg
) - pass device(s) to VM from device tab in VM’s settings
- use device in VM
Use those better guides for more information.
My GRUB_CMDLINE_LINUX
in /etc/default/grub
has rd.qubes.hide_pci=05:00.0,05:00.1
These are all the devices that I passed to my VM.
05:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
05:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
05:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller (rev a1)
05:00.3 Serial bus controller: NVIDIA Corporation TU102 USB Type-C UCSI Controller (rev a1)
With my AMD card I would have passed these:
0b:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev e7)
0b:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
I also have a framework 16, and have successful got gpu passthrough working after a lot of pain. I have only got it working with a fedora 41 hvm created from the latest iso. It is able to use the dgpu to display to another screen and to accelerate stuff on the virtual screen (the standard vm display). I have not tried virtualgl yet, but that is meant to be able to do seamless gpu passthrough. I was unable to get the gpu to work with qubes created from templates nor with ubuntu from the iso.
They do cover AMD as well.
It is all the same thing, for gaming or not. You want the GPU passed through…