SOGM'S Data

1) Window11(윈도우11) CUDA 설치 -1 (tensorflow-gpu) 본문

About Data/ETC

1) Window11(윈도우11) CUDA 설치 -1 (tensorflow-gpu)

왈왈가부 2023. 5. 10. 01:26

배경

 

데스크탑을 샀다.  이번 데스크탑은 반드시 colab 기본보다 좋은 그래픽카드를 사서 로컬에서 모델을 돌리노라 다짐.

colab 벤치마킹이 3060이랑 비슷하다해서 3080을 구매했다.

아나콘다 주피터노트북에서 GPU연산을 위해서 CUDA 설치 시작을 마음 먹고... 서치 시작 

온라인에 있는 Tensorflow-gpu 설치 자료들은 대부분 window10을 기반으로 작성되어있다보니

cuda 설치과정에서 애를 먹었다.

<문제 요약> 

1. tensorflow 공식홈페이지에서 GPU 지원버전은 tensorflow_gpu-2.10.0 가 마지막이었다.

  •  공홈 : https://www.tensorflow.org/install/source_windows?hl=ko#tested_build_configurations

2.  따라서  tensorflow_gpu-2.10.0  설치하면 호환  cuda = 11.2  ,  cuDNN= 8.1 을 설치해야하는데 
     문제는  cuda =11.2 에는 win 11버전이 없다. 

>>> 아.. 다시 colab 돌아가야할까? 

 

 

해결

tensorflow_gpu-2.10.0 이어도 cuda =12.1 과 cuDNN =8.81 과 함께 사용가능합니다.

1.Anaconda prompt에서 아래코드  실행

 

conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0

 

2. GPU 사용 가능여부체크

# tensorflow test메소드를 통한 체크
import tensorflow as tf
tf.test.is_built_with_cuda()   


# device_lib를 통한 체크
# 실행결과에 cpu, gpu 둘 다 나와야 정상 
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

> 즉, Window11에서도 CUDA GPU 사용 가능

 

+) pytoch도 한 번 해보고 포스팅할게요 ~ 

Comments