Skip to content

Instantly share code, notes, and snippets.

@davo
Created January 19, 2024 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davo/0404f2fac5cc3a7b1705c2b28f47923f to your computer and use it in GitHub Desktop.
Save davo/0404f2fac5cc3a7b1705c2b28f47923f to your computer and use it in GitHub Desktop.
Check if NVIDIA Optix is available from Blender
import bpy
# Function to check if OptiX is available
def is_optix_available():
prefs = bpy.context.preferences
cprefs = prefs.addons['cycles'].preferences
cprefs.get_devices()
for device in cprefs.devices:
if 'OPTIX' in device.type:
return True
return False
# Running the function and printing the result
print("Is OptiX available:", is_optix_available())
@davo
Copy link
Author

davo commented Jan 19, 2024

To execute it, simply call the file from Blender.

sudo ./blender/blender -b -P /path-to-file/check_optix.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment