linux
已经安装了cuda依然报错
[W:onnxruntime:Default, onnxruntime_pybind_state.cc:640 CreateExecutionProviderInstance] Failed to create CUDAExecutionProvider. Please reference https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements to ensure all dependencies are met.
解决方案
安装[onnxruntime-gpu]
pip install optimum[onnxruntime-gpu]
在import onnxruntime 之前 import torch(一定要在之前)
测试版本
onnxruntime-gpu 15.1
cuda 12.2
windows
windows onnxruntime-gpu 15.1对应 cuda必须是11.8
linux onnxruntime-gpu 15.1可以是12.2
自己一直用的12.2一直报错后来换了11.8
安装好会报错找不到zlibwapi.dll
找了好几个都是32位的,会报错
所以还需要下载zlibwapix64.dll并配置到环境变量中(保证名字是zlibwapi.dll)
可以到dll.me下载64位dll文件
测试版本
onnxruntime-gpu 15.1
cuda 11.8