LXD + NVIDIA GPU - no gpus

Hello. In my quest to resolve the issue explained in my post, I have arrived to this question:

After passing the gpu to my container doing this:

lxc config device add u3 gpu gpu gputype=physical
lxc stop u3
lxc config set u3 nvidia.runtime=true
lxc start u3

I noticed that there is no gpus directory inside /proc/driver/nvidia (into the container), so no pci bus is accesible inside.

In the host I have a gpus directory that contains something like 0000:07:00.0/ for every gpu in my system.

I’ve found a bug report in libnvidia github GPU information not mounted on /proc/driver/nvidia/gpus · Issue #105 · NVIDIA/libnvidia-container · GitHub that comes from GPU information with nvidia.runtime · Issue #7840 · lxc/lxd · GitHub.

Is this a bug in the way LXD passes the GPU to the container? Is there a way to get gpus directory inside the container?

LXD uses nvidia-container, it doesn’t itself have any logic around the /proc/driver/nvidia handling.

Ok, it makes sense. But then I cannot pass the gpu to docker inside the container. As per error, it needs access to gpus directory. Is there a way to workaround this?