[FEAT] Xorg GPU acceleration
msinfo32github opened this issue · 10 comments
Is this a new feature request?
- I have searched the existing issues
Wanted change
- Optionally allow GPU usage to be used for KasmVNC session
Reason for change
- This should reduce CPU usage of the container when in-use as llvmpipe does not need to be used by xorg. Instead, this should be handled by the GPU driver (as far as I can tell) to render xorg
- When moving applications around the desktop, while monitoring CPU usage with htop, it shows that the CPU usage is increased almost to 40% usage just by moving a window around. This behaviour can also be seen with any video playback or anything graphically-heavy.
Proposed code change
No response
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
It already supports it
https://github.com/linuxserver/docker-webtop?tab=readme-ov-file#optional-run-configurations
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
.
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
Did not see your reply until now weirdly. I'll look into this, thanks!
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
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.
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?
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.
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