Outils pour utilisateurs

Outils du site


installation_de_cuda

Ceci est une ancienne révision du document !


Installation de CUDA

Désinstaller le Nvidia driver

Pour commencer proprement.

sudo apt purge nvidia-*
sudo apt autoremove

Xubuntu 20.04 Installation de CUDA 11.2 Driver 460 CuDNN 8

Compilation de OpenCV avec CUDNN

sudo apt update
sudo apt upgrade
sudo apt install build-essential cmake git unzip pkg-config libjpeg-dev libpng-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev libgtk2.0-dev libcanberra-gtk* python3-dev python3-numpy python3-pip libxvidcore-dev libx264-dev libgtk-3-dev libtbb2 libtbb-dev libdc1394-22-dev libv4l-dev v4l-utils libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libavresample-dev libvorbis-dev libxine2-dev libfaac-dev libmp3lame-dev libtheora-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenblas-dev libatlas-base-dev libblas-dev liblapack-dev libeigen3-dev gfortran libhdf5-dev protobuf-compiler libprotobuf-dev libgoogle-glog-dev libgflags-dev
cd /usr/include/linux
sudo ln -s -f ../libv4l1-videodev.h videodev.h
cd ~
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.4.0.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.4.0.zip
unzip opencv.zip
unzip opencv_contrib.zip
mv opencv-4.4.0 opencv
mv opencv_contrib-4.4.0 opencv_contrib
cd opencv
mkdir build
cd build
nvidia-smi
 
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_TIFF=ON \
-D WITH_FFMPEG=ON \
-D WITH_GSTREAMER=ON \
-D WITH_TBB=ON \
-D BUILD_TBB=ON \
-D WITH_EIGEN=ON \
-D WITH_V4L=ON \
-D WITH_LIBV4L=ON \
-D WITH_VTK=OFF \
-D WITH_QT=OFF \
-D WITH_OPENGL=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D BUILD_TESTS=OFF \
-D OPENCV_DNN_CUDA=ON \
-D ENABLE_FAST_MATH=ON \
-D CUDA_FAST_MATH=ON \
-D CUDA_ARCH_BIN=6.1 \
-D WITH_CUBLAS=ON \
-D WITH_CUDNN=ON \
-D CUDNN_LIBRARY=/path/libcudnn.so.7.6.5 \
-D CUDNN_INCLUDE_DIR=path \
-D BUILD_EXAMPLES=OFF ..
 
make -j8
sudo make install
sudo ldconfig
sudo apt update

Installation de cupy

sudo pip3 install cupy

Installation de Tensorfow

sudo pip3 install tensorflow

Xubuntu 20.04

installation_de_cuda.1616176074.txt.gz · Dernière modification: 2021/03/19 18:47 de serge