Outils pour utilisateurs

Outils du site


archives:archive_installation_de_cuda_et_cudnn_sur_un_portable_optimus_avec_debian_9_stretch

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
installation_de_cuda_et_cudnn_sur_un_portable_optimus_avec_debian_9_stretch [2019/03/23 07:56] – créée sergearchives:archive_installation_de_cuda_et_cudnn_sur_un_portable_optimus_avec_debian_9_stretch [2020/04/06 16:07] (Version actuelle) – [Version sur Debian GNU/Linux Version 9 (stretch) 64-bit abandonnée] serge
Ligne 1: Ligne 1:
-====== Installation de CUDA et CUDNN sur un portable optimus avec debian 9 stretch ======+====== Archive Installation de CUDA et CUDNN sur un portable optimus avec debian 9 stretch et ubuntu 18.04======
  
-{{tag>archive}}+=====Installation de Anaconda CUDA CUDNN sur ubuntu 18.04===== 
 +====Avec Anaconda: mauvaise idée==== 
 +  * **[[https://gist.github.com/mari-linhares/cef4cb3440408e44963d1447a7db5ae0|Setting up a MSI laptop with GPU]] Installation de Ubuntu 18.04, CUDA, CDNN, Pytorch et TensorFlow**  Ce tuto va permettre d'installer et de vérifier "facilement" le bon fonctionnement du GPU. 
 +===Conda=== 
 +  wget -c https://repo.anaconda.com/archive/Anaconda3-2018.12-Linux-x86_64.sh 
 +  sh Anaconda3-2018.12-Linux-x86_64.sh 
 +===CUDA=== 
 +<code> 
 +wget -c https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.105-418.39_1.0-1_amd64.deb 
 +sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.105-418.39_1.0-1_amd64.deb 
 +sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub 
 +sudo apt-key add /var/cuda-repo-10-1-local-10.1.105-418.39/7fa2af80.pub 
 +sudo apt-get update 
 +sudo apt-get install cuda 
 +</code> 
 +===CUDNN=== 
 +Remarque: Début des essais avec 
 +  sudo dpkg -i libcudnn7_7.5.0.56-1+cuda10.1_amd64.deb 
 +qui n'a pas installer cudnn !! 
 + 
 +Il faut avoir un compte sur Nvidia et se loguer pour pouvoir télécharger: 
 +  wget -c https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.5.0.56/prod/10.1_20190225/cudnn-10.1-linux-x64-v7.5.0.56.tgz 
 + 
 +Décompresser, dans le dossier: 
 +  sudo cp -P /media/data/cuda/targets/ppc64le-linux/lib/libcudnn* /usr/local/cuda-10.1/lib64/ 
 +  sudo cp  /media/data/cuda/targets/ppc64le-linux/include/cudnn.h /usr/local/cuda-10.1/include/ 
 +  sudo chmod a+r /usr/local/cuda-10.1/include/cudnn.h /usr/local/cuda/lib64/libcudnn* 
 + 
 +===Installation de Pytorch=== 
 +<code> 
 +# creation d'un environement virtuel conda 
 +conda create -n torch python=3.7 
 +# installation torch pour cuda 10 
 +conda install -y pytorch=0.4 torchvision cuda100 -c pytorch 
 +# test gpu install 
 +</code> 
 +<code python> 
 +python3 -c 'import torch; print(torch.rand(2,3).cuda())' 
 +</code> 
 +<code> 
 +__init__.py:116: UserWarning:  
 +    Found GPU0 GeForce GTX 765M which is of cuda capability 3.0. 
 +    PyTorch no longer supports this GPU because it is too old. 
 +  warnings.warn(old_gpu_warn % (d, name, major, capability[1])) 
 +tensor([[0.6618, 0.3247, 0.4543], 
 +        [0.9745, 0.8508, 0.0141]], device='cuda:0'
 +</code> 
 +Ma carte n'est plus toute fraîche ! 
 +===Installation de TensorFlow=== 
 +<code> 
 +sudo apt-get install libcupti-dev 
 +sudo pip3 install tensorflow-gpu 
 +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64 
 +python3 -c 'from tensorflow.python.client import device_lib; device_lib.list_local_devices()' 
 +</code> 
 + 
 +=====Version sur Debian GNU/Linux Version 9 (stretch) 64-bit abandonnée===== 
 +**Le but était de compiler YOLO Darknet.** 
 +Nous avons installé Bumblebee et bbswitch. Cela ne permet pas d'avoir la carte Nvidia en permanence.  
 + 
 +**CMake >= 3.8 for modern CUDA support**\\ 
 +https://cmake.org/download/\\ 
 +Télécharger [[https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0.tar.gz|cmake-3.14.0.tar.gz]] 
 +  ./bootstrap && make && sudo make install  
 +   
 +**GCC or Clang**\\ 
 +  sudo apt-get install clang 
 +   
 +**OpenCV < 4.0**\\ 
 +<code> 
 +sudo pip3 install opencv-python==3.4.5.20  
 +# je ratisse large, installe ~ 100 paquets 
 +sudo apt-get install libopencv-core-dev libopencv-highgui-dev libopencv-flann-dev libopencv-photo-dev libopencv-video-dev 
 +# ceci devrait tout appeler 
 +sudo apt-get install libopencv-dev 
 +</code> 
 + 
 +**CUDA**\\ 
 +CUDA 10.0: [[https://developer.nvidia.com/cuda-toolkit-archive|Cuda Toolkit]] (on Linux do [[https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions|Post-installation Actions]]) 
 +   
 +  sudo apt-get install gcc g++ gcc-4.9 g++-4.9 libxi libxi6 libxi-dev libglu1-mesa libglu1-mesa-dev libxmu6 libxmu6-dev linux-headers-amd64 linux-source 
 + 
 +Utilisation de la version ubuntu 18.04 de 2.4 Go ! 
 +  wget -c https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.39_linux.run 
 +Installation du driver seul. Mais comme il a été installé avant je pense que cette étape ne sert à rien. 
 +   
 +**cuDNN**\\ 
 +cuDNN >= 7.0 for CUDA 10.0 https://developer.nvidia.com/rdp/cudnn-archive (set system variable CUDNN = where did you unpack cuDNN. On Linux in .bashrc-file) 
 + 
 +https://github.com/AlexeyAB/darknet\\ 
 +https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installlinux-tar\\ 
 +Téléchargement et installation de libcudnn7_7.4.2.24-1+cuda10.0_amd64.deb  
 +Il faut obligatoirement avoir un compte Nvidia et se loguer. 
 +  * [[https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libcudnn7-dev_7.4.2.24-1+cuda10.0_amd64.deb|libcudnn7-dev_7.4.2.24-1+cuda10.0_amd64.deb]] 
 +ou ?? 
 +  * [[https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libcudnn7_7.4.2.24-1+cuda10.0_amd64.deb|libcudnn7_7.4.2.24-1+cuda10.0_amd64.deb]] 
 +Téléchargement et décompression de cudnn-10.0-linux-ppc64le-v7.4.2.24.tgz 
 + 
 +Les chemins sont faux, le faire à la main avec un sudo votre navigateur de fichiers 
 +  sudo cp cuda/include/cudnn.h /usr/local/cuda/include 
 +  sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64 
 +Les droits sont juste, ne pas faire: 
 +  sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* 
 + 
 + 
 +**GPU with CC**\\ 
 +GPU with CC >= 3.0: Dans le [[https://en.wikipedia.org/wiki/CUDA#GPUs_supported|tableau]], mon GPU: GTX 765M supporte la version CUDA SDK 3.0 
 + 
 +**make**\\ 
 +Export nécessaire pour avoir nvcc 
 +  export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}} 
 +  nvcc -V 
 +  export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} 
 +  make 
 +   
 +{{tag>archive sb}}
archives/archive_installation_de_cuda_et_cudnn_sur_un_portable_optimus_avec_debian_9_stretch.1553327764.txt.gz · Dernière modification : 2019/03/23 07:56 de serge