onnxruntime: Onnxruntime Error in libcublas.so.10
Describe the bug A clear and concise description of what the bug is.
I am using cuda 10, and I am running the code on aws conda enviornment
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
when I do
pip install onnxruntime
and run the code it runs smoothly without any error on the CPU.
When I do
pip install onnxruntime-gpu==0.5.0
I come across a error
Traceback (most recent call last):
File "onxx_inference.py", line 3, in <module>
import onnxruntime as rt
File "/home/ubuntu/anaconda3/envs/pytorch_demo/lib/python3.7/site-packages/onnxruntime/__init__.py", line 20, in <module>
from onnxruntime.capi.session import InferenceSession
File "/home/ubuntu/anaconda3/envs/pytorch_demo/lib/python3.7/site-packages/onnxruntime/capi/session.py", line 9, in <module>
from onnxruntime.capi import _pybind_state as C
File "/home/ubuntu/anaconda3/envs/pytorch_demo/lib/python3.7/site-packages/onnxruntime/capi/_pybind_state.py", line 8, in <module>
import onnxruntime.capi._ld_preload
File "/home/ubuntu/anaconda3/envs/pytorch_demo/lib/python3.7/site-packages/onnxruntime/capi/_ld_preload.py", line 12, in <module>
_libcublas = CDLL("libcublas.so.10", mode=RTLD_GLOBAL)
File "/home/ubuntu/anaconda3/envs/pytorch_demo/lib/python3.7/ctypes/__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libcublas.so.10: cannot open shared object file: No such file or directory
I guess the error says i dont have CUDA 10 (libcublas.so.10) but I in reality I have cuda 10 but still cannot run onnxruntime on the gpu
Urgency URGENT ( my onxx model is ready but inference on CPU is slow. I need inference on GPU)
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):Ubuntu 16.04
- ONNX Runtime installed from (source or binary): pip install onnxruntime-gpu==0.5.0
- ONNX Runtime version:0.5.0
- Python version:3.7
- Visual Studio version (if applicable):NA
- GCC/Compiler version (if compiling from source):NA
- CUDA/cuDNN version:cuda 10: cudnn 7.5.1
- GPU model and memory: Tesla K80
To Reproduce
-
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
-
pip install onnxruntime-gpu==0.5.0
-
run model
Expected behavior A clear and concise description of what you expected to happen.
output box coordinates
Additional context Heres the code I run to get inference:
import torch
import cv2
import onnxruntime as rt
import craft_utils
import imgproc
sess = rt.InferenceSession("onnx/model1.onnx")
input_name = sess.get_inputs()[0].name
first_output_name = sess.get_outputs()[0].name
print('\n')
print('\n')
print('input_name',input_name)
print('output_name',first_output_name)
print('\n')
print('\n')
img = cv2.imread('./images/image1.jpg')
img_resized, target_ratio, size_heatmap = imgproc.resize_aspect_ratio(img, 1280, interpolation=cv2.INTER_LINEAR, mag_ratio=1.5)
ratio_h = ratio_w = 1 / target_ratio
print(ratio_h, ratio_w)
x = imgproc.normalizeMeanVariance(img_resized)
x = torch.from_numpy(x).permute(2, 0, 1) # [h, w, c] to [c, h, w]
x = x.unsqueeze(0) # [c, h, w] to [b, c, h, w]
y, _ = sess.run(None, {input_name: x.numpy()})
# make score and link map
score_text = y[0, :, :, 0]
score_link = y[0, :, :, 1]
# Post-processing
boxes = craft_utils.getDetBoxes(score_text, score_link, 0.5, 0.4, 0.4)
#print(boxes)
boxes = craft_utils.adjustResultCoordinates(boxes, ratio_w, ratio_h)
#print(boxes)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (8 by maintainers)
For those visiting this thread much later and are using newer versions of
onnxruntime-gpu, the latest versions don’t support cuda 10.0 so useonnxruntime-gpu==1.4.0or lower, or use a higher cuda version.Please delete “output_0.pb”, then use onnx_test_runner run the model again. I tested locally, it works fine.
@rogier-stegeman Great help!