onnxruntime: FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: libcublasLt.so.11: cannot open shared object file: No such file or directory
Describe the issue
when i inference with optimum.onnxruntime,an error occurred:
FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: libcublasLt.so.11: cannot open shared object file: No such file or directory
my env is as follow: cuda 12.1 cudnn8 onnxruntime-gpu 1.16
and I found this doc(https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html):
so I tried to update onnxruntime-gpu to 1.18.0, but the same error still occurred.
But when I updated the version of onnxruntime-gpu to 1.18.1, another error occurred, as follows:
FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: libcudnn.so.9: cannot open shared object file: No such file or directory
so, with cuda12.1 and cudnn8, which version of onnxruntime-gpu should i install?
To reproduce
pass
Urgency
not
Platform
Linux
OS Version
ubuntu 20.04.6 LTS
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
onnxruntime-gpu 1.18.0
ONNX Runtime API
Python
Architecture
X64
Execution Provider
CUDA
Execution Provider Library Version
cuda 12.1
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 16 (3 by maintainers)
For CUDA and cuDNN version, you can look up here: https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements
Then you can install according to this: https://onnxruntime.ai/docs/install/#install-onnx-runtime-ort-1
Summary of recommended combinations:
I fixed it by just import torch before import onnxruntime:
import torch import onnxruntime
@andreclaudino, @eaven123 , you can
pip install onnxruntime-gpu==1.19.0to work with cuda 12.x and cudnn 9.x.If you
pip install onnxruntime-gpu==1.18.1, you need cuda 11.8 and cudnn 8.9.https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#cuda-12x
From the above table, 1.18.0 is good for cuda 12.x and cudnn 8.x.
You can install like
See https://onnxruntime.ai/docs/install/#install-onnx-runtime-gpu-cuda-12x for installation.
I solved it by using:
pip install --no-cache-dir onnxruntime-gpu==1.17.1 --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simpleI found this thread while trying to figure out why
import torchwould allow ORT to find start finding libraries, and looks like other people have the same issue, even if it wasn’t OP’s original problem.A solution that let me avoid the
torchimport in my environment:Context in the linked comment above; the previous comment in that thread was a helpful explanation of the underlying problem for me.
Really, it’s the only thing that works. It’s crazy. I don’t want to pull the torch dependency and make this idiotic crutch, but that’s the only thing that makes this shit work. It’s kind of crazy. You can’t seem to handle your own software and dependency hell.