본문 바로가기
ML or DL/개발환경

[딥러닝 환경구축] Pytorch 설치 / RTX 3090 에 맞는 pytorch 설치

by chaloalto 2021. 10. 26.

환경 

  • RTX 3090 / Windows 10 
  • NVIDIA Driver 471.96
  • CUDA 11.2 
  • cuDNN 8.1   

출처 : https://ssaru.github.io/2021/05/05/20210505-til_install_rtx3090_supported_pytorch/

 

(TIL) RTX 3090을 지원하는 PyTorch 버전설치

2021.05.05 현재 RTX3090은 CUDA11 이상을 지원하는 딥러닝 프레임워크에 버전에서만 사용할 수 있습니다. 하지만 단순하게 pip install torch==1.7.1 torchvision==0.8.2 형태로 설치하면 CUDA error: no kernel image is ava

ssaru.github.io

RTX 3090 은 CUDA 버전 11 이상을 지원하는 딥러닝 프레임워크에 버전에서만 사용할 수 있어 Torch를 일반적으로 설치하면 정상 작동 하지 않는 경우가 있음

단순하게 pip install torch==1.7.1 torchvision==0.8.2 형태로 설치하면

CUDA error: no kernel image is available for execution on the device

에러를 마주할 수 있다. 

이 때 아래와 같이 CUDA 버젼을 지정해줘야 한다. 

pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html

RTX3090을 지원하는 PyTorch는 python 3.8 이상을 요구

Torch 정상 작동 확인하기

import torch
torch.cuda.get_device_name(0)
>> 'NVIDIA GeForce RTX 3080 Laptop GPU'

torch.cuda.is_available()
>> True

torch.__version__
>> '1.7.1+cu110'