GPU Passthrough Help: Can't seem to get things to be accelerated

Hello everyone,
I’m trying to get GPU Passthrough to work properly. My Radeon Rx 6950XT is isolated properly in its own IOMMU group, and whenever I boot it up with a Qube or Standalone Qube (I am getting display output too with the GPU, for example if Im using a qube with a DE I can see my desktop for example and interact with it but it isnt accelerated and uses CPU to render everything), it uses LLVMPipe to render everything. I’ve tried fresh linux installations, templates, etc and every time it uses LLVMPipe to render things. The amdgpu driver is in use when using lspci -k in the guest. I tried doing the virtualGL method, and that results in every app saying Segmentation Fault (core dumped). I have tried looking seemingly everywhere and nobody seems to have this issue. I would appreciate it if somebody could help me get this issue resolved. Im using QubesOS R4.3 rc2.
Thanks! Any help is appreciated, so so much.
(btw, apologies if this post is slightly rushed/sloppy as I’m very tired right now and I’ve been looking all over for a week and nothing fixed it, so I just want to get this post out right now. If there is any more info you’d like to know, please let me know).

Check the dmesg to see if your GPU driver has some errors.

Hi MellowPoison,
thanks for your response.
There are no errors in the amdgpu driver besides error resizing BAR, which I’m even not sure is possible to do in virtual machine. Regardless, my GPU should be fully functioning without resizing BAR and this cannot be the issue.
I believe the issue lies somewhere in the fact that normal Qubes in QubesOS try to use software rendering on everything. My VM also has a virtual VGA device (utilizing software rendering) running in parallel with my dGPU which I cannot seem to find a way to turn off. If you know of any way to disable the virtual display device, let me know as I would be eager to try it, or if you have any other ideas for any fixes, because I am having difficulty fixing my issue.

Another behavior I noticed, if its of any use, was that while glxinfo shows LLVMPipe renderer, vulkaninfo shows my dGPU. However, when I try to run vkcube, my whole vm goes black and then comes back after 5 seconds, saying KDE Crashed (im using KDE in my VM currently).

Again, thanks for your help.

Check the Xorg log, maybe you need to use a custom Xorg config as described here:

I tried creating a custom Xorg config file already and had no luck unfortunately. I’m not sure if I just did the file wrong, however X would fail to start every time. I believe I wrote the file correctly and I wrote it in based on Arch and Gentoo wiki which I’ve used to create successful xorg.conf files before. When it fails to intialize, it points to an error log which I will probably check soon and get back to you with.
Also, I posted here about some of my troubles with VirtualGL, which is correlated with this issue:

If you have any suggestions for this error, let me know.

A good start might be to keep your first Qubes xserver :0, and to run a second one for your passed-through GPU.

The link in the comment by neowutran in the other thread contains a xorg.conf stub, which is adjusted by a script xorgx2.sh (I think).

The important bit AIUI is the BusID, which must point to your PT card, and the startx, which must use a new unused server id- usually :1 - and must use the xorg.conf file.

Then you can run apps on the PT GPU by prefixing the command like this:

DISPLAY=":1" glxgears

A similar method has worked for me in the past. Maybe it will be a starting point.

Hi phceac,
Thank you for your help! I was able to utilize neowutran’s SourceHut repo and copy his xorg config, add my pcie id for my gpu, and use the command in xorgX1.sh command to start xorg on the unused server Id (startx – :1 --config /opt/xorg.conf). I added startplasma-x11 to my xinitrc to use KDE plasma and bam, finally accelerated and glxinfo shows my radeon card! Declaring the DISPLAY environment variable also wans’t neccesary, and accelerating started working right away in my case. Thanks so much for your help!
One thing I am still wondering is if I can get Wayland working and possibly VirtualGL. I will attempt this later, utilizing inspiration from the neowutran SourceHut repo, and post if I am still having trouble.
Thanks, once again!

1 Like

It is really nice to know it helped! Thank you.

It’s probably a good moment for me to thank @neowutran for pointing to it in the first place!

I will be interested to hear how it goes with Wayland…

1 Like