Skip to content

raylib: vendor Mesa runtime for headless rendering - #99

Open
therepanic wants to merge 3 commits into
commaai:masterfrom
therepanic:raylib-wheel-libs
Open

raylib: vendor Mesa runtime for headless rendering#99
therepanic wants to merge 3 commits into
commaai:masterfrom
therepanic:raylib-wheel-libs

Conversation

@therepanic

Copy link
Copy Markdown

Bundle the Mesa GL stack into the wheel so headless rendering works on systems without any system GL libraries.

Regression test: commaai/openpilot#38534

Comment thread raylib/raylib/__init__.py
json.dump({"file_format_version": "1.0.0", "ICD": {"library_path": "libEGL_mesa.so.0"}}, f)
os.environ["__EGL_VENDOR_LIBRARY_FILENAMES"] = vendor_json
os.environ.setdefault("LIBGL_DRIVERS_PATH", libs_dir)
os.environ["GALLIUM_DRIVER"] = "llvmpipe"

@therepanic therepanic Aug 5, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I thought we could launch using softpipe since the wheel itself would be lighter (around 18 MB compressed), but I was VERY mistaken.

openpilot test on the GitHub Actions runner ran for an hour and a half before finishing: https://github.com/commaai/openpilot/actions/runs/30970235965/job/92192765773.

With libLLVM the wheel for amd64 weighs in at around 55 MB and 5min test runtime. I also considered supporting the lightweight raylib rlsw but the performance clearly wouldn't be better than llvmpipe.

@therepanic therepanic closed this Aug 5, 2026
@therepanic therepanic reopened this Aug 5, 2026
@therepanic

Copy link
Copy Markdown
Author

The macOS build is failing even on upstream, this is not related to this change: #100.

The funny thing is that in my fork a cold build actually did pass the macOS build, whereas the amd64 and aarch64 builds failed: https://github.com/therepanic/comma_dependencies/actions/runs/31007471745.

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.

2 participants