728x90
반응형
SMALL
Segmentation fault (core dumped)
동일한 버전의 cuda가 torch와 호환되지 않을 가능성이 있다. 사용 중인 torch 버전이 쿠다와 호환되지 않는 경우 torch를 다시 설치해야 한다.
CUDA에는 두 개의 API가 있다. 하나는 런타임 API이고 다른 하나는 드라이버 API이다. 각 API에는 자체 버전이 있다. nvidia-smi의 CUDA는 런타임 API를 나타내며 GPU 드라이버에 의해 설치된다. nvcc의 CUDA는 CUDA 툴킷에 의해 설치된다다.
https://pytorch.org/get-started/previous-versions/에서 nvidia-smi로 확인한 cuda 버전을 설치해준다.
# CUDA 11.8
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=11.8 -c pytorch -c nvidia
# CUDA 12.1
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.1 -c pytorch -c nvidia
# CUDA 12.4
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.4 -c pytorch -c nvidia
# CPU Only
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 cpuonly -c pytorch
다음 코드로 설치한 버전을 확인한다.
import torch
print(torch.__version__)
print(torch.cuda.is_available())
print(torch.version.cuda)
https://docs.nvidia.com/cuda/cuda-runtime-api/driver-vs-runtime-api.html
CUDA Runtime API :: CUDA Toolkit Documentation
The driver and runtime APIs are very similar and can for the most part be used interchangeably. However, there are some key differences worth noting between the two. Complexity vs. control The runtime API eases device code management by providing implicit
docs.nvidia.com
728x90
반응형
LIST
'Python Library > PyTorch' 카테고리의 다른 글
[PyTorch] optimizer 시각화 (0) | 2024.09.04 |
---|---|
[PyTorch] AssertionError: Torch not compiled with CUDA enabled (0) | 2024.03.19 |
[Pytorch] 모델 파라미터 계산 (0) | 2023.05.26 |
[PyTorch] gradient 시각화 (0) | 2023.03.09 |
[PyTorch] CNN (0) | 2022.11.21 |