3
$\begingroup$

We have our own render queue manager at work, and i use a python script to set the compute device of each worker to GPU. However, with 2.79 the script no longer works.

Here is the script i use:

import bpy
bpy.context.user_preferences.system.compute_device_type = 'CUDA'
bpy.context.user_preferences.system.compute_device = 'CUDA_MULTI_2'

Pretty simple right? But in 2.79 i get the following error:

AttributeError: 'UserPerferencesSystem' object has no attribute 'compute_device_type'

Anyone knows what changed in 2.79 that causes this error?

$\endgroup$
  • $\begingroup$ your error message says that you try to access 'UserPerferencesSystem' instead of 'UserPreferencesSystem' which seems to be a typo? $\endgroup$ – Madlaina Kalunder Aug 15 '17 at 16:20
4
$\begingroup$

Changes have been made in the Blender API. You can retrieve 'compute_device_type' and 'devices' via the cycles addon preferences

prefs = bpy.context.user_preferences.addons['cycles'].preferences
print(prefs.compute_device_type)

for d in prefs.devices:
    print(d.name)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.