Good evening… I set up the container as follows.
The environment of the host is Ubuntu20.04 and I got the following output.
$ nvidia-smi
Wed May 20 01:04:49 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64 Driver Version: 440.64 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P1000 Off | 00000000:01:00.0 On | N/A |
| 48% 59C P0 N/A / N/A | 620MiB / 4040MiB | 3% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1639 G /usr/lib/xorg/Xorg 75MiB |
| 0 3837 G /usr/lib/xorg/Xorg 234MiB |
| 0 4061 G /usr/bin/gnome-shell 212MiB |
| 0 254871 G ...AAAAAAAAAAAACAAAAAAAAAA= --shared-files 88MiB |
+-----------------------------------------------------------------------------+
In addition, I got the following output.
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GP107GL [Quadro P1000] (rev a1)
I mean, my environment is a mix of Intel graphics cards and Nvidia graphics cards, which is somewhat confusing. Huh…
With Nvidia-only problem: "libGL error: No matching fbConfigs or visuals found" (solved) as a reference, we executed the following command.
$ cat > mygpu-profile.tmp <<_EOF_
devices:
gpu:
type: gpu
X0:
path: /tmp/.X11-unix/X0
source: /tmp/.X11-unix/X0
type: disk
config:
environment.DISPLAY: :0
_EOF_
$ lxc profile create mygpu
$ lxc profile edit mygpu < mygpu-profile.tmp
$ lxc profiel edit mygpu
add these lines:
config:
nvidia.runtime: false
nvidia.driver.capabilities: "graphics"
$ lxc launch --profile default --profile mygpu ubuntu:{distro} {distro-name} -c nvidia.runtime=true
$ lxc exec {distro-name} -- sh -c "apt update; apt install -y mesa-utils x11-apps"
As a result, nvidia-smi
worked on Ubuntu 18.04 container, and glxgears
worked without any problem.
However, on Ubuntu 16.04 container, when I do nvidia-smi
, returned command not found
and glxgears
does not work, although xeyes
did.
I’m assuming this is due to an inconsistency in referencing the host’s Nvidia-driver during the GPU pass-through and not being able to run in 16.04?
Does anyone have an answer and a solution? Thank you!