I am using latest openSUSE Tumbleweed for host and used the beta snap package for LXD. There are two gpus in the laptop: nvidia and intel with “Optimus” technology. I haven’t installed nvidia drivers and the Intel gpu is enabled. lspci shows nvidia graphics card too.
When I add gpu device to my container with the command below:
lxc config device add suse mygpu gpu
and start my container
lxc start suse
I get an error message similar to below (it’s not exactly the message. It is off the top of my head):
/proc/driver/nvidia/gpus/00:00/information does not exist
The only way to start the container was to go to BIOS and disable the discrete nvidia graphics card. Then there is only one Intel card and I can start the container. It is OK for me because I don’t use Nvidia a lot but may be lxd can be more forgiving when mapping gpus. I also tried to select the Intel gpu with “id” parameter but it didn’t help. I got the same error.