I have been trying to pass my RX 7600 through to either a VM or Container (running Ubuntu 24.04) to be used by Ollama for three days now to no success. It feels like I have tried every GPU passthrough tutorial/guide on the internet and nothing seems to work for me.
I have vfio, vfio_iommu_type1, vfio_pci, and vfio_virqfd loaded into /etc/modules, I have all GPU drivers blacklisted on the host, I have mapped my PCI device, along with every other step of almost every guide yet I keep encountering the same problem.
I first tried to get this to work with a VM but to no avail so I have switched to a privileged container. In my node I added the following lines to the container config:
dev0: /dev/dri/card0,gid=44
dev1: /dev/dri/renderD128,gid=108
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
I made sure the GIDs matched the ones in my container for video (44) and render (108). In my resources tab under the container it lists dev0 and dev1, but now whenever I try to start the container I get the error:
TASK ERROR: Device /dev/dri/renderD128 does not exist
or
TASK ERROR: Device /dev/dri/card0 does not exist
I've done all the troubleshooting I could as far as PCI and AMD GPU passthrough and I've made sure my GPU isn't being used by any other containers or VMs.
Any help is appreciated, I don't really know what info I should be sharing here to help you help me but let me know if i'm missing anything important. Believe me this isn't from a lack of trying, this post is my last attempt at trying to get this to work. Thanks.
I have vfio, vfio_iommu_type1, vfio_pci, and vfio_virqfd loaded into /etc/modules, I have all GPU drivers blacklisted on the host, I have mapped my PCI device, along with every other step of almost every guide yet I keep encountering the same problem.
I first tried to get this to work with a VM but to no avail so I have switched to a privileged container. In my node I added the following lines to the container config:
dev0: /dev/dri/card0,gid=44
dev1: /dev/dri/renderD128,gid=108
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
I made sure the GIDs matched the ones in my container for video (44) and render (108). In my resources tab under the container it lists dev0 and dev1, but now whenever I try to start the container I get the error:
TASK ERROR: Device /dev/dri/renderD128 does not exist
or
TASK ERROR: Device /dev/dri/card0 does not exist
I've done all the troubleshooting I could as far as PCI and AMD GPU passthrough and I've made sure my GPU isn't being used by any other containers or VMs.
Any help is appreciated, I don't really know what info I should be sharing here to help you help me but let me know if i'm missing anything important. Believe me this isn't from a lack of trying, this post is my last attempt at trying to get this to work. Thanks.