Cannot access GPU from unprivileged container (/dev/dri does not exist)

Smoochii

New Member
Jun 2, 2024
7
0
1
My proxmox host has a dedicated nvidia 980 GPU that I have set up for pass through. I am able to successfully pass it through to a Linux VM that I have but now I'm trying to set up KASM in an LXC and get the card passed through to that as well for hardware acceleration. The container is unprivileged and I was following this YT guide https://www.youtube.com/watch?v=0ZDr5h52OOE but when I got to the step to access `/dev/dri` I couldn't as it didn't exist.

I came across this forum post: https://forum.proxmox.com/threads/s...ess-dev-dri-no-such-file-or-directory.109801/ and tried to follow some of these directions but I think this might be for integrated graphics?

I tried to remove `nvidia` from the blacklist.conf in modprobe but that didn't seem to work. I also updated `vfio.conf` to read:

```
options vfio-pci ids=10de:17c8 disable_vga=1
softdep KERNEL_DRIVER pre: vfio-pci
```

But I still can't seem to access this. Can I not use the video card for passthrough to VMs and to LXCs? I don't mind deleting my VM and undoing the passthrough, just trying to figure out the easiest way to proceed.

Thanks!
 
Did you install the NVIDIA-driver on the host? This is needed for GPU passthrough to a container.
But passing a device to a VM and a container simultaneously is not possible.

Also passing devices to containers has since become easier. In the Web UI select the container and navigate to "Resources" -> "Add" -> "Device Passthrough". Then enter the device path and click on "Add".
 
Last edited:
Yes, I have almost everything working except KASM can't seem to pick up the device or maybe it's the drivers. I want to reiterate that this is an unprivileged container. Here are all the steps that I took:
  1. Disable passthrough for VM (disable vfio and nouveau modules and enable nvidia module)
  2. Install nvidia drivers on host, nvidia-smi shows the correct card
  3. Install nvidia drivers without kernel on the LXC
  4. Mount video card and renderD128 on the container in the <containterID>.conf and give permissions to video and render groups
  5. nvidia-smi in container correctly shows my GPU
  6. Installed nvidia-container-toolkit on the container and configure Docker

The problem I'm having now is getting KASM to actually use the video card for GPU acceleration. KASM can see the card but won't actually use it for anything. It says I always have MESA drivers installed.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!