官术网_书友最值得收藏!

Linux 

This section covers the steps to install CUDA on Linux distributions. In this section, the installation of CUDA in Ubuntu, which is a popular Linux distribution, is discussed using distribution-specific packages or using the apt-get command (which is specific to Ubuntu).

The steps to install CUDA using the  *.deb installer downloaded from the CUDA website are as follows:

  1. Open Terminal and run the dpkg command, which is used to install packages in Debian-based systems:
sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
  1. Install the CUDA public GPG key using the following command:
sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub
  1. Then, update the apt repository cache using the following command:
sudo apt-get update
  1. Then you can install CUDA using the following command:
sudo apt-get install cuda
  1. Include the CUDA installation path in the PATH environment variable using the following command:
If you have not installed CUDA at default locations, you need to change the path to point at your installation location.
  export PATH=/usr/local/cuda-x.x/bin${PATH:+:${PATH}}
  1. Set the LD_LIBRARY_PATH environment variable:
export LD_LIBRARY_PATH=/usr/local/cuda-x.x/lib64\
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

 You can also install the CUDA toolkit by using the  apt-get package manager, available with Ubuntu OS. You can run the following command in Terminal:

sudo apt-get install nvidia-cuda-toolkit

To check whether the CUDA GPU compiler has been installed, you can run the nvcc -V command from Terminal. It calls the GCC compiler for C code and the NVIDIA PTX compiler for the CUDA code.

You can install the NVIDIA Nsight Eclipse plugin, which will give the GUI Integrated Development Environment for executing CUDA programs, using the following command:

sudo apt install nvidia-nsight

After installation, you can run the deviceQuery project located at  ~/NVIDIA_CUDA-x.x_Samples. If the CUDA toolkit is installed and configured correctly, the output for deviceQuery should look similar to the following:

主站蜘蛛池模板: 栾城县| 永昌县| 香格里拉县| 南部县| 遂昌县| 三亚市| 龙胜| 阿鲁科尔沁旗| 贺州市| 江口县| 保定市| 枣强县| 洪雅县| 平阴县| 寿宁县| 汪清县| 青河县| 隆安县| 内乡县| 宁安市| 陵水| 麻江县| 准格尔旗| 南澳县| 光泽县| 亚东县| 调兵山市| 霸州市| 安图县| 德兴市| 北宁市| 兴义市| 辉县市| 盐津县| 昭觉县| 嘉黎县| 铁力市| 穆棱市| 津南区| 辉南县| 绥阳县|