Run opengl render in background I working on an addon and i need to run an opengl render by subprocess. When i run my script test, i've got this error:

RuntimeError: Error: Cannot use OpenGL render in background mode (no opengl context)


This is my command:

sub = subprocess.Popen([bpy.app.binary_path, blendfile, '-b', '--python', render_script])


Does it mean we can't do opengl render in Background ?
No, you can't use OpenGL in the background. You shouldn't use the -b flag, and instead, close Blender in the end of your script using bpy.ops.wm.quit_blender().
Blender creates screenshot using python script but not when running in background
Render with openGL from the command line?