NVIDIA Jetson TK1学习与开发(六):如何安装CUDA

简介: <p>本文介绍如何安装CUDA,以CUDA6.0为例介绍。</p> <h3>1、Installing the CUDA Toolkit onto your device for native CUDA development</h3> <p>Download the .deb file for the CUDA Toolkit for L4T either using a web br

本文介绍如何安装CUDA,以CUDA6.0为例介绍。

1、Installing the CUDA Toolkit onto your device for native CUDA development

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 $USER
Add 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 ~/.bashrc
Verify that the CUDA Toolkit is installed on your device:

nvcc -V

2、Installing & running the CUDA samples (optional)

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/ubuntu
Build the CUDA samples (takes around 15 minutes on Jetson TK1):

cd ~/NVIDIA_CUDA-6.0_Samples
make
Run 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 ../..

3、注意事项(some notes)

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
./bilateralFilter
Note: the Optical Flow sample (HSOpticalFlow) and 3D stereo sample (stereoDisparity) take rougly 1 minute each to execute since they compare results with CPU code.
Some of the CUDA samples use other libraries such as OpenMP or MPI or OpenGL.
If you want to compile those samples then you'll need to install these toolkits like this:

(to be added)




目录
相关文章
|
7月前
|
存储 并行计算 Ubuntu
Nvidia Jetson Orin系列配置教程
本文是Nvidia Jetson Orin系列的配置教程,介绍了两种安装方法:通过Nvidia SDK Manager进行安装和通过本地镜像烧录进行安装。第一种方法包括下载SDK Manager、安装和使用工具进行Jetson系列硬件的配置。第二种方法包括下载官方镜像、使用Etcher烧录镜像、安装镜像、安装开发环境以及检查开发环境是否配置成功。文中还提供了CUDA、cuDNN、TensorRT和OpenCV的检查命令和预期结果。
1031 0
Nvidia Jetson Orin系列配置教程
|
7月前
|
并行计算 TensorFlow 算法框架/工具
Windows11+CUDA12.0+RTX4090如何配置安装Tensorflow2-GPU环境?
本文介绍了如何在Windows 11操作系统上,配合CUDA 12.0和RTX4090显卡,通过创建conda环境、安装特定版本的CUDA、cuDNN和TensorFlow 2.10来配置TensorFlow GPU环境,并提供了解决可能遇到的cudnn库文件找不到错误的具体步骤。
898 3
|
机器学习/深度学习 人工智能 Linux
Linux和Windows系统下安装深度学习框架所需支持:Anaconda、Paddlepaddle、Paddlenlp、pytorch,含GPU、CPU版本详细安装过程
Linux和Windows系统下安装深度学习框架所需支持:Anaconda、Paddlepaddle、Paddlenlp、pytorch,含GPU、CPU版本详细安装过程
Linux和Windows系统下安装深度学习框架所需支持:Anaconda、Paddlepaddle、Paddlenlp、pytorch,含GPU、CPU版本详细安装过程
|
机器学习/深度学习 并行计算 Ubuntu
系统类配置(五)【ubuntu14.04下安装cuda8+nvidia-410.78+cudnn6.0 +tensorflow-gpu==1.4.0。】
系统类配置(五)【ubuntu14.04下安装cuda8+nvidia-410.78+cudnn6.0 +tensorflow-gpu==1.4.0。】
116 0
|
并行计算 PyTorch 测试技术
Win11配置Anaconda-Cuda-Pytorch-Tenserflow环境
Win11配置Anaconda-Cuda-Pytorch-Tenserflow环境
479 0
|
缓存 并行计算 Ubuntu
jetson中使用cuda
jetson中使用cuda
618 0
jetson中使用cuda
|
并行计算 Ubuntu PyTorch
Ubuntu配置pytorch gpu环境(含Cuda+Cudnn+pytorch-gpu+卸载)(上)
Ubuntu配置pytorch gpu环境(含Cuda+Cudnn+pytorch-gpu+卸载)(上)
Ubuntu配置pytorch gpu环境(含Cuda+Cudnn+pytorch-gpu+卸载)(上)
|
并行计算 Ubuntu PyTorch
Ubuntu配置pytorch gpu环境(含Cuda+Cudnn+pytorch-gpu+卸载)(下)
Ubuntu配置pytorch gpu环境(含Cuda+Cudnn+pytorch-gpu+卸载)(下)
Ubuntu配置pytorch gpu环境(含Cuda+Cudnn+pytorch-gpu+卸载)(下)
|
机器学习/深度学习 并行计算 Linux
手把手教你在 Ubuntu16.04 安装 GPU 驱动 + CUDA9.0 + cuDNN7
手把手教你在 Ubuntu16.04 安装 GPU 驱动 + CUDA9.0 + cuDNN7
273 0
手把手教你在 Ubuntu16.04 安装 GPU 驱动 + CUDA9.0 + cuDNN7
|
并行计算 TensorFlow 算法框架/工具
Ubuntu 安装 tensorflow-gpu 1.4 包含 CUDA 8.0 和cuDNN
硬件环境:NVIDIA GTX 980 Ti 系统环境:Ubuntu 16.04 64位 一.安装 NVIDIA驱动 关闭 Secure Boot 具体如何禁用 BIOS 中的 Secure Boot 要根据主板的情况。
1837 0