onnxruntime 不使用 gpu
检查 onnxruntime 和 cuda 和 cudnn 的版本对应关
sudo apt purge -y nvidia* libnvidia*
sudo apt autoremove -y
sudo apt install -y nvidia-driver-520
sudo apt install -y cuda-11-8
nvidia 驱动 cuda cuDNN版本关系
https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html
检测cuda版本
cat /usr/local/cuda/version.json
nvida-smi
两者可能不一致 https://stackoverflow.com/questions/53422407/different-cuda-versions-shown-by-nvcc-and-nvidia-smi
# add latest key
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# try refresh again
sudo apt-get update
https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=18.04&target_type=deb_network
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt -y upgrade
sudo apt-get -y install cuda
系
检查cuda
nvcc --version
检查安装的 onnx
pip list | grep onnx
检查 cudnn版本
cat /usr/include/x86_64-linux-gnu/cudnn_v*.h | grep CUDNN_MAJOR -A 2