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

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:

主站蜘蛛池模板: 杭锦旗| 池州市| 芒康县| 叙永县| 平乡县| 海丰县| 南充市| 镇雄县| 湟源县| 宜兰市| 疏勒县| 连南| 贺兰县| 辽阳市| 布拖县| 花垣县| 常熟市| 精河县| 松阳县| 呼图壁县| 休宁县| 织金县| 广河县| 平顶山市| 黑山县| 铜山县| 香港 | 桦甸市| 江口县| 维西| 崇信县| 元江| 措美县| 左云县| 越西县| 上饶市| 密山市| 同德县| 东宁县| 桐梓县| 林芝县|