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.86k stars 181 forks source link

[FEAT] Xorg GPU acceleration #241

Closed msinfo32github closed 5 months ago

msinfo32github commented 5 months ago

Is this a new feature request?

Wanted change

Reason for change

Proposed code change

No response

github-actions[bot] commented 5 months ago

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

aptalca commented 5 months ago

It already supports it https://github.com/linuxserver/docker-webtop?tab=readme-ov-file#optional-run-configurations

msinfo32github commented 5 months ago

This looks like something that may be supported within KasmVNC.

The documentation says this:

-hw3d Enable hardware 3d acceleration. Default is software (llvmpipe usually).

Also, within the README.md for kasmtech/KasmVNC has a configuration option for hw3d: false.

msinfo32github commented 5 months ago

It seems that this is something that can be configured in ~/.vnc/kasmvnc.yaml. However, from my testing with the following configuration it does not seem to make any changes.

desktop:
  gpu:
    hw3d: true
    drinode: /dev/dri/renderD128
msinfo32github commented 5 months ago

Did not see your reply until now weirdly. I'll look into this, thanks!

msinfo32github commented 5 months ago

I believe that I am already using this?

Here is my docker-compose.yml file.

---
services:
  webtop:
    image: linuxserver/webtop:latest
    container_name: webtop-02
    security_opt:
      - seccomp:unconfined #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - SUBFOLDER=/ #optional
      - TITLE=Webtop 02 #optional
      - DRINODE=/dev/dri/renderD128
    volumes:
      - ./:/config
      - /var/run/docker.sock:/var/run/docker.sock #optional
    ports:
      - 3000:3000
      - 3001:3001
    devices:
      - /dev/dri:/dev/dri #optional
    shm_size: "1gb" #optional
    restart: unless-stopped

I can confirm that the GPU is seen in the webtop as this shows up when using glxgears -info

msinfo32github commented 5 months ago

Having re-read the docs it seems that adding that configuration file is redundant as this is set through the environment variable as previously mentioned.

msinfo32github commented 5 months ago

Looking again at CPU usage while moving around windows, the CPU usage is from /usr/local/bin/Xvnc - It shows that it is running with the -hw3d flag. Is this potentially something that can not be resolved?

msinfo32github commented 5 months ago

I believe I may have misunderstood the usage of GPU usage within this webtop container. It seems this is intended and may be further caused by using lossless? There is a similar issue here. I will now close this as there is no reason to leave this feature request open.

thelamer commented 5 months ago

When you run the image in kasm it uses this init: https://github.com/linuxserver/docker-baseimage-kasmvnc/blob/master/root/kasminit

This will work like all other Kasm Images for GPU integration, so you need to either use their NVIDIA stuff or the manual DRI3 config as laid out in their docs: https://www.kasmweb.com/docs/latest/how_to/manual_intel_amd.html#dri3

When doing just a standalone webtop all you should have to do is --device /dev/dri:/dev/dri