No devices listed in bpy.context.preferences.addons['cycles'].preferences.devices when running in background mode #60618
Labels
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#60618
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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
Hardware: ROG Zephyrus laptop
Operating system: Ubuntu 18.04
Graphics card: GeForce GTX 1070
Nvidia drivers version: 390.77
CUDA version: 9.1.85
Blender Version
Broken:
2.80 beta,
2757469824
, blender2.8, 2019-01-18, downloaded from https://builder.blender.org/download/blender-2.80-2757469824bb-linux-glibc224-x86_64.tar.bz2Worked:
2.79b release
Short description of error
When running Blender 2.8 from command line in background mode, it is not possible to activate any GPU devices for rendering because
bpy.context.preferences.addons['cycles'].preferences.devices
is empty. The rendering will still proceed with CPU.To debug this, I've come up with a short script:
blender_list_devices.py
The logic is adapted from https://developer.blender.org/T54099 and this same script has been tested to work in following environments:
Additionally, on the same machine, it is possible to see the devices in GUI preferences window:
It may also be worth noting that the debug output produces this:
Which apparently means that the device is found.
Exact steps for others to reproduce the error
path_to_blender2.8/blender -b --python blender_list_devices.py --debug-cycles --debug-gpu --verbose
Expected result:
At least 1 device name (CPU) is output, 2 or more if GPUs present.
Problem experienced:
No device names output, the array is empty.
Added subscriber: @unclenorton
Added subscriber: @brecht
You need to call
prefs.addons['cycles'].preferences.get_devices()
to refresh the list.Closed as duplicate of #53242
Added subscriber: @lichtwerk
Havent checked code, but it is still unclear to me which (stored) preferences are actually used here.
If I do a fresh start [nuke my userprefs], then enable all devices in Preferences and save Preferences, then I get these reported by
bpy.context.preferences.addons['cycles'].preferences.devices
:the 1080 and RTX are definitely wrong.
But what works reliably is to query them using
cuda_devices, opencl_devices = bpy.context.preferences.addons['cycles'].preferences.get_devices()
So
.get_devices()
makes it do the right thing...Have a look at #57282 as well
ah, @brecht was quicker...
@brecht
get_devices()
worked for me, thanks. On a side note, I've noticed that after I usedget_devices()
once, the devices started to appear in the list. What's a bit strange is that I previously did run Blender 2.79b in the background in a Docker container (via nvidia-docker) where Blender was installed from scratch and never ran with UI, and I did not run into this problem—the GPU was definitely working.Added subscriber: @3co
Greetings, I'm new to the Blender development community. It's been pretty crazy catching up to 2.8 with all of the broken guidance from online forums, and this is no exception. I may be wrong, but it seems 2.8 introduced the need to call
...prior to actually having GPU etc. recognized by the machine. Was this done "automatically" before? In any case, why is this not done automatically?