GPU Passthrough
-
@coolsport00 Yes, I am using the GPUs with llama-swap to serve qwen3.8-27b and qwen3.6-35b for local inference with Bifrost as an AI gateway for local and cloud AI provider. Never tried vGPU myself.
-
-
@coolsport00 See if any of this helps:
Here is the step-by-step guide to configure the NVIDIA GeForce RTX 3090 for full PCI passthrough to a virtual machine in XCP-ng.Step 1: Identify the GPU on the XCP-ng HostFirst, log in to your XCP-ng host via SSH or use the local console shell to find the exact hardware address of your RTX 3090.Run the following command to list your PCI devices and filter for NVIDIA:bashlspci | grep -i nvidia
Use code with caution.Look for the lines corresponding to your RTX 3090 and its Audio Controller. They will look similar to this:text01:00.0 VGA compatible controller: NVIDIA Corporation GA102 [GeForce RTX 3090] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GA102 High Definition Audio Controller (rev a1)
Use code with caution.Take note of the PCI identifiers (e.g., 01:00.0 and 01:00.1). Note that your specific identifier numbers might vary based on your motherboard layout.Step 2: Hide the GPU from the Control Domain (Dom0)To prevent the main XCP-ng host system (Dom0) from seizing control of the graphics card, you must tell it to ignore those PCI IDs on boot.Instruct XCP-ng to assign the GPU components to the passthrough driver (xen-pciback) by executing this command (replace 01:00.0 and 01:00.1 with your actual IDs found in Step 1):bash/opt/xensource/libexec/xen-cmdline --set-dom0 "xen-pciback.hide=(01:00.0)(01:00.1)"
Use code with caution.Reboot the physical server for this driver isolation configuration to take effect:bashreboot
Use code with caution.Step 3: Verify the IsolationOnce your host boots back up, check that the hardware isolation worked as intended.Run this command to verify that the xen-pciback driver has correctly claimed the card:bashxl pci-assignable-list
Use code with caution.You should see your GPU addresses printed in the terminal, confirming they are ready to be passed into a virtual environment:text0000:01:00.0
0000:01:00.1
Use code with caution.Step 4: Attach the GPU to your VM
You can attach the isolated card either visually using Xen Orchestra (XO) or straight from the command line interface.Option A: Using Xen Orchestra (Recommended)Navigate to the Xen Orchestra management interface.Go to the VMs tab and click on the target virtual machine (ensure it is powered down).Click on the Advanced tab of that VM.Scroll down to the PCI devices block.Select both the RTX 3090 graphics and audio IDs from the dropdown checklist and save your changes.Option B: Using the Command Line (CLI)Find the unique identifier (UUID) of your VM:bashxe vm-list name-label="Your_VM_Name"
Use code with caution.Assign the GPU to that VM UUID using the following command syntax:bashxe vm-param-set uuid=<VM_UUID> other-config:pci=0/0000:01:00.0,0/0000:01:00.1
Use code with caution.Step 5: Boot and Install DriversPower on your virtual machine. You can now download and install the official desktop NVIDIA GeForce Drivers directly inside the guest operating system. The installer will recognize the device normally, and you do not need to register a license server or install vGPU client software. -
Hi @tjkreidl . Thank you for your detailed response, but I don't need/use standard GPU passthrough to 1 VM, but to 15. So I need vGPU capability. From the XCP documentation, it looks like for now, it's not possible/supported due to proprietary issues in the Xen OS, at least with NVIDIA cards, which is what I currently use. I guess I could switch to some other vendor, but would like to stay with what I know. Appreciate it!
-
@coolsport00 Why not then just do the GPU passthrough for the entire host and just put the VMs on that host that you want to leverage the GPU? To get specific vGPU capabilities, my recollection is that you'd need to use a GPU that most likely requires licensing, at least as far as NVIDIA is concerned.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login

