Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen Tearing in games (run using wine/lutis/steam) with Nvidia RTX 4090 and docker-nvidia-egl-desktop #918

Open
srinidhikrs opened this issue Feb 11, 2025 · 2 comments

Comments

@srinidhikrs
Copy link

I am using docker-nvidia-egl-desktop to launch containers on a headless server having NVIDIA RTX 4090 card , and streaming using webrtc . When I launch games using wine/lutris/steam ,with Xvfb resolution set to 1080p or higher, screen tear is visible in the center of the screen. But for resolutions 720p or lower no screen tear is visible.

While launching docker container if graphics is not included in (-e NVIDIA_DRIVER_CAPABILITIES=video) , tearing is not there in games with resolution of 1080p or higher . But GPU usage is very high (around 70 %) .

while launching docker container if --runtime=nvidia is added and graphics is included in -e NVIDIA_DRIVER_CAPABILITIES=video,graphics, tearing is present in games with resolutions of 1080p and higher . But GPU usage is very normal (around 10 %) .

root@gpuworstation:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy

root@gpuworstation:~# nvidia-smi
Tue Feb 11 06:56:42 2025
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.86.16 Driver Version: 570.86.16 CUDA Version: 12.8 |
|-----------------------------------------+------------------------+----------------------+
| 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 RTX 4090 Off | 00000000:01:00.0 On | Off |
| 0% 35C P8 15W / 450W | 34MiB / 24564MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+

ii nvidia-container-toolkit 1.17.4-1 amd64 NVIDIA Container toolkit
ii nvidia-container-toolkit-base 1.17.4-1 amd64 NVIDIA Container Toolkit Base

Please help to resolve the screen tearing problem .

game_tear.mp4

In the attachment , it can be seen that the tear is happening in the game window only (movement left and right of flash white light) but not the entire desktop
And tearing is happening only with resolutions above 720p. (like 1080p , 1440p,.....) . But not for resolutions 720p or less

docker command :

docker run --ulimit nofile=1048576:1048576 --privileged --network=host --runtime=nvidia --name egl2 -v /FF7/:/home/ubuntu -it -d --gpus 1 --tmpfs /dev/shm:rw -e TZ=UTC -e DISPLAY_SIZEW=1920 -e DISPLAY_SIZEH=1080 -e DISPLAY_REFRESH=60 -e DISPLAY_DPI=96 -e DISPLAY_CDEPTH=24 -e PASSWD=mypasswd -e SELKIES_ENCODER=nvh264enc -e SELKIES_VIDEO_BITRATE=6000 -e SELKIES_FRAMERATE=60 -e SELKIES_AUDIO_BITRATE=128000 -e SELKIES_BASIC_AUTH_PASSWORD=mypasswd -e DISPLAY=:33 -e NGINX_PORT=8084 -e SELKIES_PORT=8085 -e SELKIES_METRICS_HTTP_PORT=8123 -e __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1 -e __GL_SHADER_DISK_CACHE_PATH=/home/ubuntu/sc2 -e __GL_MaxFramesAllowed=1 -e SELKIES_RTC_CONFIG_JSON=/home/ubuntu/rtc.json -e NVIDIA_DRIVER_CAPABILITIES=video ghcr.io/selkies-project/nvidia-egl-desktop:24.04-jstest

Thanks
Srinidhi

@ehfd
Copy link
Contributor

ehfd commented Feb 14, 2025

@elezar Hi, Evan.

Let me elaborate a bit here.

egltest.zip

GL_RENDERER   = NVIDIA GeForce RTX 4090/PCIe/SSE2
GL_VERSION    = 4.6.0 NVIDIA 560.35.03
GL_VENDOR     = NVIDIA Corporation

The findings were that for some reason, when -e NVIDIA_DRIVER_CAPABILITIES=video -e VKD3D_FRAME_RATE=60 -e DXVK_FRAME_RATE=60 was used with Docker and --runtime=nvidia/--gpus 1 (most critical part being where there is no display,graphics in NVIDIA_DRIVER_CAPABILITIES), there was a subtle (-20%) increase in frames for glxgears -info and no tearing with the VKD3D/DXVK workload.
Might there be something going on here? The tearing stopping when there is no display,graphics is confusing.

The methodology being incorporated here is identical to https://forums.developer.nvidia.com/t/headless-vulkan-with-multiple-gpus/222832/15 and https://forums.developer.nvidia.com/t/headless-vulkan-with-multiple-gpus/222832/9.

More references: VirtualGL/virtualgl#273 (comment)

@ehfd
Copy link
Contributor

ehfd commented Feb 14, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants