PyTorch 를 활용해 ML 을 공부하기 위한 개발환경 구축을 하게 되었다.
최근에 VTK 개발 환경을 구축하면서 아무생각 없이 최신버전으로 Nvidia driver를 업데이트하면서 일부 코드가 동작중에 강제 종료되는 문제를 겪었다.
이런 이유로 최신버전의 드라이버가 좋은 것보다는 호환성을 맞춰서 개발환경을 구축하는 것이 중요하여 먼저 호환성을 검토하고 환경을 구축해야 된다는 걸 다시 느꼈다.
Compatibility Matrix
호환성은 최종 target인 PyTorch를 기준으로 주변 패키지들을 설치하는 것으로 한다.
통합적인 호환성을 참고 : PyTorch Release Notes :: NVIDIA Deep Learning Frameworks Documentation
- PyTorch 1.13 Compatibility
PyTorch Versions · pytorch/pytorch Wiki (github.com)
- CUDA and cuDNN Compatibility
Support Matrix :: NVIDIA Deep Learning cuDNN Documentation
- Nvidia Driver
CUDA 운용을 위한 버전별 최소한의 Driver 버전이다[Table2].
하지만 CUDA를 설치하면 함께 포함되어 있는 Driver 버전은 Table 3과 같다.
Install Guide
- Nvidia Driver
Official Advanced Driver Search | NVIDIA - CUDA 11.7 Update 1
CUDA Toolkit provides a comprehensive development environment for C and C++ developers building GPU-accelerated applications. The toolkit includes a compiler for NVIDIA GPUs, math libraries, and tools for debugging and optimizing the performance of your applications.
CUDA Toolkit Archive | NVIDIA Developer
Release Notes :: CUDA Toolkit Documentation (nvidia.com) - cuDNN 8.5
CUDA Deep Neural Network library provides high-performance primitives for deep learning frameworks. It provides highly tuned implementations for standard routines such as forward and backward convolution, pooling, normalization, and activation layers.
Installation Guide :: NVIDIA Deep Learning cuDNN Documentation
설치과정을 잘 설명했다. : [인공지능] Windows(윈도우) CUDA, cuDNN 설치방법 (tistory.com) - TensorRT
TensorRT is a high performance deep learning inference runtime for image classification, segmentation, and object detection neural networks. TensorRT is built on CUDA, NVIDIA’s parallel programming model, and enables you to optimize inference for all deep learning frameworks. It includes a deep learning inference optimizer and runtime that delivers low latency and high-throughput for deep learning inference applications. - PyTorch
Start Locally | PyTorch
참고사항
PyTorch Release Note : Releases · pytorch/pytorch (github.com)
OpenGL View : OpenGL Extensions Viewer 6
- OpenGL version을 확인할 수 잇다.
NVidia Driver 의 종류
NVIDIA 그래픽카드 드라이버 종류와 차이점 WHQL GRD SD (Game Ready Driver, Studio Driver) (tistory.com)
전체과정 잘정리된곳
https://velog.io/@boom109/nvidia-driver-cuda-toolkit-cudnn-install
% 호환성 버전 체크
https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/
https://docs.nvidia.com/deeplearning/tensorrt/support-matrix/index.html
https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installlinux-deb
cuDNN Install
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
sudo apt-get install libcudnn8=8.5.0.96-1+cuda11.7
sudo apt-get install libcudnn8-dev=8.5.0.96-1+cuda11.7
https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/
cuDNN 확인
https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#verify
cuDNN sample 확인을 위한 library FreeImage 설치
https://zoomadmin.com/HowToInstall/UbuntuPackage/libfreeimage-dev