Create onnxruntime.py

This commit is contained in:
Robert Dunmire III
2025-01-04 14:34:18 -05:00
parent c8488ae840
commit d1e8346244
+14
View File
@@ -0,0 +1,14 @@
import onnxruntime as ort
# Check if CUDA execution provider is available
if 'CUDAExecutionProvider' in ort.get_available_providers():
print("CUDA is available")
# Get CUDA device information
cuda_providers = [provider for provider in ort.get_available_providers() if provider.startswith('CUDA')]
for provider in cuda_providers:
print(f"Provider: {provider}")
print(f"Device ID: {ort.get_device()}")
else:
print("CUDA is not available")