ПРОГРАММИРОВАНИЕ:

Как установить драйвер NVIDIA CUDA, CUDA Toolkit, CuDNN и TensorRT в Windows

Хорошие и простые руководства с пошаговыми инструкциями

Резюме:

В этой статье устанавливаются драйверы и программы, необходимые для использования графических процессоров NVIDIA для обучения моделей и выполнения пакетных выводов. Он загружает и устанавливает драйверы CUDA, CUDA Toolkits и обновления CUDA Toolkit. Он загружает, распаковывает и перемещает файлы CuDNN и TensorRT в каталог CUDA. Он также настраивает, создает и запускает образец BlackScholes для тестирования графического процессора.

Оглавление:

  1. Установить требования
  2. Установить драйвер CUDA
  3. Установить CUDA Toolkit 10
  4. Установить CUDA Toolkit 11
  5. Установить библиотеку CuDNN
  6. Установить библиотеку TensorRT
  7. Протестируйте GPU на образце CUDA

Приложение:

  1. Учебники: настройка искусственного интеллекта
  2. Учебники: курс искусственного интеллекта
  3. Учебники: репозитории искусственного интеллекта

Установите требования:

В этом разделе загружается и устанавливается Visual Studio с поддержкой C и C ++.

# open the powershell shell
1. press “⊞ windows”
2. enter “powershell” into the search bar
3. right-click "windows powershell"
4. click “run as administrator”
# download the visual studio 2019 installer
invoke-webrequest -outfile "$home\downloads\vsc.exe" -uri https://download.visualstudio.microsoft.com/download/pr/45dfa82b-c1f8-4c27-a5a0-1fa7a864ae21/9dd77a8d1121fd4382494e40840faeba0d7339a594a1603f0573d0013b0f0fa5/vs_Community.exe
# open the visual studio 2019 installer
invoke-item "$home\downloads\vsc.exe"
# install visual studio 2019
1. check “desktop development with c++”
2. click "install"

Установите драйвер CUDA:

В этом разделе загружается и устанавливается последняя версия драйвера CUDA на тот момент.

# download the cuda driver installer
invoke-webrequest -outfile "$home\downloads\cuda_driver.exe" -uri https://us.download.nvidia.com/Windows/471.68/471.68-desktop-win10-win11-64bit-international-nsd-dch-whql.exe
# open the cuda driver installer
invoke-item "$home\downloads\cuda_driver.exe"
# install the cuda driver
1. select “nvidia graphics driver”
2. click "agree & continue"
3. click "next"

Установите CUDA Toolkit 10:

В этом разделе загружается и устанавливается CUDA Toolkit 10 и обновления.

# download the cuda toolkit 10 installer
invoke-webrequest -outfile "$home\downloads\cuda_toolkit_10.exe" https://developer.download.nvidia.com/compute/cuda/10.2/Prod/network_installers/cuda_10.2.89_win10_network.exe
# open the cuda toolkit 10 installer
invoke-item "$home\downloads\cuda_toolkit_10.exe"
# install cuda toolkit 10
1. click "agree & continue"
2. click "next"
3. select custom (advanced)
4. click "next"
5. uncheck “nvidia geforce experience components”
6. uncheck “driver components”
7. uncheck “other components”
8. click "next"
# download the cuda 10 update 1installer
invoke-webrequest -outfile "$home\downloads\cuda_10_update_1.exe" https://developer.download.nvidia.com/compute/cuda/10.2/Prod/patches/1/cuda_10.2.1_win10.exe
# open the cuda 10 update 1 installer
invoke-item "$home\downloads\cuda_10_update_1.exe"
# install the cuda 10 update 1
1. click "agree & continue"
2. click "next"
# download the cuda 10 update 2 installer
invoke-webrequest -outfile "$home\downloads\cuda_10_update_2.exe" https://developer.download.nvidia.com/compute/cuda/10.2/Prod/patches/2/cuda_10.2.2_win10.exe
# open the cuda 10 update 2 installer
invoke-item "$home\downloads\cuda_10_update_2.exe"
# install the cuda 10 update 2
1. click "agree & continue"
2. click "next"

Установите CUDA Toolkit 11:

В этом разделе загружается и устанавливается CUDA Toolkit 11.

# download the cuda toolkit 11 installer
invoke-webrequest -outfile "$home\downloads\cuda_toolkit_11.exe" https://developer.download.nvidia.com/compute/cuda/11.4.1/network_installers/cuda_11.4.1_win10_network.exe
# open the cuda toolkit 11 installer
invoke-item "$home\downloads\cuda_toolkit_11.exe"
# install cuda toolkit 11
1. click "agree & continue"
2. click "next"
3. select custom (advanced)
4. click "next"
5. uncheck “nvidia geforce experience components”
6. uncheck “driver components”
7. uncheck “other components”
8. click "next"

Установите библиотеку CuDNN:

Этот раздел присоединяется к Программе разработчика NVIDIA и загружает библиотеку CuDNN, распаковывает и перемещает файлы в каталог CUDA.

# join the nvidia developer program
start-process iexplore "https://developer.nvidia.com/developer-program"
# download the cudnn library for cuda toolkit 10 
start-process iexplore https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.2/10.2_07062021/cudnn-10.2-windows10-x64-v8.2.2.26.zip
# unzip the cudnn library for cuda toolkit 10
expand-archive "$home\downloads\cudnn-10.2-windows10-x64-v8.2.2.26.zip" -destinationpath "$home\downloads\cudnn_cuda_toolkit_10\"
# move the dll files
move-item "$home\downloads\cudnn_cuda_toolkit_10\cuda\bin\cudnn*.dll" "c:\program files\nvidia gpu computing toolkit\cuda\v10.2\bin\"
# move the h files
move-item "$home\downloads\cudnn_cuda_toolkit_10\cuda\include\cudnn*.h" "c:\program files\nvidia gpu computing toolkit\cuda\v10.2\include\"
# move the lib files
move-item "$home\downloads\cudnn_cuda_toolkit_10\cuda\lib\x64\cudnn*.lib" "c:\program files\nvidia gpu computing toolkit\cuda\v10.2\lib\x64"
# download the cudnn library for cuda toolkit 11
start-process iexplore https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.2/11.4_07062021/cudnn-11.4-windows-x64-v8.2.2.26.zip
# unzip the cudnn library for cuda toolkit 11
expand-archive "$home\downloads\cudnn-11.4-windows-x64-v8.2.2.26.zip" -destinationpath "$home\downloads\cudnn_cuda_toolkit_11\"
# move the dll files
move-item "$home\downloads\cudnn_cuda_toolkit_11\cuda\bin\cudnn*.dll" "c:\program files\nvidia gpu computing toolkit\cuda\v11.4\bin\"
# move the h files
move-item "$home\downloads\cudnn_cuda_toolkit_11\cuda\include\cudnn*.h" "c:\program files\nvidia gpu computing toolkit\cuda\v11.4\include\"
# move the lib files
move-item "$home\downloads\cudnn_cuda_toolkit_11\cuda\lib\x64\cudnn*.lib" "c:\program files\nvidia gpu computing toolkit\cuda\v11.4\lib\x64"

Установите библиотеку TensorRT:

Этот раздел загружает библиотеку TensorRT, распаковывает и перемещает файлы в каталог CUDA и устанавливает несколько необходимых программ на Python.

# download the tensorrt library for cuda toolkit 10
start-process iexplore https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/zip/tensorrt-8.0.1.6.windows10.x86_64.cuda-10.2.cudnn8.2.zip
# unzip the tensorrt library for cuda 10
expand-archive "$home\downloads\tensorrt-8.0.1.6.windows10.x86_64.cuda-10.2.cudnn8.2.zip" "$home\downloads\tensorrt_cuda_toolkit_10\"
# move the dll files
move-item "$home\downloads\tensorrt_cuda_toolkit_10\tensorrt-8.0.1.6\lib\*.dll" "c:\program files\nvidia gpu computing toolkit\cuda\v10.2\bin\"
# download the tensorrt library for cuda toolkit 11
start-process iexplore https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.1/zip/tensorrt-8.0.1.6.windows10.x86_64.cuda-11.3.cudnn8.2.zip
# unzip the tensorrt library for cuda 11
expand-archive "$home\downloads\tensorrt-8.0.1.6.windows10.x86_64.cuda-11.3.cudnn8.2.zip" "$home\downloads\tensorrt_cuda_toolkit_11\"
# move the dll files
move-item "$home\downloads\tensorrt_cuda_toolkit_11\tensorrt-8.0.1.6\lib\*.dll" "c:\program files\nvidia gpu computing toolkit\cuda\v11.4\bin\"
# install graph surgeon
python -m pip install "$home\downloads\tensorrt_cuda_toolkit_11\tensorrt-8.0.1.6\graphsurgeon\graphsurgeon-0.4.5-py2.py3-none-any.whl"
# install onnx graph surgeon
python -m pip install "$home\downloads\tensorrt_cuda_toolkit_11\tensorrt-8.0.1.6\onnx_graphsurgeon\onnx_graphsurgeon-0.3.10-py2.py3-none-any.whl"
# install universal framework format
python -m pip install "$home\downloads\tensorrt_cuda_toolkit_11\tensorrt-8.0.1.6\uff\uff-0.6.9-py2.py3-none-any.whl"

Протестируйте графический процессор на примере CUDA:

В этом разделе настраивается, строится и запускается образец BlackScholes.

# open the visual studio file
start-process "c:\programdata\nvidia corporation\cuda samples\v11.4\4_finance\blackscholes\blackscholes_vs2019.sln"
# edit the linker input properties
1. click the "project" menu
2. click "properties"
3. double-click "linker"
4. click "input"
5. click "additional dependencies"
6. click the "down arrow" button
7. click "edit"
# add the cudnn library
1. type "cudnn.lib" at the bottom of the additional dependencies
2. click "ok"
# add the cuda toolkit 11 directory
1. click "cuda c/c++"
2. double-click "cuda toolkit custom dir"
3. enter "c:\program files\nvidia gpu computing toolkit\cuda\v11.4"
4. click "ok"
# build the sample
1. click the “build” menu
2. click “build solution”
# run the sample
cmd /k "c:\programdata\nvidia corporation\cuda samples\v11.4\bin\win64\debug\blackscholes.exe"

«Наконец, не забудьте подписаться и удерживать кнопку хлопка, чтобы получать регулярные обновления и помощь».

Приложение:

Этот блог существует, чтобы предоставить комплексные решения, ответить на ваши вопросы и ускорить ваш прогресс в области искусственного интеллекта. В нем есть все необходимое, чтобы настроить компьютер и пройти первую половину курса fastai. Он откроет вам самые современные репозитории в подполях искусственного интеллекта. Он также будет охватывать вторую половину курса фастая.

Учебники: настройка искусственного интеллекта

В этом разделе есть все, что нужно для настройки вашего компьютера.

# linux
01. install and manage multiple python versions
02. install the nvidia cuda driver, toolkit, cudnn, and tensorrt
03. install the jupyter notebook server
04. install virtual environments in jupyter notebook
05. install the python environment for ai and machine learning
06. install the fastai course requirements
# wsl 2
01. install windows subsystem for linux 2
02. install and manage multiple python versions
03. install the nvidia cuda driver, toolkit, cudnn, and tensorrt 
04. install the jupyter notebook home and public server
05. install virtual environments in jupyter notebook
06. install the python environment for ai and machine learning
07. install ubuntu desktop with a graphical user interface
08. install the fastai course requirements
# windows 10
01. install and manage multiple python versions
02. install the nvidia cuda driver, toolkit, cudnn, and tensorrt
03. install the jupyter notebook home and public server
04. install virtual environments in jupyter notebook
05. install the programming environment for ai and machine learning
# mac
01. install and manage multiple python versions
02. install the jupyter notebook server
03. install virtual environments in jupyter notebook
04. install the python environment for ai and machine learning
05. install the fastai course requirements

Учебники: курс искусственного интеллекта

Этот раздел содержит ответы на анкету в конце каждого урока.

# fastai course
01. chapter 1: your deep learning journey q&a
02. chapter 2: from model to production q&a
03. chapter 3: data ethics q&a
04. chapter 4: under the hood: training a digit classifier q&a
05. chapter 5: image classification q&a
06. chapter 6: other computer vision problems q&a
07. chapter 7: training a state-of-the-art model q&a
08. chapter 8: collaborative filtering deep dive q&a

Учебники: репозитории искусственного интеллекта

Этот раздел содержит современные репозитории в различных подполях.

# repositories related to audio
01. raise audio quality using nu-wave
02. change voices using maskcyclegan-vc
03. clone voices using real-time-voice-cloning toolbox
# repositories related to images
01. achieve 90% accuracy using facedetection-dsfd