Created
January 19, 2024 14:34
-
-
Save davo/0404f2fac5cc3a7b1705c2b28f47923f to your computer and use it in GitHub Desktop.
Check if NVIDIA Optix is available from Blender
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To execute it, simply call the file from Blender.
sudo ./blender/blender -b -P /path-to-file/check_optix.py