Skip to content

feat: support running without x11 on linux - #1624

Merged
Julusian merged 5 commits into
masterfrom
feat/no-x11
Apr 29, 2025
Merged

feat: support running without x11 on linux#1624
Julusian merged 5 commits into
masterfrom
feat/no-x11

Conversation

@Julusian

@Julusian Julusian commented Apr 28, 2025

Copy link
Copy Markdown
Member

Some of this is based on work done by nxtedition in their fork, but this preserves windows support and has been tweaked based on some testing.

The primary change here is to switch to using EGL to get the main opengl handle on linux.
SFML is still used for the screen consumer and diag, as well as for windows.

In my testing, this works fine when launching over ssh on:

  • ubuntu 24.04 desktop, with gdm stopped, gtx 1060
  • ubuntu 24.04 server, quadro p4000

And locally on:

  • ubuntu 24.04, gtx 1060
  • fedora 41, amdgpu

CEF needed a bit of fiddling but also appears to work happily in this setup. When we detect no X11 session, we will now set CEF to use the 'headless' backend and the angle backend to 'vulkan'. This combination works with both gpu enabled and disabled in the same tests.
With this, how CEF is run should be no different to before unless running without an X server.

The full steps to get it working on a fresh ubuntu installation:

  • sudo apt update && sudo apt upgrade
  • sudo apt install nvidia-driver-570-server
  • sudo dpkg -i desktopvideo_14.4.1a4_amd64.deb
  • sudo dpkg -i casparcg-cef-131_131.4.1~g437feba-noble1_amd64.deb and sudo apt install -f
  • sudo dpkg -i casparcg-server-beta_2.5.0~no-x11-noble+c2e478a_amd64.deb and sudo apt install -f
  • Build a casparcg.config file
  • Add and enable a basic systemd unit
  • sudo reboot to let the drivers load

Then it will launch at boot, with webgl and gpu acceleration in cef, and everything else behaving normally too.

My sample system unit (which is messy). Note that it doesn't exit cleanly, and hits the timeout so that has been set low

[Unit]
Description=CasparCG Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=julus
WorkingDirectory=/home/julus
ExecStart=/usr/bin/casparcg-server-beta
Restart=on-failure
KillSignal=SIGINT
TimeoutStopSec=10

[Install]
WantedBy=multi-user.target

@Julusian Julusian linked an issue Apr 28, 2025 that may be closed by this pull request
@Julusian
Julusian merged commit 16b1c00 into master Apr 29, 2025
jpc0 pushed a commit to jpc0/server that referenced this pull request Jun 27, 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

Successfully merging this pull request may close these issues.

Remove dependency on running x11 server

1 participant