SFML: Cannot create DRM context without X server running.
Prerequisite Checklist
- I searched for existing issues to prevent duplicates
- I searched for existing discussions on the forum to prevent duplicates
- I am here to report an issue and not to just ask a question or look for help (use the forum or Discord instead)
Describe your issue here
When I attempt to run any of the example programs I get the message:
DRM device used: 0
DRM device used: 1
DRM using the current mode
DRM Mode used: 3840x2160@60
Failed to set mode: Invalid argument
I’ve tried with different modes using SFML_DRM_MODE and selecting different devices with SFML_DRM_DEVICE but the outcome is the same no matter the combination.
If I start the same program with startx then it doesn’t give an error but there is no output on the display.
I’ve confirmed the GPU can output the selected mode with glmark2 and with a vanilla build of SFML. It’s only the DRM build that won’t start.
Your Environment
- OS / distro / window manager: Linux 6.1.25 Debian Bookworm
- SFML version: 2.6.1
- Compiler / toolchain: GCC version 12.2.0 - aarch64-linux-gnu
- Special compiler / CMake flags: SFML_USE_DRM SFML_BUILD_EXAMPLES
Steps to reproduce
- Download SFML 2.6.1 source
- Build with CMAKE flag SFML_USE_DRM and SFML_BUILD_EXAMPLES
- Run
./examples/opengl/openglwithout an X server running
Expected behavior
Connected display should show a spinning cube on a jungle background
Actual behavior
Program wont start with the error message “Failed to set mode: Invalid argument”
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 25 (11 by maintainers)
I just tested this on a cm4 board running raspbian 64 bit and works perfect.
Compile the 2.6.x branch with SFML_USE_DRM flag
The DRM implementation was written/ported by @mickelson, @oomek and @substring. Maybe they can look into this.