本文介绍如何安装CUDA,以CUDA6.0为例介绍。
Download the .deb file for the CUDA Toolkit for L4T either using a web browser on the device, or download on your PC then copy the file to your device using a USB flash stick or across the network. (Make sure you download the Toolkit for L4T and not the
Toolkit for Ubuntu since that is for cross-compilation instead of native compilation).
On the device, install the .deb file and the CUDA Toolkit. eg:
cd ~/Downloads # Install the CUDA repo metadata that you downloaded manually for L4T sudo dpkg -i cuda-repo-l4t-r19.2_6.0-42_armhf.deb # Download & install the actual CUDA Toolkit including the OpenGL toolkit from NVIDIA. (It only downloads around 15MB) sudo apt-get update # Install "cuda-toolkit-6-0" if you downloaded CUDA 6.0, or "cuda-toolkit-6-5" if you downloaded CUDA 6.5, etc. sudo apt-get install cuda-toolkit-6-0 # Add yourself to the "video" group to allow access to the GPU sudo usermod -a -G video $USERAdd the 32-bit CUDA paths to your .bashrc login script, and start using it in your current console:
echo "# Add CUDA bin & library paths:" >> ~/.bashrc echo "export PATH=/usr/local/cuda/bin:$PATH" >> ~/.bashrc echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH" >> ~/.bashrc source ~/.bashrcVerify that the CUDA Toolkit is installed on your device:
nvcc -V
If you think you will write your own CUDA code or you want to see what CUDA can do, then follow this section to build & run all of the CUDA samples.
Install writeable copies of the CUDA samples to your device‘s home directory (it will create a "NVIDIA_CUDA-6.0_Samples" folder):
cuda-install-samples-6.0.sh /home/ubuntuBuild the CUDA samples (takes around 15 minutes on Jetson TK1):
cd ~/NVIDIA_CUDA-6.0_Samples makeRun some CUDA samples:
1_Utilities/deviceQuery/deviceQuery 1_Utilities/bandwidthTest/bandwidthTest cd 0_Simple/matrixMul ./matrixMulCUBLAS cd ../.. cd 0_Simple/simpleTexture ./simpleTexture cd ../.. cd 3_Imaging/convolutionSeparable ./convolutionSeparable cd ../.. cd 3_Imaging/convolutionTexture ./convolutionTexture cd ../..
Note: Many of the CUDA samples use OpenGL GLX and open graphical windows. If you are running these programs through an SSH remote terminal, you can remotely display the windows on your desktop by typing "export DISPLAY=:0" and then executing the program.
(This will only work if you are using a Linux/Unix machine or you run an X server such as the free "Xming" for Windows). eg:
export DISPLAY=:0 cd ~/NVIDIA_CUDA-6.0_Samples/2_Graphics/simpleGL ./simpleGL cd ~/NVIDIA_CUDA-6.0_Samples/3_Imaging/bicubicTexture ./bicubicTexture cd ~/NVIDIA_CUDA-6.0_Samples/3_Imaging/bilateralFilter ./bilateralFilterNote: the Optical Flow sample (HSOpticalFlow) and 3D stereo sample (stereoDisparity) take rougly 1 minute each to execute since they compare results with CPU code.
(to be added)
NVIDIA Jetson TK1学习与开发(六):如何安装CUDA
原文地址:http://blog.csdn.net/frd2009041510/article/details/42925205