Consider GPU Passthrough Support #178
Replies: 9 comments
-
I found this github repo explaining how to do GPU passthrough. It would be great if X11Libre would able to detect whenever this happens and result to:
Outcome of such suggestion will result in following: 🔁 Support reinitialization on GPU rebind: Allow Xorg to detect and recover the GPU when it’s returned after the VM shuts down, without needing to restart the X session. 🖥️ Fallback rendering or status message: Provide a basic framebuffer or VESA-mode screen with a clear message (e.g., “GPU temporarily unavailable – running in fallback mode”) to inform the user during transitions. |
Beta Was this translation helpful? Give feedback.
-
We need to have a GPU partitioning system to allow an amount of GPU cores to be assigned/reserved for VFIO usage. This way we don't have to unbind a GPU in a single GPU system and leave the host system headless. |
Beta Was this translation helpful? Give feedback.
-
With containers, you can do various things you can't do with full VMs.
For example, you can pass through a socket for X.
You can pass through a render node from /dev/dri/ for headless GPU
rendering & acceleration.
You can pass through a card node so you can do KMS / modesetting stuff
(actually show things on the monitors connected to a card).
In theory, you could pass through a drm lease for a specific output as
an fd.
There is also VKMS, which is basically virtual card nodes. VKMS was
originally created for testing purposes, but I think it'd be interesting
to see if it could be used as a fake display, and then show it in a
window in the hosts display manager.
That said, I don't think most of those things actually need any changes
in X, I think this is mainly things that'd need to be added to container
managers like docker, lxc, lxd, libvirt-lxc, and whatever else may be
out there. Maybe some work may be needed on the kernel side too. This
would then also work independent of the display manager in the
container, so it'd work with wayland and mir too. And it doesn't require
unbinding the graphics card from the host system.
|
Beta Was this translation helpful? Give feedback.
-
@reaperx7 @Daniel-Abrecht Is this perfect? I found early discussions very important since i predict, that X11Libre will be very successful and highly adopted project in other Linux distros. |
Beta Was this translation helpful? Give feedback.
-
I've seen scenarios where Nvidia cards (single GPU) can be used in this manner, without going headless on the host. I wish I knew how they did it. But basically, you create, for example, a Virtual Geforce RTX 430MX or 4050 on a Geforce RTX 4090 for usage with KVM-QEmu with full passthrough, and under Windows, you just install the Nvidia driver normally but it shows up as the 430MX or 4050 with it's allocated RAM even. Usually 4-8GB. I've seen Youtubers hint at how it's done, but it only works with Nvidia cards somehow, probably through their kernel driver(?) but I don't have a way to test this. I do have an old QuadroFX 470 PCIE but last time I tried using it as a secondary GPU to use for VFIO, my system refused to POST on it or my Radeon RX 5700XT. |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Moving this to X11Libre Ideas · Discussions · GitHub to refine this further. |
Beta Was this translation helpful? Give feedback.
-
I was thinking, the Virtual GPU system is already in place, why can't VFIO be redirected to the VirGL system through Mesa to use hardware resources still? |
Beta Was this translation helpful? Give feedback.
-
Thank you for your contribution! We currently restructured the "Ideas" discussions and accordingly this discussion will be moved to the Good Ideas For Later category. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’ve been exploring GPU passthrough setups in containers/VMs and came across the dockur/windows Docker Compose example. It demonstrates an approach where the host’s NVIDIA GPU is dynamically unbound from the host drivers (like nouveau or nvidia) and bound to VFIO for passthrough into a Windows container, then switched back after shutdown.
Given this increasingly popular use case, I’d like to suggest that this X11Libre explicitly:
From what I’ve seen, GPU passthrough is often complicated by Xorg or Wayland sessions crashing or losing display when the GPU driver is unloaded on the host.
Since this fork is presumably will be a key part of the Linux graphics future stack, considering these scenarios and aiming for smooth, robust support would benefit users looking to run GPU-intensive workloads inside containers or VMs.
That would definitely help to migrate a lot of windows 10 users to Linux.
Happy to provide more context or help test if needed. Thank you for your work!
Beta Was this translation helpful? Give feedback.
All reactions