Custom render engine is unable to create gpu context #104061

Open
opened 2023-01-22 12:01:56 +01:00 by Alexander Samsonov · 7 comments

System Information
Operating system: Linux-5.19.17-2-MANJARO-x86_64-with-glibc2.36 64 Bits
Graphics card: AMD Radeon Graphics (renoir, LLVM 14.0.6, DRM 3.47, 5.19.17-2-MANJARO) AMD 4.6 (Core Profile) Mesa 22.3.1

Blender Version
Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-18 20:06, hash: 50c7eb14f4
Worked: Blender 3.4

Short description of error
Unable to perform background rendering using gpu module in custom render engine.

Exact steps for others to reproduce the error
Run the script in background mode: blender -b -P background-gpu.py. Blender throws: SystemError: GPU API is not available in background mode, despite the line bl_use_gpu_context = True in custom render engine. Worked perfectly fine in blender 3.3 and 3.4. Not in 3.5 though.
background-gpu.py

**System Information** Operating system: Linux-5.19.17-2-MANJARO-x86_64-with-glibc2.36 64 Bits Graphics card: AMD Radeon Graphics (renoir, LLVM 14.0.6, DRM 3.47, 5.19.17-2-MANJARO) AMD 4.6 (Core Profile) Mesa 22.3.1 **Blender Version** Broken: version: 3.5.0 Alpha, branch: master, commit date: 2022-12-18 20:06, hash: `50c7eb14f4` Worked: Blender 3.4 **Short description of error** Unable to perform background rendering using `gpu` module in custom render engine. **Exact steps for others to reproduce the error** Run the script in background mode: `blender -b -P background-gpu.py`. Blender throws: `SystemError: GPU API is not available in background mode`, despite the line `bl_use_gpu_context = True` in custom render engine. Worked perfectly fine in blender 3.3 and 3.4. Not in 3.5 though. [background-gpu.py](https://archive.blender.org/developer/F14183192/background-gpu.py)

Added subscriber: @blendersamsonov

Added subscriber: @blendersamsonov

Added subscriber: @mod_moder

Added subscriber: @mod_moder

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
blender "C:\Users\rfnei\Downloads\ssdvzd.blend" -b -P "C:\Users\rfnei\Downloads\background-gpu.py"
Blender 3.5.0 Alpha (hash 962c3cf6b190 built 2023-01-17 02:31:29)
Read prefs: C:\Users\rfnei\AppData\Roaming\Blender Foundation\Blender\3.5\config\userpref.blend
Read blend: C:\Users\rfnei\Downloads\ssdvzd.blend
Error: Python: Traceback (most recent call last):
  File "C:\Users\rfnei\Downloads\background-gpu.py", line 30, in render
    GPUShader(vert_shader, frag_shader)
SystemError: GPU API is not available in background mode
Location: F:\╨Ф╨╕╤Б╨║ I\programm\blenders\╤Б╨▓╨╡╨╢╨░╨║ 24-15-31\3.5\scripts\modules\bpy\ops.py:111
Traceback (most recent call last):
  File "C:\Users\rfnei\Downloads\background-gpu.py", line 30, in render
    GPUShader(vert_shader, frag_shader)
SystemError: GPU API is not available in background mode

Can confirm report

``` blender "C:\Users\rfnei\Downloads\ssdvzd.blend" -b -P "C:\Users\rfnei\Downloads\background-gpu.py" Blender 3.5.0 Alpha (hash 962c3cf6b190 built 2023-01-17 02:31:29) Read prefs: C:\Users\rfnei\AppData\Roaming\Blender Foundation\Blender\3.5\config\userpref.blend Read blend: C:\Users\rfnei\Downloads\ssdvzd.blend Error: Python: Traceback (most recent call last): File "C:\Users\rfnei\Downloads\background-gpu.py", line 30, in render GPUShader(vert_shader, frag_shader) SystemError: GPU API is not available in background mode Location: F:\╨Ф╨╕╤Б╨║ I\programm\blenders\╤Б╨▓╨╡╨╢╨░╨║ 24-15-31\3.5\scripts\modules\bpy\ops.py:111 Traceback (most recent call last): File "C:\Users\rfnei\Downloads\background-gpu.py", line 30, in render GPUShader(vert_shader, frag_shader) SystemError: GPU API is not available in background mode ``` Can confirm report

Added subscriber: @Michael-Parkin-White-Apple

Added subscriber: @Michael-Parkin-White-Apple

Shouldn't that be tagged as regression?
I develop an add-on that runs a background blender process for rendering and it's really annoying that in newer versions that process have to be not a background one, have it's own window, etc. due to that bug.

Shouldn't that be tagged as regression? I develop an add-on that runs a background blender process for rendering and it's really annoying that in newer versions that process have to be not a background one, have it's own window, etc. due to that bug.

Any chance this can be fixed for 4.2 LTS release?

Any chance this can be fixed for 4.2 LTS release?
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
3 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#104061
No description provided.