depot/third_party/nixpkgs/pkgs/applications/misc/blender/test-cuda.py
Default email 98eb3e9ef5 Project import generated by Copybara.
GitOrigin-RevId: 00d80d13810dbfea8ab4ed1009b09100cca86ba8
2024-07-01 15:47:52 +00:00

8 lines
255 B
Python

import bpy
preferences = bpy.context.preferences.addons["cycles"].preferences
devices = preferences.get_devices_for_type("CUDA")
ids = [d.id for d in devices]
assert any("CUDA" in i for i in ids), f"CUDA not present in {ids}"
print("CUDA is available")