linuxserver / docker-webtop

Ubuntu, Alpine, Arch, and Fedora based Webtop images, Linux in a web browser supporting popular desktop environments.
GNU General Public License v3.0
1.93k stars 198 forks source link

[BUG] Cannot access the desktop when mounting a GPU to container #153

Closed Rainlv closed 1 year ago

Rainlv commented 1 year ago

Is there an existing issue for this?

Current Behavior

image

By the way, it could work perfect on my ubuntu20.04 which is physical machine. And it can also work fine without mounting GPU to container.

Steps To Reproduce

run sudo docker run -p 3000:3000 --name=webtop --security-opt seccomp=unconfined --gpus=all linuxserver/webtop:ubuntu-xfce on ubuntu18.04 on vSphere6.7 maybe.

Environment

- OS: Ubuntu 18.04 LTS
- Docker Version: 23.0.4
- Docker Image: linuxserver/webtop:ubuntu-xfce
- Virtualization Platform: vSphere 6.7
- How docker service was installed: apt

/etc/docker/daemon.json:

{
    "default-runtime": "nvidia",
    "runtimes": {
        "nvidia": {
            "args": [],
            "path": "nvidia-container-runtime"
        }
    },
    "registry-mirrors": [
    "https://registry.docker-cn.com"
  ],
  "insecure-registries":["192.168.30.20:7080"]
}

nvidia-smi output:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.89.02    Driver Version: 525.89.02    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:03:00.0 Off |                  N/A |
| 30%   25C    P8     7W / 350W |      5MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  Off  | 00000000:04:00.0 Off |                  N/A |
| 34%   58C    P2   113W / 350W |  22980MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA GeForce ...  Off  | 00000000:0B:00.0 Off |                  N/A |
| 30%   25C    P8     3W / 350W |      5MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   3  NVIDIA GeForce ...  Off  | 00000000:13:00.0 Off |                  N/A |
| 30%   25C    P8     8W / 350W |      5MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   4  NVIDIA GeForce ...  Off  | 00000000:14:00.0 Off |                  N/A |
| 30%   28C    P8     4W / 350W |      8MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   5  NVIDIA GeForce ...  Off  | 00000000:1B:00.0 Off |                  N/A |
| 30%   24C    P8     2W / 350W |      8MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

CPU architecture

x86-64

Docker creation

sudo docker run -p 3000:3000  --name=webtop --security-opt seccomp=unconfined --gpus=all linuxserver/webtop:ubuntu-xfce

Container logs

migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    911
User GID:    911
───────────────────────────────────────

**** adding /dev/dri/renderD133 to video group root with id 0 ****
**** permissions for /dev/dri/renderD131 are good ****
**** permissions for /dev/dri/card6 are good ****
**** permissions for /dev/dri/renderD134 are good ****
**** permissions for /dev/dri/renderD130 are good ****
**** permissions for /dev/dri/card4 are good ****
**** permissions for /dev/dri/card1 are good ****
**** permissions for /dev/dri/renderD132 are good ****
**** permissions for /dev/dri/card5 are good ****
**** permissions for /dev/dri/card3 are good ****
**** permissions for /dev/dri/card2 are good ****
**** permissions for /dev/dri/renderD129 are good ****
[custom-init] No custom files found, skipping...
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.

Xvnc KasmVNC 1.1.0 - built Jun 10 2023 18:44:30
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

(EE) 
Fatal server error:
(EE) Failed to create gbm
(EE) 
[ls.io-init] done.
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.1.0 - built Jun 10 2023 18:44:30
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

(EE) 
Fatal server error:
(EE) Failed to create gbm
(EE) 
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.1.0 - built Jun 10 2023 18:44:30
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

(EE) 
Fatal server error:
(EE) Failed to create gbm
(EE) 
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.1.0 - built Jun 10 2023 18:44:30
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

(EE) 
Fatal server error:
(EE) Failed to create gbm
(EE) 
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.1.0 - built Jun 10 2023 18:44:30
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

(EE) 
Fatal server error:
(EE) Failed to create gbm
(EE) 
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc KasmVNC 1.1.0 - built Jun 10 2023 18:44:30
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

Rainlv commented 1 year ago

SOLVED! Just add --device /dev/dri:/dev/dri when creating container. Full command: sudo docker run -p 3000:3000 --name=webtop --security-opt seccomp=unconfined --gpus=all --device /dev/dri:/dev/dri linuxserver/webtop:ubuntu-xfce

Rainlv commented 1 year ago

When mounting GPUs in k8s, they rely on the device plugin for scheduling. However, using the --device flag adds all GPUs to the container, which doesn't meet our needs. Is it possible to start a container with gpu without using the --device flag?

Roxedus commented 1 year ago

Thats a question better asked to the plugin/k8s folks, that has nothing to do with the image.

Milor123 commented 1 month ago

SOLVED! Just add --device /dev/dri:/dev/dri when creating container. Full command: sudo docker run -p 3000:3000 --name=webtop --security-opt seccomp=unconfined --gpus=all --device /dev/dri:/dev/dri linuxserver/webtop:ubuntu-xfce

with it can enable CUDA? or how can enable CUDA in a image with VNC?