59doit
[ torch ] torch install [GPU] 본문
1. CUDA 설치
CUDA Toolkit Archive | NVIDIA Developer
CUDA Toolkit Archive
Previous releases of the CUDA Toolkit, GPU Computing SDK, documentation and developer drivers can be found using the links below. Please select the release you want from the list below, and be sure to check www.nvidia.com/drivers for more recent production
developer.nvidia.com
명령 프롬프트 열어주고
nvidia-smi 명령어로 호환 잘 되는 CUDA Version을 확인
2. 비주얼스튜디오 설치
https://learn.microsoft.com/ko-kr/cpp/windows/latest-supported-vc-redist?view=msvc-170
지원되는 최신 Visual C++ 재배포 가능 패키지 다운로드
이 문서에서는 최신 버전의 Visual C++ 재배포 가능 패키지 패키지에 대한 다운로드 링크를 나열합니다.
learn.microsoft.com
3. CuDNN 설치
nvidia 계정 필요
NVIDIA Developer Program Membership Required | NVIDIA Developer
다운받은 zip파일을 cuda가 설치된 폴더에 압축 풀어주면 된다.
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6(본인이 설치한 버전)\
4. zlib 파일 다운받아 환경변수 등록, 시스템32 및 cuda폴더에 넣어주기
Installation Guide :: NVIDIA Deep Learning cuDNN Documentation
About this task export QNX_HOST={flash_dir}/toolchains/qnx_toolchain/host/linux/x86_64 export QNX_TARGET={flash_dir}/toolchains/qnx_toolchain/target/qnx7 export HOST_COMPILER=$QNX_HOST/usr/bin/aarch64-unknown-nto-qnx7.1.0-g++ export CUDNN_LIB_PATH=/usr/lib
docs.nvidia.com
5. 환경변수 등록
시스템 환경 변수 편집 > 고급 > 환경변수 >
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\extras\CUPTI\libx64
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include
입력하고 확인
6. 다운받은파일 압축해제
압축해제된 파일
1. zlib 파일
C 드라이브에 넣어주기
2. CuDNN
▼
▼
파일들을
▼
▼
▼
▼
▼
에 넣어주고 덮어쓰기
7. CMD (관리자권한 실행)
7.1.pycarm 프로젝트 파일 경로 설정
7.2. cd venv
7.3. cd Scripts
7.4 activate.bat
7.5 pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
8. 설치 확인
import torch
print("PyTorch version: {}".format(torch.__version__))
print("CUDA version: {}".format(torch.version.cuda))
print(torch.cuda.get_device_name(0))
'set > torch' 카테고리의 다른 글
[ torch ] torch install------ (4) | 2023.01.13 |
---|