윈도우 환경 tensorflow와 pytorch 설치

OS: Windows 11
그래픽카드: NVIDIA GeForce RTX 2080 SUPER x 2
Python: (env) 3.7.3

1. Cuda & cuDNN 다운로드 및 설치

현재 환경에 최적화 해서 설치하는 것을 권장

Cuda 설치: 별도 계정 필요 없이 다운로드 가능함
download: CUDA Toolkit Archive | NVIDIA Developer

cuDNN 설치: nvidia developer 계정 필요함.
download: CUDA Deep Neural Network (cuDNN) | NVIDIA Developer

Cuda 경우 다운로드 받은 파일(EXE)을 실행하여 설치 진행하고, cuDNN 경우는 다운로드 받은 ZIP 파일 압축 해제한 후 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6 에 bin, include, lib 폴더 복사하여 설치함. 설치 이후 환경 변수에 하단 추가

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\lib

2. Tensorflow GPU 설치

다음과 같이 pip로 설치 가능함

pip install tensorflow-gpu==2.8.0

3. Pytorch 설치

나의 환경에 맞는 명령어를 찾아야 함. https://pytorch.org/get-started/locally/

conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia

4. 테스트 수행

import tensorflow as tf

print(tf.__version__)
2.8.0


tf.test.is_built_with_cuda()
True


tf.test.gpu_device_name()

2023-03-16 12:01:44.360450: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-16 12:01:46.841322: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:0 with 5949 MB memory: -> device: 0, name: NVIDIA GeForce RTX 2080 SUPER, pci bus id: 0000:01:00.0, compute capability: 7.5
2023-03-16 12:01:46.843892: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /device:GPU:1 with 5949 MB memory: -> device: 1, name: NVIDIA GeForce RTX 2080 SUPER, pci bus id: 0000:02:00.0, compute capability: 7.5
‘/device:GPU:0’

Leave a Reply

Your email address will not be published. Required fields are marked *

인기 글

Ubuntu 22.04 LTS에 Python 3.8 or 3.9 설치 방법
서버 : Vultr 클라우드OS: Ubuntu 22.04 LTS사용자 계정 생성하여 설치 진행함1. Start with the system updatesudo apt update...
오라클 클라우드 OCI 가입 드디어 성공 했습니다 (상세 후기)
2023년 2월 16일에 ‘오라클 클라우드 지급 검증 실패 글‘을 남긴 적이 있습니다.그 때 검색을 통해 해결 방법을 찾아 보았고, 당시 성공했던 분들의...
Ubuntu 20.04에 MySQL 5.7 설치
비씨티원 인공지능 서비스 플랫폼 BAP(Bctone AI service Platform)의 설치 환경은 공식적으로 Ubuntu 18.04와 MySQL 버전 5.7 입니다. 최근 Ubuntu...
WSL2/Ubuntu 22.04 LTS에 Anaconda 설치 
WSL2/Ubuntu 환경에서 Python 버전별로 가상환경을 만드는 방법 중 그나마 Anaconda 방법이 좋은 것 같네요. 설치 방법은 간단합니다.1. apt update사용자...
오라클 클라우드로 도메인 연동하는 방법
도메인 업체(이 경우는 카페24 리셀러)에서 구매한 도메인(onecloud.kr)을 오라클 클라우드로 연동하는 방법입니다. 네임서버를 변경하지 않고 TXT 레코드 값으로 도메인 인증을...