Page MenuHome
Paste P1114

optix.py
ActivePublic

Authored by Brecht Van Lommel (brecht) on Sep 23 2019, 5:22 PM.
# Use like this:
# CYCLESTEST_ARGS="-P optix.py" ctest -R cycles
import bpy
import sys
prefs = bpy.context.preferences
scene = bpy.context.scene
scene.cycles.device = 'GPU'
try:
cprefs = prefs.addons['cycles'].preferences
cprefs.compute_device_type = 'OPTIX'
cuda_devices, opencl_devices, optix_devices = cprefs.get_devices()
for device in cuda_devices:
device.use = device.type == 'OPTIX'
except:
print("Cycles device not available")
sys.exit(1)

Event Timeline

Brecht Van Lommel (brecht) changed the title of this paste from untitled to optix.py.
Brecht Van Lommel (brecht) edited the content of this paste. (Show Details)
Brecht Van Lommel (brecht) edited the content of this paste. (Show Details)