OnnxRuntimeException with useCuda = True
zzzdddyyy opened this issue · 1 comments
when i test the method=>CocoTest_CUDA:
using var yolo = YoloV8Predictor.Create("./assets/yolov8m.onnx", null, true);
The problem is that set useCuda = False the program works. But it uses the CPU so it is really slow. That's why I want to use the GPU, setting the useCuda = True, but it gives me the error.
I installed cuda from this link: https://developer.nvidia.com/cuda-downloads. And update Microsoft.ML.OnnxRuntime.Gpu (1.14.1).
Error Code:
Yolov8Net.test.Yolov8Test.CocoTest_CUDA
源: Yolov8Test.cs 行 81
持续时间: 85 毫秒
消息:
Microsoft.ML.OnnxRuntime.OnnxRuntimeException : [ErrorCode:RuntimeException] D:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1106 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "H:\Yolov8.Net\test\Yolov8net.test\bin\Debug\net6.0\runtimes\win-x64\native\onnxruntime_providers_cuda.dll"
堆栈跟踪:
NativeApiStatus.VerifySuccess(IntPtr nativeStatus)
SessionOptions.AppendExecutionProvider_CUDA(Int32 deviceId)
SessionOptions.MakeSessionOptionWithCudaProvider(Int32 deviceId)
PredictorBase.ctor(String modelPath, String[] labels, Boolean useCuda) 行 28
YoloV8Predictor.ctor(String modelPath, String[] labels, Boolean useCuda) 行 18
YoloV8Predictor.Create(String modelPath, String[] labels, Boolean useCuda) 行 14
Yolov8Test.CocoTest_CUDA() 行 86
When I installed cuDNN, the problem was solved!