Crash when choosing cycles device with python #81520
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#81520
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Ubuntu 20.04.1 LTS
Graphics card: GTX 1070 + GTX 1070 + GTX 1050 Ti, NVIDIA 440.100
Blender Version
Broken: 2.90.1, Commit date: 2020-09-23 06:43, Hash
3e85bb34d0
Worked: 2.83.7
Short description of error
Blender crashes when using python to choose CUDA GPU for cycles. I don't know if this happens in systems with only 1 GPU.
Exact steps for others to reproduce the error
Run Blender from command line with python expression to select GPU:
More information:
Using get_devices_for_type() instead of get_devices() does not crash.
The specific sequence of device types used by get_devices() matters, CUDA, then OPTIX, then OPENCL. Changing the sequence to CUDA last does not crash. Something about OPTIX and OPENCL mutates the CUDA devices. See the dump of cuda_devices before and after getting OPENCL devices:
Also, this seems to have something to do with OPTIX. Removing OPTIX from the sequence above also does not crash.
Added subscriber: @Cedar-Myers
Added subscriber: @rjg
Changed status from 'Needs Triage' to: 'Needs User Info'
I can't reproduce this on my one GPU system. Could you run Blender from the terminal with
./blender --debug --debug-python --debug-gpu > ~/blender_debug_output.txt 2>&1
and upload the output as well as the crash log / stack trace?These are pretty short. Do I need a certain build for debugging?
blender.crash.txt
blender_debug_output.txt
Changed status from 'Needs User Info' to: 'Needs Triage'
@Cedar-Myers No, the log files are exactly how they are supposed to be.
Added subscriber: @Raimund58
This issue was referenced by
0ff7d21c27
This issue was referenced by
1001adb500
Changed status from 'Needs Triage' to: 'Resolved'
I have tested the 2.91.0-3bc808ebcbf6 nightly build and I can confirm that this fixes get_devices() but get_devices_for_type() still suffers the same problem when called in sequence (CUDA, then OPTIX, then OPENCL). Should this be filed as a new issue, or should this issue be re-opened?
Also, I'm uncertain if this is relevant for LTS backport since 2.83 does not crash, but I'll leave that to you guys to determine.
@Cedar-Myers Since this ticket as already been closed with an associated commit, it's probably a good idea to open another ticket. Just to make sure it's not forgotten.
@Cedar-Myers other issues should be reported separately,
get_devices_for_type
is returning data that's re-allocated, so we'll need to copy the return values to prevent problems like this from happening entirely.