CUDA_VISIBLE_DEVICES=0 이 인식이 되지 않고, gpu 를 사용하지 않을 때 torch 버전을 확인해보자.
torch 버전이 '2.0.1+cu117' 처럼 cuda 버전 말고, 그냥 '2.0.1' 이렇게 되어 있다면 cuda 버전으로 다시 설치해주면 gpu를 사용해서 돌아간다.
# CUDA 11.7
conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.7 -c pytorch -c nvidia
# CUDA 11.7
pip install torch==2.0.0+cu117 torchvision==0.15.1+cu117 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu117