Pass through every selected GPU, not just the first one - #10
Open
MickLesk wants to merge 1 commit into
Open
Conversation
Reported against unsloth on a host with an Intel iGPU and an NVIDIA card: the userspace driver went in, the script said "NVIDIA GPU configured", and torch.cuda.is_available() was False. /dev/nvidia* was never in the container config. Removing the iGPU and rerunning fixed it, which is the tell: the fault only exists when two vendors are present. Three things, each of which alone was enough to produce that. prompt_select refused to ask when stdin was not a terminal -- but the read it guards takes /dev/tty, not stdin. So `curl ... | bash`, which the docs themselves recommend for run.sh, silently took the default without ever printing the menu. It now asks whenever a terminal is reachable. Both backends then picked exactly one GPU type, defaulting to the first, and the collection order is INTEL, AMD, NVIDIA. The default on a mixed host was therefore always the iGPU. Device nodes are disjoint and an iGPU beside a discrete card is the normal case, so the choice is now multi-select and defaults to all of them. Nothing valid typed passes everything through rather than nothing: a spare device node is harmless, a missing one is this bug. Both branches used to start their dev counter at zero, which was fine while only one could run and would have overwritten entries now that several can. Finally, hwaccel.func reported success on libcuda.so.1 alone. lspci inside a container sees every host GPU whether or not it was passed through, so it will install the stack for a card the container cannot reach. It now also requires at least one /dev/nvidia* node and, when there is none, says that instead of claiming success.
Try this branchThe engine and the scripts resolve independently, so a production script can COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/community-scripts/core/fix/gpu-passthrough-multi-type \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/debian.sh)"Swap This PR touches both backends. Worth running on a Proxmox VE and an Incus host. Run a script from a fork as wellcurl -fsSL https://raw.githubusercontent.com/community-scripts/core/fix/gpu-passthrough-multi-type/tools/run.sh |
bash -s -- https://raw.githubusercontent.com/YOU/ProxmoxVED/your-branch ct/debian.sh \
https://raw.githubusercontent.com/community-scripts/core/fix/gpu-passthrough-multi-typeNote that Useful flags while testing
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✍️ Description
Reported against unsloth on a host with an Intel iGPU and an NVIDIA card: the userspace driver went in, the script said "NVIDIA GPU configured", and torch.cuda.is_available() was False. /dev/nvidia* was never in the container config. Removing the iGPU and rerunning fixed it, which is the tell: the fault only exists when two vendors are present.
Three things, each of which alone was enough to produce that.
prompt_select refused to ask when stdin was not a terminal -- but the read it guards takes /dev/tty, not stdin. So
curl ... | bash, which the docs themselves recommend for run.sh, silently took the default without ever printing the menu. It now asks whenever a terminal is reachable.Both backends then picked exactly one GPU type, defaulting to the first, and the collection order is INTEL, AMD, NVIDIA. The default on a mixed host was therefore always the iGPU. Device nodes are disjoint and an iGPU beside a discrete card is the normal case, so the choice is now multi-select and defaults to all of them. Nothing valid typed passes everything through rather than nothing: a spare device node is harmless, a missing one is this bug. Both branches used to start their dev counter at zero, which was fine while only one could run and would have overwritten entries now that several can.
Finally, hwaccel.func reported success on libcuda.so.1 alone. lspci inside a container sees every host GPU whether or not it was passed through, so it will install the stack for a card the container cannot reach. It now also requires at least one /dev/nvidia* node and, when there is none, says that instead of claiming success.
🔗 Related Issue
Fixes #
✅ Prerequisites (X in brackets)
API.txtwas updated to match.🤖 AI Assistance (X in brackets)
🛠️ Type of Change (X in brackets)
README,docs/,CONTRIBUTING.md, or other docs.