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

Fails to run on headless server #81

Open
endigma opened this issue Apr 1, 2021 · 10 comments
Open

Fails to run on headless server #81

endigma opened this issue Apr 1, 2021 · 10 comments
Labels
proposal New feature or request

Comments

@endigma
Copy link

endigma commented Apr 1, 2021

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
Copy link
Owner

Wieku commented Apr 1, 2021

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.

@Wieku Wieku added bug Something isn't working proposal New feature or request and removed bug Something isn't working labels Apr 1, 2021
@McKensy
Copy link

McKensy commented Dec 19, 2021

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
Copy link
Owner

Wieku commented Dec 19, 2021

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

@Wieku
Copy link
Owner

Wieku commented Dec 22, 2021

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

@Wieku Wieku closed this as completed Dec 22, 2021
@Wieku Wieku reopened this Dec 22, 2021
@kpei
Copy link

kpei commented Feb 20, 2022

@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
Copy link
Owner

Wieku commented Feb 20, 2022

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

@kpei
Copy link

kpei commented Feb 20, 2022

@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
Copy link
Owner

Wieku commented Feb 20, 2022

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

@Wieku Wieku pinned this issue May 8, 2022
@ravener
Copy link

ravener commented Jun 2, 2023

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
Copy link

jack3898 commented Mar 7, 2024

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!!

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

No branches or pull requests

6 participants