Wieku / danser-go

Dancing visualizer of osu! standard maps and custom osu! client written in Go. Also a generator for osu! videos.
Other
743 stars 102 forks source link

Fails to run on headless server #81

Open endigma opened 3 years ago

endigma commented 3 years ago

danser-go fails to start on a headless server, I don't see why this should be a requirement given the program operates headlessly. Even with SSH X11 forwarding (use client GPU) it fails.

Wieku commented 3 years ago

Sorry, I should've mentioned somewhere that at least one x11 display is needed. It's a GLFW limitation. Even in headless mode danser still needs an OpenGL capable hardware to be present in the system.

I have plans to switch to EGL from GLFW for linux GPU server support though.

Still would love to see the crash log.

McKensy commented 2 years ago

got it running with export DISPLAY=:1 Xvfb :1 -screen 0 1920x1080x24 & sleep 1

if you get output with xrandr --query then it should work

but cpu is barely being utilized by danser 😔

Wieku commented 2 years ago

Yes because it's using GPU, it's not osr2mp4

Wieku commented 2 years ago

Also I'm thinking about adding a pre-launch step on linux that would query monitors and add a virtual one like @McKensy did if none were detected

kpei commented 2 years ago

@McKensy your method worked for me however im getting the opposite where no gpu is being used at all. Ffmpeg comes precompiled on my "server" with h264_nvenc available. However only 1% of the gpu is being used. Can you share a snippet of your danser args?

Wieku commented 2 years ago

@kpei to use nvenc you have to set danser to use it: https://github.com/Wieku/danser-go/wiki/Recommended-encoding-settings

kpei commented 2 years ago

@kpei to use nvenc you have to set danser to use it: https://github.com/Wieku/danser-go/wiki/Recommended-encoding-settings

Ive already tried those recommended settings unfortunately 😔. Will post my settings here when im back on the pc. Another thing I will try is to recompile the ffmpeg binary using nvidia instructions and run danser again.

Wieku commented 2 years ago

@kpei Feel free to join danser's discord to discuss it later, I don't especially like github for that

ravener commented 1 year ago

Mesa has an environment variable LIBGL_ALWAYS_SOFTWARE=1 that can use software rendering. I personally use this because my laptop has old graphics card limited to OpenGL 2.1 while danser seems to require an OpenGL 3+ context so it fails to run, but using software rendering works around that to get it running on my laptop, works well but will of course will be more cpu heavy. So for a headless server I imagine that variable should work and get the job done if all you need is like to create a recording.

I also plan to start recording on my server to offload the encoding work, so I'll try it soon and edit this comment if I see any success.

jack3898 commented 4 months ago

got it running with export DISPLAY=:1 Xvfb :1 -screen 0 1920x1080x24 & sleep 1

if you get output with xrandr --query then it should work

but cpu is barely being utilized by danser 😔

Mate, thank you so much!! As a last ditch resort I thought i'd check here and this works flawlessly on Linode non-gpu on Ubuntu!

Given, it's super slow, but that is what I expected as there's no GPU 😬 but it's something!!