Some problems in pipenv and torch and cuda

Some problems in pipenv and torch and cuda,第1张

As Chinese input app doesn’t installed in my computer, so I write this passage in English.
Some logs encountered related to the incompatibility between torch and CUDA :

Log1:
/home/supercomputer/Downloads/Dr.VOT/.venv/lib/python3.7/site-packages/torch/cuda/__init__.py:125: UserWarning: 
NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70 sm_75.
If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
Log2:
RuntimeError: CUDA error: no kernel image is available for execution on the device
Environment settings:
  1. The model environment is pipenv
  2. python: 3.7
  3. cuda 11.6
  4. ubuntu 20.4
  5. GPU: RTX 3090

Reason:
the cuda version is lower than torch version. So we need to upgrade cuda version.
I tried many times to upgrade torch version. from 1.2.0 to 1.8.0. Unfortunately, I cannot works.

Solutions:

I found that the pipenv uses the cuda in python.
so I install python in ubuntu and the cudatookit in python.

1: install python in ubuntu

sudo apt install python3.7

2: pip install torch

 pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html

then it works

inspiration:

nvidia-smi : cuda version: 11.6
print(torch.version.cuda) : cuda version: 10.2
so, install cudatoolkit: print(torch.version.cuda) : cuda version: 11.1
Then it works.

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/869661.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-13
下一篇 2022-05-13

发表评论

登录后才能评论

评论列表(0条)

保存