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

FPS drop and high cpu usage in multi client connection while it just streaming #177

Open
SIRMaxis opened this issue Feb 24, 2025 · 2 comments

Comments

@SIRMaxis
Copy link

Hello , and thank you for this awesome project.

i have 2x rtx 4090 , and a amd threadripper 7985wx pro

the story is , when i run heroic , without even start any games in it , my cpu usage around 30% ( single session client )

when i run the game it goes around 40% usage ,

second user connect to heroic via android client of moonlight , and do nothing and just stay inside the heroic app , fps drop a lot in stream and i believe in game for no reason , i have ubuntu 24 gnome as host

is there any reasonable explanation for this behavior? my goal is at least i run 2 game per gpu in 60 fps , and i beleive it more than enough with the resource i have and it must not have any issue in this regards.

///not relevent to the issue///
is there anyway that use sunshine as a streamer to the moonlight with this setup ( create seperate docker for each game/app with input control , but stream via sunshine?)
/// /// /// /// /// /// ///
the log of the docker :

root@test:~/wolf-docker-compose-new-image# docker-compose up 
Creating wolf-docker-compose-new-image_wolf_1 ... done
Attaching to wolf-docker-compose-new-image_wolf_1
wolf_1  | [2025-02-24 17:09:00] 
wolf_1  | [2025-02-24 17:09:00] [ /etc/cont-init.d/10-setup_user.sh: executing... ]
wolf_1  | [2025-02-24 17:09:00] **** Configure default user ****
wolf_1  | [2025-02-24 17:09:00] Container running as root. Nothing to do.
wolf_1  | [2025-02-24 17:09:00] DONE
wolf_1  | [2025-02-24 17:09:00] 
wolf_1  | [2025-02-24 17:09:00] [ /etc/cont-init.d/15-setup_devices.sh: executing... ]
wolf_1  | [2025-02-24 17:09:00] **** Configure devices ****
wolf_1  | [2025-02-24 17:09:00] Exec device groups
wolf_1  | [2025-02-24 17:09:00] Adding user 'root' to groups: sgx
wolf_1  | [2025-02-24 17:09:00] DONE
wolf_1  | [2025-02-24 17:09:00] 
wolf_1  | [2025-02-24 17:09:00] [ /etc/cont-init.d/30-nvidia.sh: executing... ]
wolf_1  | [2025-02-24 17:09:00] Nvidia driver volume detected
wolf_1  | /sbin/ldconfig.real: /usr/local/lib/liblibgstwaylanddisplay.so.0.3 is not a symbolic link
wolf_1  | 
wolf_1  | [2025-02-24 17:09:00] [nvidia] Add Vulkan ICD
wolf_1  | [2025-02-24 17:09:00] [nvidia] Add EGL external platform
wolf_1  | [2025-02-24 17:09:00] [nvidia] Add egl-vendor
wolf_1  | [2025-02-24 17:09:00] [nvidia] Add gbm backend
wolf_1  | [2025-02-24 17:09:00] 
wolf_1  | [2025-02-24 17:09:00] [ /etc/cont-init.d/init-gamescope.sh: executing... ]
wolf_1  | [2025-02-24 17:09:00] Launching the container's startup script as user 'root'
wolf_1  | 0:00:00.036300783   164 0x60b60d82e7f0 WARN                 default gstvaapi.c:229:plugin_init: Cannot create a VA display
wolf_1  | 0:00:00.047357283   164 0x60b60d82e7f0 WARN               vadisplay gstvadisplay.c:401:gst_va_display_initialize:<vadisplaydrm0> vaInitialize: unknown libva error
wolf_1  | 0:00:00.047409392   164 0x60b60d82e7f0 WARN               vadisplay gstvadisplay.c:401:gst_va_display_initialize:<vadisplaydrm1> vaInitialize: unknown libva error
wolf_1  | 0:00:00.054628136   164 0x60b60d82e7f0 WARN             msdkcontext gstmsdkcontext.c:178:gst_msdk_context_use_vaapi: Couldn't find a drm device node to open
wolf_1  | 0:00:00.063825849   164 0x60b60d82e7f0 WARN                 default ges-meta-container.c:236:_set_value:<GESAsset@0x60b60dc09e20> Could not set value on item: format-version
wolf_1  | 0:00:00.063839028   164 0x60b60d82e7f0 WARN                 default ges-meta-container.c:236:_set_value:<GESAsset@0x60b60dc2d650> Could not set value on item: format-version
wolf_1  | 0:00:00.063847711   164 0x60b60d82e7f0 WARN                 default ges-meta-container.c:236:_set_value:<GESAsset@0x60b60dc2dda0> Could not set value on item: format-version
wolf_1  | 0:00:00.064049375   164 0x60b60d82e7f0 WARN               structure gststructure.c:2375:priv_gst_structure_parse_fields: Failed to find delimiter, r=mimetype
wolf_1  | 0:00:00.112845744   164 0x60b60d82e7f0 WARN               cudanvrtc gstcudanvrtc.cpp:177:gst_cuda_nvrtc_load_library_once: Failed to load 'nvrtcGetCUBINSize', 'nvrtcGetCUBINSize': /usr/local/nvidia/lib/libnvrtc.so: undefined symbol: nvrtcGetCUBINSize
wolf_1  | 0:00:01.048739252   164 0x60b60d82e7f0 WARN      GST_PLUGIN_LOADING gstplugin.c:542:gst_plugin_register_func: plugin "/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/validate/libgstvalidatessim.so" failed to initialise
wolf_1  | 0:00:01.059053585   164 0x60b60d82e7f0 WARN               vadisplay gstvadisplay.c:401:gst_va_display_initialize:<vadisplaydrm2> vaInitialize: unknown libva error
wolf_1  | 0:00:01.059116810   164 0x60b60d82e7f0 WARN               vadisplay gstvadisplay.c:401:gst_va_display_initialize:<vadisplaydrm3> vaInitialize: unknown libva error
wolf_1  | 0:00:01.060373341   164 0x60b60d82e7f0 WARN      GST_PLUGIN_LOADING gstplugin.c:542:gst_plugin_register_func: plugin "/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvalidatessim.so" failed to initialise
wolf_1  | 0:00:01.063138534     1 0x584726b7b1e0 WARN            GST_REGISTRY gstregistry.c:457:gst_registry_add_plugin:<registry0> Not replacing plugin because new one (/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvalidatessim.so) is blacklisted but for a different location than existing one (/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/validate/libgstvalidatessim.so)
wolf_1  | 0:00:01.064967436   164 0x60b60d82e7f0 WARN      GST_PLUGIN_LOADING gstplugin.c:542:gst_plugin_register_func: plugin "/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/validate/libgstvalidatessim.so" failed to initialise
wolf_1  | 0:00:01.065309961   164 0x60b60d82e7f0 WARN      GST_PLUGIN_LOADING gstplugin.c:542:gst_plugin_register_func: plugin "/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvalidatessim.so" failed to initialise
wolf_1  | 0:00:01.069315540     1 0x584726b7b1e0 WARN            GST_REGISTRY gstregistry.c:457:gst_registry_add_plugin:<registry0> Not replacing plugin because new one (/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvalidatessim.so) is blacklisted but for a different location than existing one (/usr/local/lib/x86_64-linux-gnu/gstreamer-1.0/validate/libgstvalidatessim.so)
wolf_1  | 17:09:01.563608636 INFO  | Gstreamer version: 1.25.0-1
wolf_1  | 17:09:01.564479176 INFO  | Reading config file from: /etc/wolf/cfg/config.toml
wolf_1  | 0:00:01.125837226     1 0x584726b7b1e0 WARN               cudanvrtc gstcudanvrtc.cpp:177:gst_cuda_nvrtc_load_library_once: Failed to load 'nvrtcGetCUBINSize', 'nvrtcGetCUBINSize': /usr/local/nvidia/lib/libnvrtc.so: undefined symbol: nvrtcGetCUBINSize
wolf_1  | 17:09:02.525407647 INFO  | Using H264 encoder: nvcodec
wolf_1  | 17:09:02.525505414 INFO  | Using HEVC encoder: nvcodec
wolf_1  | 17:09:02.525545985 INFO  | Using AV1 encoder: nvcodec
wolf_1  | 17:09:02.526331688 INFO  | HTTP server listening on port: 47989 
wolf_1  | 17:09:02.526412940 INFO  | Starting API server on /tmp/wolf.sock
wolf_1  | 17:09:02.526425709 INFO  | RTSP server started on port: 48010
wolf_1  | 17:09:02.526470827 INFO  | Starting mDNS service
wolf_1  | 17:09:02.526544989 INFO  | Control server started on port: 47999
wolf_1  | XDG_RUNTIME_DIR (/tmp/sockets) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
wolf_1  | 17:09:02.526752040 WARN  | [PULSE] Unable to connect, Access denied
wolf_1  | 17:09:02.526801264 INFO  | Starting PulseAudio docker container
wolf_1  | 17:09:02.527296910 INFO  | HTTPS server listening on port: 47984 
wolf_1  | 17:09:02.527670483 WARN  | [DOCKER] Container WolfPulseAudio already present, removing first

htop output cpu usage in 2 session connection :

Image

when one session running game "silent hill remake" in heroic and other one just inside the heroic app:

Image

both running game on heroic + a tird user just goes inside steam app on moonlight via an i phone:

Image

also wolf dont use my other gpu at all , it use same gpu for all sessions of apps :

Image

@ABeltramo
Copy link
Member

I think there are a few different things going on at the same time here:

  1. Based on your last screenshot, you are exhausting one GPU (97% usage). Now this obviously depends on a lot of factors, but mostly the game played (quality settings etc) and the Moonlight client asked resolution/framerate. Lowering settings should improve things across the board.
  2. Automatic multi-gpu load balancing isn't implemented in Wolf yet. You can do that manually by tweaking the config.toml, see the docs
  3. As for the CPU usage, we aren't currently using the best possible pipeline for video HW encoding. I'm currently working on it, and you can try out a beta version from this PR: Implement zero copy pipeline #156 if you are willing to test it

is there anyway that use sunshine as a streamer to the moonlight with this setup ( create seperate docker for each game/app with input control , but stream via sunshine?)

I have tried that route a few years ago, and I was hitting all kind of issues. Input separation is a big one, automatic resolution and IP/port handling was another big headache. Wolf is born exactly to implement this multi-user behaviour. 😉

@SIRMaxis
Copy link
Author

thank you for your detailed reply ,

wolf is amazing exactly and work like a charm.

for gpu load balancing , i have read the docs for manually give the gpu ,

but there is a issue , how i can seperate one app to for example if i have 4 user , it give gpu 1 to first 2 user , and second gpu to other 2

as i saw in the config file (.toml) i belive , i put it manually , but it do not use that renderer gpu for some reason ,

i wanted to run seperate wolfs , but it simply not running ( like give gpu 1 to wolf1 container , and gpu 2 to wolf2 container )

but it return me lot of errors include ports conflict , so i just gave up :D

also im trying to change the base image of each app from ubuntu to something simpler and lightweight like alpine or arch based images.

currently my base host os is ubuntu 24 which is not that much good for gaming , and possibly losing lot of performance here.

btw,

have you tried other os images for apps , like arch for example? if nvidia drivers works on them maybe it can gain some perfomance for games.

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