mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

--gpu doesn't install drivers automatically anymore #198

Closed 01e9 closed 4 years ago

01e9 commented 4 years ago
  1. The x11docker script
  2. The driver is prepared in the right directory
  3. Output doesn't contain "installing driver..." and container starts fast.
mviereck commented 4 years ago

Thank you for the report!

I did a test run with the current master version, it works well so far. Can you please show me the output with option --debug? What is your x11docker version?

Maybe this check fails, could you please try it out?

head -n1 2>/dev/null </proc/driver/nvidia/version | awk '{ print $8 }'

It should print 390.116 on your system.

01e9 commented 4 years ago

With --debug https://pastebin.com/raw/6BhncsRy Driver version and installer are detected properly but installation is not starting.

mviereck commented 4 years ago

Ok, it is fixed now. It only happened along with --cap-default, so i missed it first. It was only one : missing in the code. :) Please update to current master. I'll publish a new release soon.

01e9 commented 4 years ago

Fixed. Thanks!

mviereck commented 4 years ago

I did a change in latest commit that affects the NVIDIA driver installation, too.

x11docker's root setup in container now runs with --privileged flag. This gives all privileges that are needed to install the driver. The final container command on the other hand does not need or get any privileges anymore.

Could you please run two tests for me? This should just work and show the NVIDIA card name:

x11docker --gpu x11docker/check glxinfo | grep renderer

This one might fail:

x11docker --gpu --init=systemd --newprivileges=no x11docker/check glxinfo | grep renderer

I need to check if --newprivileges=no makes a difference here. With --init=systemd x11docker takes another code path that does not give --privileged to containerrootrc.

Background: Earlier the NVIDIA driver did not need --newprivileges=yes. Later the driver installation failed and needed --newprivileges=yes (automatically enabled). Now it works in my tests with --newprivileges=no again.

It is confusing and I assume that there has been a docker bug for some time. With my current Docker version 19.03.5 the installation succeeds with --newprivileges=no.

01e9 commented 4 years ago
$ uname -a
Linux d 5.0.0-37-generic #40~18.04.1-Ubuntu SMP Thu Nov 14 12:06:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:    18.04
Codename:   bionic

$ docker version
Client: Docker Engine - Community
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea838
 Built:             Wed Nov 13 07:29:52 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838
  Built:            Wed Nov 13 07:28:22 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
mviereck commented 4 years ago

Thank you! So it seems the driver installation succeeds again without --newprivileges=yes. Maybe I can disable that in the code again. It has been an issue in #162. I'll ask there for a check, too.