Hello, I’m fairly n00b with LXD, coming from some other virtualization/hypervisor systems (VMWare, Proxmox, virt-manager on this same Ubuntu machine that I am running LXD on).
My use case is to run VMs with a GPU and USB controller passed through, with a physical monitor, keyboard, and mouse.
A recurring problem for me is that even though I seem to have successfully passed through a GPU successfully (e.g., on the command line inside the VM, it shows up when using the
lspci command), the system only outputs video to the virtual GPU.
In this example I am using Pop OS, but I have had the same issue with several distros. (I chose Pop OS today because I know after installation it defaults to using all GPUs/monitors that are available.)
I created a VM named
pop using a local ISO image (this OS has NVIDIA drivers pre-installed). I ran the installer, rebooted, and confirmed it all works with the virtual VGA console with
lxc console pop --type vga. I then stopped it and added my GPU and USB controller card with:
lxc config device add pop rtx3060 gpu gputype=physical pci=0000:01:00.0 Device rtx3060 added to pop lxc config device add pop usbcard pci address=0000:06:00.0 Device usbcard added to pop
The USB card works fine. I plug in mice, and keyboards, and they work.
The GPU almost works: running
nvidia-smi sees the GPU (an RTX 3060), and the NVIDIA Settings GUI application can not only see the GPU, but it shows that an “LG Electronics LG TV” is connected to it, which is indeed the test display I have connected.
But… the display is showing “no signal”.
I’ve tried using different cables and monitors, with the same results.
So it looks so close and yet, not working at all. It would seem like it could be a PopOS problem, except I have had the same issue with Manjaro and all the other distros I have tried, so I think the problem must be some kind of user error that is eluding me…
Any pointers or ideas of things to try would be appreciated.
 Example of how in the VM I can see the physical GPU, even though the OS in the VM is only displaying on the Virtio GPU.
mason@pop-os:~$ lspci -k | grep -A 2 -E "VGA" 04:00.0 VGA compatible controller: Red Hat, Inc. Virtio GPU (rev 01) Subsystem: Red Hat, Inc. Virtio GPU Kernel driver in use: virtio-pci -- 07:00.0 VGA compatible controller: NVIDIA Corporation GA106 [GeForce RTX 3060] (rev a1) Subsystem: Gigabyte Technology Co., Ltd GA106 [GeForce RTX 3060] Kernel driver in use: nvidia mason@pop-os:~$ ## Or the same thing on Arch (a VM in this case created from the LXD image server) [root@archlinux ~]# lspci -k | grep -A 2 -E "(VGA|3D)" 04:00.0 VGA compatible controller: Red Hat, Inc. Virtio GPU (rev 01) Subsystem: Red Hat, Inc. Device 1100 Kernel driver in use: virtio-pci -- 07:00.0 VGA compatible controller: NVIDIA Corporation GA106 [GeForce RTX 3060] (rev a1) Subsystem: Gigabyte Technology Co., Ltd Device 4074 Kernel driver in use: nouveau [root@archlinux ~]#