모델 학습 서버 개발 환경 구성에 대한 내용을 정리합니다.
Ubuntu 20.04
nvidia-driver-515
nvidia-smi -L
GPU 0: NVIDIA GeForce RTX 3090 (UUID: GPU-0e6004dc-a271-51ea-64ab-e5228503fbd4)
GPU 1: NVIDIA GeForce RTX 3090 (UUID: GPU-2053000f-2be4-cfb7-c718-cc598c21e1b8)
wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run
sudo sh cuda_11.7.0_515.43.04_linux.run
compute ability : 8.5
sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.7/include
sudo cp -P cuda/lib/libcudnn* /usr/local/cuda-11.7/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda-11.7/lib64/libcudnn*
wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
vi ~/.bashrc
export PATH=~/anaconda3/bin:~/anaconda3/condabin:$PATH
source ~/.bashrc
tar -xvzf cmake-3.17.0-rc1.tar.gz
sudo apt install qt5-default
sudo apt-get install build-essential
sudo apt install libssl-dev
./bootstrap
make
sudo make install
sudo apt update
sudo apt upgrade
sudo apt install libjpeg-dev libtiff5-dev libpng-dev
sudo apt install libavcodec-dev libavformat-dev libswscale-dev
sudo apt install libdc1394-22-dev libxvidcore-dev libx264-dev
sudo apt install libxine2-dev libv4l-dev v4l-utils
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt install libgtk-3-devDarknet
//빌드를 위한 디렉토리 생성
mkdir opencv
//opencv 소스 내려받기
wget -O opencv-4.0.0.zip https://github.com/opencv/opencv/archive/4.0.0.zip
wget -O opencv_contrib-4.0.0.zip https://github.com/opencv/opencv_contrib/archive/4.0.0.zip
//압축풀기
unzip opencv-4.0.0.zip
unzip opencv_contrib-4.0.0.zip
//빌드
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_WITH_DEBUG_INFO=OFF -D BUILD_EXAMPLES=ON -D BUILD_opencv_python3=ON -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_ENABLE_NONFREE=ON -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.0.0/modules -D OPENCV_GENERATE_PKGCONFIG=ON -D WITH_TBB=ON ../opencv-4.0.0/
make -j8 //nproc 명령어를 통해 CPU 코어수 확인 후 명령어 실행 (ex. 8개)
//설치
sudo make install
sudo ldconfig
git clone https://github.com/AlexeyAB/darknet.git
cd darknet
vim Makefile
make
(make하여 darknet 실행파일이 생기면 빌드 성공)
wget https://pjreddie.com/media/files/yolov3.weights
./darknet detect cfg/yolo3.cfggg yolo3.weights data/dog.jpg