栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Some problems in pipenv and torch and cuda

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Some problems in pipenv and torch and cuda

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.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/861334.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号