What is my GPU really here for? Truely understanding VCPUs and fully ultilizing GPU

Where and how did you do such?

You install the driver in dom0
sudo qubes-dom0-update xorg-x11-drv-amdgpu

Then you generate xorg.conf
sudo X :1 -configure
It will save the config as /root/xorg.conf.new, copy it to /etc/X11/xorg.conf

Edit the config, you need to change the Driver value to Driver "amdgpu"
I removed all other display devices and only left the internal display device, you need to make sure the device has the correct BusID. You can get the BusID with lspci, but it will give you the value in hex, and in the config the value should be decimal.

This is the output from lspci
16:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Device 13c0 (rev c1)

This is from my xorg.conf

	Identifier  "Card0"
	Driver      "amdgpu"
	BusID       "PCI:22:0:0"

Reboot the system, if everything is working, you should be using the amdgpu driver.

If it doesn’t work, check /var/log/Xorg.0.log for errors, it will give you an idea about what is wrong with xorg.conf.

If you are unable to start X, delete /etc/X11/xorg.conf, and you are back to where you started.

@RainyDay you asked the same question in a different thread.

2 Likes

Thanks @renehoj! The machine has been up and non-frozen for 8 hours now, so looks like that was it. Typically it was freezing in just a few minutes before.

1 Like

Excuse me @RainyDay @renehoj Could you please clarify if a separate video output always required per GPU? Is it possible to have output from multiple GPUs (assigned to different qubes) on the same screen?

My expectation was that if one assigns a separate GPU to a qube, it will always require a separate video output and this is a show stopper for me. I can tolerate having dom0 assigned to an iGPU with a separate small screen, but I need to see multiple “production” qubes on the same main screen.

Thank you for clarification!

UPD: @renehoj I found your message:

Yes, you set up the qube with GPU pass-through, and the GPU output is displayed in native dom0 windows, using the internal graphics.

Using Hybrid Graphics to play games with seamless GPU acceleration
“Forwarding the dGPU to the iGPU seems to work in most games, but not all games work with Qubes OS mouse input and graphics. In one game, I had issues with hold down a mouse button to navigate. The screen size in Qubes OS also seems to cause issues, when using multiple displays and not running window mode.”

Could you please point to a guide on how to do that?
Specifically, I’m looking for ways to have some qubes GPU-accelerated for good browsing performance, YouTube, etc.

I’m having a difficult time envisioning what the desired state you want is, but if you’re asking if multiple GPUs from multiple VMs, each sending their own display signal to the same monitor, I assume this could be done as long as:

  • The monitor supports multiple inputs
  • Each physical GPU has its own physical cable going to the monitor (monitor has to support multiple inputs)
  • The monitor can handle the physical inputs in a way that you desire (picture-in-picture, split-screen, manually cycling through inputs)

I’m describing this:

vm1+gpu1 —— GPU1 HDMI —-> Display1 HDMI IN1
vm2+gpu2 —— GPU2 HDMI —-> Display1 HDMI IN2
…

It’s the same as if each VM+GPU pair was a separate physical computer

This would require some work (the passthrough of each GPU to each respective VM, and configuration of Xorg in each VM) but should be possible

If you’re envisioning something other than this, I will remind you that Qubes will not do any “magic” to multiplex or switch the signal in software over a single physical display cable to the monitor, as far as I know. At least not while losing the hardware acceleration. That sort of thing doesn’t seem possible without special hardware

Maybe that’s what you’re looking for, a specialized “KVM” (not really a KVM necessarily, but some hardware that can handle multiple input signals and produce a single output signal). You will need to figure out what to do for the keyboard and mouse situation anyway, I guess

Hope that is helpful.

Maybe someone else understands better what you’re after, or can explain what I’m trying to communicate more clearly (or correct anything I may have incorrect)

Thank you, @Churros ! My ultimate goal is to be able to see output from different Linux qubes on the same screen AND have good graphics performance in at least one-two of these qubes. Main use case for GPU acceleration is web browsing, including YouTube. From my point of view, browsing without GPU acceleration does not provide reasonably good user experience. I don’t want to have different physical video outputs from different qube(s).

Based on Mesa 25.0 improvements (https://www.phoronix.com/news/AMDGPU-VirtIO-Native-Mesa-25.0), I have an impression that it will allow to have GPU acceleration in KVM guest Linux machines with near-native performance without SR-IOV (assuming AMD GPUs). I’m not sure if I understood it correctly, but if I did, it looks like a solution. Running KVM VMs as a “poor man’s Qubes” is not that secure, but would provide a reasonable user experience. I would prefer to go with Qubes, though

1 Like