Page MenuHome

Fix T99706: Crash rendering with headless builds
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Jul 15 2022, 6:28 AM.

Details

Summary

When rendering with headless builds, show an error instead of crashing.

Previously GPU_backend_init was called indirectly from DRW_opengl_context_create, a new function is now called from the window manager (GPU_backend_init_once), so it's possible to check if the GPU has a back-end.

This also disables the bgl Python module when building WITH_HEADLESS.

Diff Detail

Repository
rB Blender
Branch
TEMP-T99706-FIX (branched from master)
Build Status
Buildable 23005
Build 23005: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Jul 15 2022, 6:28 AM
Campbell Barton (campbellbarton) created this revision.

Does this means headless builds are now unable to create a GL context? IIRC some implementation of EGL allows this. But if headless builds mean no GPU backend, so be it.

If that's not the case, I would prefer to see a a "try and catch error" approach instead.

This revision is now accepted and ready to land.Jul 15 2022, 10:25 AM

Yes, the headless builds don't have an OpenGL context. This could be supported but it's currently not the case.

This causes Eevee background renders to crash, I'll quickly commit a fix since the studio here is relying on Eevee for the Project Heist.