OpenGL headless rendering #54638

Open
opened 2018-04-16 12:21:57 +02:00 by Clément Foucault · 34 comments

This depends on #54633 and should be tackled afterwards.

We should allow OpenGL rendering on headless system (servers without display setup).

Resources on the subject are few but it seems our best shot is to use EGL. We need to assess the support of EGL across our target platforms, and the opengl features it provides.

This depends on #54633 and should be tackled afterwards. We should allow OpenGL rendering on headless system (servers without display setup). Resources on the subject are few but it seems our best shot is to use EGL. We need to assess the support of EGL across our target platforms, and the opengl features it provides.
Clément Foucault self-assigned this 2018-04-16 12:21:57 +02:00
Author
Member

Added subscriber: @fclem

Added subscriber: @fclem
Dalai Felinto changed title from Opengl headless rendering to OpenGL headless rendering 2018-04-16 12:25:07 +02:00
Author
Member

Added subscriber: @Sergey

Added subscriber: @Sergey
Author
Member

So after trying a few things on a standalone test application, we manage to create a EGL context with GL 4.6 on an Nvidia + Linux + Proprietary drivers workstation.
But we did not succeed on a AMD + Linux + Opensource drivers, only giving us a GL 3.0 context at most.

So this is highly platform dependant and might need more work to get it working nicely.

There is already an EGL backend to GHOST but it's targeted at GLES and outdated.

So we can divide this into 2 tasks:

  • Create compatible GL > 3.3 context with EGL (with maximum platform compatibility).
  • Add offscreen context functions to EGL backends.

This is not a really hard task but it is not a priority for now. So postponing for now.

Here is the test application we used : P671

Thanks @Sergey for helping me on this one.

So after trying a few things on a standalone test application, we manage to create a EGL context with GL 4.6 on an Nvidia + Linux + Proprietary drivers workstation. But we did not succeed on a AMD + Linux + Opensource drivers, only giving us a GL 3.0 context at most. So this is highly platform dependant and might need more work to get it working nicely. There is already an EGL backend to GHOST but it's targeted at GLES and outdated. So we can divide this into 2 tasks: - Create compatible GL > 3.3 context with EGL (with maximum platform compatibility). - Add offscreen context functions to EGL backends. This is not a really hard task but it is not a priority for now. So postponing for now. Here is the test application we used : [P671](https://archive.blender.org/developer/P671.txt) Thanks @Sergey for helping me on this one.

Added subscriber: @xvytis

Added subscriber: @xvytis

Added subscriber: @mareko

Added subscriber: @mareko

AMD guy here.

You need to request the Core profile for older versions of our open source driver. If you don't, you'll get the compatibility profile which is mainly used by legacy applications.

The original plan was to keep the Core profile version at GL 4.5 and the Compatibility profile version at GL 3.0 forever, but we changed our minds and started adding Compatibility profile support last year:
Mesa 18.0: OpenGL 3.0
Mesa 18.1: OpenGL 3.1
Mesa 18.2: OpenGL 4.4
Mesa 18.3: OpenGL 4.5

You are shooting yourselves in the foot by using the Compatibility (default) profile. The Core profile is slightly faster if you are CPU-bound.

AMD guy here. You need to request the Core profile for older versions of our open source driver. If you don't, you'll get the compatibility profile which is mainly used by legacy applications. The original plan was to keep the Core profile version at GL 4.5 and the Compatibility profile version at GL 3.0 forever, but we changed our minds and started adding Compatibility profile support last year: Mesa 18.0: OpenGL 3.0 Mesa 18.1: OpenGL 3.1 Mesa 18.2: OpenGL 4.4 Mesa 18.3: OpenGL 4.5 You are shooting yourselves in the foot by using the Compatibility (default) profile. The Core profile is slightly faster if you are CPU-bound.

Added subscriber: @WillW

Added subscriber: @WillW

Added subscriber: @nokipaike

Added subscriber: @nokipaike

as informative:
AMD Guy, Marek Olsak write on #69853 comments:

Mesa drivers now support the Compatibility profile on AMD hw starting with the AMD GCN architecture, so you don't need the Core profile anymore.

as informative: AMD Guy, Marek Olsak write on #69853 comments: > Mesa drivers now support the Compatibility profile on AMD hw starting with the AMD GCN architecture, so you don't need the Core profile anymore.

Added subscriber: @evantryan

Added subscriber: @evantryan

Added subscriber: @getshi

Added subscriber: @getshi

I wanted to comment on the importance of this by giving an example.

I'm working in research, where we build prototypes of new simulation methods usually as stand-alone applications (because that's the fastest way, or because there's libraries to extend, etc.), and they are usually equipped with no or only trivial rendering. Writing them directly in tools such as blender is often too big of an overhead. However, previewing rendered animations of tons of simulations (done outside blender in prototypes with only simple or no rendering) can be vital; using blender's shader nodes, modifier stack, and general layouting would be an amazing tool for that. Eevee renderings can look amazing at a fraction of the cost of cycles renderings, and for the purpose of previewing any sort of animation this can be a crucial timesaver.

For now, I am stuck with rendering on my workstation, even though I would have multiple gpu machines available in a cluster but without displays.

I wanted to comment on the importance of this by giving an example. I'm working in research, where we build prototypes of new simulation methods usually as stand-alone applications (because that's the fastest way, or because there's libraries to extend, etc.), and they are usually equipped with no or only trivial rendering. Writing them directly in tools such as blender is often too big of an overhead. However, previewing rendered animations of *tons* of simulations (done outside blender in prototypes with only simple or no rendering) can be vital; using blender's shader nodes, modifier stack, and general layouting would be an amazing tool for that. Eevee renderings can look amazing at a fraction of the cost of cycles renderings, and for the purpose of previewing any sort of animation this can be a crucial timesaver. For now, I am stuck with rendering on my workstation, even though I would have multiple gpu machines available in a cluster but without displays.
Clément Foucault was unassigned by Dalai Felinto 2019-12-23 16:36:14 +01:00
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

Bringing back EGL support and adding offscreen rendering support to it is being worked on here: D6585: X11 EGL context

Bringing back EGL support and adding offscreen rendering support to it is being worked on here: [D6585: X11 EGL context](https://archive.blender.org/developer/D6585)

Added subscriber: @christian.rauch

Added subscriber: @christian.rauch

In #54638#851657, @JulianEisel wrote:
Bringing back EGL support and adding offscreen rendering support to it is being worked on here: D6585: X11 EGL context

Yes, that is definitely possible with EGL. I implemented that once for another project: https://github.com/stevenlovegrove/Pangolin/blob/master/src/display/device/display_headless.cpp

However, this should be done in a separate GHOST implementation which does not use any windowing system. This would then allow you to build Blender without any window system dependencies (X11 / Wayland) and run it on a server. I am not sure about GLX dependencies though, the GLEW package in Ubuntu is linked against GLX (libGLX.so).

> In #54638#851657, @JulianEisel wrote: > Bringing back EGL support and adding offscreen rendering support to it is being worked on here: [D6585: X11 EGL context](https://archive.blender.org/developer/D6585) Yes, that is definitely possible with EGL. I implemented that once for another project: https://github.com/stevenlovegrove/Pangolin/blob/master/src/display/device/display_headless.cpp However, this should be done in a separate GHOST implementation which does not use any windowing system. This would then allow you to build Blender without any window system dependencies (X11 / Wayland) and run it on a server. I am not sure about GLX dependencies though, the GLEW package in Ubuntu is linked against GLX (`libGLX.so`).

Added subscriber: @pampa

Added subscriber: @pampa

Added subscriber: @svrana

Added subscriber: @svrana

Removed subscriber: @svrana

Removed subscriber: @svrana

Added subscriber: @svrana

Added subscriber: @svrana

Added subscriber: @VaclavCermak

Added subscriber: @VaclavCermak

Added subscriber: @davidmikucki

Added subscriber: @davidmikucki
Contributor

Added subscriber: @Raimund58

Added subscriber: @Raimund58

Added subscriber: @ktdfly

Added subscriber: @ktdfly

Added subscriber: @alan.melling

Added subscriber: @alan.melling

Added subscriber: @DanielHoughton

Added subscriber: @DanielHoughton

In #54638#829993, @getshi wrote:
I wanted to comment on the importance of this by giving an example.

I'm working in research, where we build prototypes of new simulation methods usually as stand-alone applications (because that's the fastest way, or because there's libraries to extend, etc.), and they are usually equipped with no or only trivial rendering. Writing them directly in tools such as blender is often too big of an overhead. However, previewing rendered animations of tons of simulations (done outside blender in prototypes with only simple or no rendering) can be vital; using blender's shader nodes, modifier stack, and general layouting would be an amazing tool for that. Eevee renderings can look amazing at a fraction of the cost of cycles renderings, and for the purpose of previewing any sort of animation this can be a crucial timesaver.

For now, I am stuck with rendering on my workstation, even though I would have multiple gpu machines available in a cluster but without displays.

I'll second that this would be an exciting feature to add to our headless render farm that is currently limited to Cycles only, and even there an artist who accidentally includes a grease pencil object in their render will crash the render attempt.

> In #54638#829993, @getshi wrote: > I wanted to comment on the importance of this by giving an example. > > I'm working in research, where we build prototypes of new simulation methods usually as stand-alone applications (because that's the fastest way, or because there's libraries to extend, etc.), and they are usually equipped with no or only trivial rendering. Writing them directly in tools such as blender is often too big of an overhead. However, previewing rendered animations of *tons* of simulations (done outside blender in prototypes with only simple or no rendering) can be vital; using blender's shader nodes, modifier stack, and general layouting would be an amazing tool for that. Eevee renderings can look amazing at a fraction of the cost of cycles renderings, and for the purpose of previewing any sort of animation this can be a crucial timesaver. > > For now, I am stuck with rendering on my workstation, even though I would have multiple gpu machines available in a cluster but without displays. I'll second that this would be an exciting feature to add to our headless render farm that is currently limited to Cycles only, and even there an artist who accidentally includes a grease pencil object in their render will crash the render attempt.

Added subscriber: @g-lul

Added subscriber: @g-lul

Added subscriber: @maximd

Added subscriber: @maximd

Added subscriber: @shayg

Added subscriber: @shayg

Added subscriber: @Clockwork-Muse

Added subscriber: @Clockwork-Muse

Added subscriber: @RafaelRistovski

Added subscriber: @RafaelRistovski

Added subscriber: @michimussato

Added subscriber: @michimussato

Added subscriber: @ostef

Added subscriber: @ostef
Philipp Oeser removed the
Interest
EEVEE & Viewport
label 2023-02-09 15:15:42 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
24 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#54638
No description provided.