From d1e83462449883256c7b9684ee77fe7bc5b30a1b Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sat, 4 Jan 2025 14:34:18 -0500 Subject: [PATCH] Create onnxruntime.py --- tests/onnxruntime.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/onnxruntime.py diff --git a/tests/onnxruntime.py b/tests/onnxruntime.py new file mode 100644 index 0000000..880f45d --- /dev/null +++ b/tests/onnxruntime.py @@ -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")