Optimus gpu technology in Lenovo Ideapad 510

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.

@brauner seems like we should just skip the nvidia nodes if they don’t exist.

Can you file an issue against https://github.com/lxc/lxd please?

Yes, no probs. I will raise it when I get to my home laptop to fill out all the fields in the ticket.

Link to the issue: https://github.com/lxc/lxd/issues/4044

Sent a PR https://github.com/lxc/lxd/pull/4045 that should fix the issue.

1 Like

I have tested the fix. It worked. Thanks.