검색하기 귀찮아서 블로그에 박제

[Pytorch error] RuntimeError: CUDA error: no kernel image is available for execution on the device

oziguyo_ 2022. 7. 1. 16:29
728x90

서버를 공유하고 있는데 누가 자꾸 가상환경에 환경설정을 안하나보다 ^^

새학기마다 재설정하는 듯 

 

pytorch 버전과 cuda 버전의 호환성 문제로 pytorch 재설치를 권장한다.

 

우선 내 환경은 linux이다.

 

https://developer.nvidia.com/cuda-gpus

 

CUDA GPUs - Compute Capability

Explore your GPU compute capability and CUDA-enabled products.

developer.nvidia.com

위 링크에서 우선 내 GPU의 compute capability를 확인한다.

나는 RTX A5000이므로 8.6이다.

$ export TORCH_CUDA_ARCH_LIST=8.0

환경변수를 설정한다.

# conda
$ conda uninstall pytorch

# linux
$ pip uninstall torch

기존의 pytorch를 삭제한다.

 

https://pytorch.org/get-started/previous-versions/

 

PyTorch

An open source machine learning framework that accelerates the path from research prototyping to production deployment.

pytorch.org

위 링크에서 cuda 버전에 맞는 명령어를 찾아서 재설치한다.

conda 버전도 있다.

나는 아래 명령어를 그대로 복붙했다.

 

 

728x90