Hardware: ROG Zephyrus laptop
Operating system: Ubuntu 18.04
Graphics card: GeForce GTX 1070
Nvidia drivers version: 390.77
CUDA version: 9.1.85
2.80 beta, 2757469824bb, blender2.8, 2019-01-18, downloaded from https://builder.blender.org/download/blender-2.80-2757469824bb-linux-glibc224-x86_64.tar.bz2
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:
The logic is adapted from https://developer.blender.org/T54099 and this same script has been tested to work in following environments:
- Same machine, Blender 2.79b (lists CPU and GPU)
- macOS Mojave, Blender 2.8 (lists CPU only)
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:
I0118 19:35:32.273550 2197 device_opencl.cpp:60] CLEW initialization succeeded. I0118 19:35:32.282517 2197 opencl_util.cpp:779] Enumerating devices for platform NVIDIA CUDA. I0118 19:35:32.282583 2197 opencl_util.cpp:845] Ignoring device GeForce GTX 1070, not officially supported yet. I0118 19:35:32.282691 2197 device_cuda.cpp:2390] CUEW initialization succeeded I0118 19:35:32.282703 2197 device_cuda.cpp:2392] Found precompiled kernels I0118 19:35:32.284847 2197 device_cuda.cpp:2513] Added device "GeForce GTX 1070" with id "CUDA_GeForce GTX 1070_0000:01:00". Using device: CUDA
Which apparently means that the device is found.
Exact steps for others to reproduce the error
- Use the default startup.
- Download the script to test the listing of devices.
- Run path_to_blender2.8/blender -b --python blender_list_devices.py --debug-cycles --debug-gpu --verbose
At least 1 device name (CPU) is output, 2 or more if GPUs present.
No device names output, the array is empty.