< >
Home » TK1入门教程软件篇 » TK1入门教程软件篇-安装CUDA

TK1入门教程软件篇-安装CUDA

TK1入门教程软件篇-安装CUDA

说明:

  • 介绍如何在TK1上安装CUDA

步骤:

  • 下载.deb软件包:
http://developer.download.nvidia.com/embedded/L4T/r21_Release_v3.0/cuda-repo-l4t-r21.3-6-5-prod_6.5-42_armhf.deb
  • 在TK1上,安装.deb软件包
cd ~/Downloads  
sudo dpkg -i cuda-repo-l4t-r21.3-6-5-prod_6.5-42_armhf.deb  
sudo apt-get update  
sudo apt-get install cuda-toolkit-6-5  
sudo usermod -a -G video $USER
  • 配置到.bashrc
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 ~/.bashrc
  • 验证
nvcc -V  

安装CUDA例子:

  • 安装例子到用户的根目录:
cuda-install-samples-6.5.sh /home/ubuntu
  • 编译例子:
cd ~/NVIDIA_CUDA-6.5_Samples
make
  • 运行例子:
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 ../..
  • CUDA的例子使用OpenGL GLX和图形界面,在SSH登录情况下,需要指定窗口export DISPLAY=:0
  • 例如:
export DISPLAY=:0
cd ~/NVIDIA_CUDA-6.5_Samples/2_Graphics/simpleGL
./simpleGL

cd ~/NVIDIA_CUDA-6.5_Samples/3_Imaging/bicubicTexture
./bicubicTexture

cd ~/NVIDIA_CUDA-6.5_Samples/3_Imaging/bilateralFilter
./bilateralFilter

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: tk1入门教程软件篇