IBM CLOUD 로그인하기
chmod 400 ibm.pem
ssh root@75.126.299.28 -i ibm.pem
uUy2sCK6u (비밀번호)
python 3.7 세팅
sudo apt update
sudo apt install python3.7 # 설치하려는 버전
update-alternatives --config python3
(에러나오면)
which python3.7 #위치 다시한번 확인
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
-> python을 치면 3.7 을 기본으로 하라는 뜻
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
=> python3을 치면 3.7 을 기본으로 하라는 뜻
CUDA 11.4 설치 ( nvidia driver 도 같이 깔린다 )]
- https://developer.nvidia.com/cuda-toolkit-archive (cuda 버전별로 확인가능)
- https://developer.nvidia.com/cuda-11-4-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=18.04&target_type=deb_local
- 다설치하고 nvidia-smi 정상, nvcc -V 작동안됨
sudo apt-get update # 에러나면 아래두줄 실행
sudo apt-get remove python3-apt
sudo apt-get install python3-apt
sudo apt-get install python3-pip # pip3 이 없어서 설치해줘야한다.
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.4.1/local_installers/cuda-repo-ubuntu1804-11-4-local_11.4.1-470.57.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-11-4-local_11.4.1-470.57.02-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu1804-11-4-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
# 마지막줄 오래걸림
nvcc -V 작동을 위한 환경설정
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
export PATH=$PATH:$CUDA_HOME/bin
cuDNN 설치 ( Tensorflow 에서 GPU를 사용하기위해 깔아주어야함) - 순서대로 깔아야함
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8_8.2.4.15-1+cuda11.4_amd64.deb
sudo dpkg -i libcudnn8_8.2.4.15-1+cuda11.4_amd64.deb
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8-dev_8.2.4.15-1+cuda11.4_amd64.deb
sudo dpkg -i libcudnn8-dev_8.2.4.15-1+cuda11.4_amd64.deb
tensorflow 2.7.0 설치
pip3 install --upgrade setuptools
sudo -H pip3 install --upgrade pip
pip3 install tensorflow==2.7.0
tensorflow 에서 gpu 인식가능한지 확인 / True 라고 나오면 정상설치완
python3.7
import tensorflow
tensorflow.test.is_gpu_available()
< 올인원 버전 >
cuda_setting.sh 생성하고 sudo bash cuda_setting.sh 실행
sudo apt update
sudo apt install python3.7 # 설치하려는 버전
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
sudo apt-get remove python3-apt
sudo apt-get install python3-apt
sudo apt-get update
sudo apt-get install python3-pip # pip3 이 없어서 설치해줘야한다.
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.4.1/local_installers/cuda-repo-ubuntu1804-11-4-local_11.4.1-470.57.02-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-11-4-local_11.4.1-470.57.02-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu1804-11-4-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
export PATH=$PATH:$CUDA_HOME/bin
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8_8.2.4.15-1+cuda11.4_amd64.deb
sudo dpkg -i libcudnn8_8.2.4.15-1+cuda11.4_amd64.deb
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/libcudnn8-dev_8.2.4.15-1+cuda11.4_amd64.deb
sudo dpkg -i libcudnn8-dev_8.2.4.15-1+cuda11.4_amd64.deb
pip3 install --upgrade setuptools
sudo -H pip3 install --upgrade pip
pip3 install tensorflow==2.7.0
'<하드웨어> > GPU' 카테고리의 다른 글
Nsight로 GPU hardware feature profiling (0) | 2022.07.06 |
---|---|
[Ubuntu] DCGM 설치하고 실행해보기 (0) | 2022.07.04 |
DeviceQuery 결과 csv파일로 저장 (0) | 2022.03.21 |
GPU register,global,shared,local,constant,texture 메모리 정의구분 및 계층구조 + gpu구조 (0) | 2022.03.15 |
DeviceQuery 정리 (0) | 2022.03.15 |