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)




目录
相关文章
|
存储 缓存 Linux
GitHub,OSChina,码市的详细使用(上)
GitHub,OSChina,码市的详细使用
374 0
GitHub,OSChina,码市的详细使用(上)
|
11月前
|
人工智能 安全 Cloud Native
|
编解码 Shell
在jetson中实现ffmpeg调用硬件编解码加速处理
在jetson中实现ffmpeg调用硬件编解码加速处理
2917 1
|
10月前
|
数据采集 DataWorks 大数据
开发者评测:DataWorks — 数据处理与分析的最佳实践与体验
阿里云DataWorks是一款集成化的大数据开发治理平台,支持从数据导入、清洗、分析到报告生成的全流程自动化。通过用户画像分析实践,验证了其高效的数据处理能力。DataWorks在电商和广告数据处理中表现出色,提供了强大的任务调度、数据质量监控和团队协作功能。相比其他工具,DataWorks易用性高,与阿里云服务集成紧密,但在API支持和成本优化方面有待提升。总体而言,DataWorks为企业提供了强有力的数据开发和治理支持,尤其适合有阿里云生态需求的团队。
783 17
|
11月前
|
存储 人工智能 算法
卷起来!让智能体评估智能体,Meta发布Agent-as-a-Judge
Meta(原Facebook)提出了一种名为Agent-as-a-Judge的框架,用于评估智能体的性能。该框架包含八个模块,通过构建项目结构图、定位相关文件、读取多格式数据、搜索和检索信息、询问要求满足情况、存储历史判断、以及规划下一步行动,有效提升了评估的准确性和稳定性。实验结果显示,Agent-as-a-Judge在处理复杂任务依赖关系方面优于大型语言模型,但在资源消耗和潜在偏见方面仍面临挑战。
376 1
|
传感器 机器人 API
NVIDIA Jetson TX1,TX2,TX2 NX,AGX Xavier 和 Nano开发板GPIO口配置及应用
NVIDIA Jetson TX1,TX2,TX2 NX,AGX Xavier 和 Nano开发板GPIO口配置及应用
|
存储 JSON Kubernetes
实时计算 Flink版操作报错合集之 写入hudi时报错,该如何排查
在使用实时计算Flink版过程中,可能会遇到各种错误,了解这些错误的原因及解决方法对于高效排错至关重要。针对具体问题,查看Flink的日志是关键,它们通常会提供更详细的错误信息和堆栈跟踪,有助于定位问题。此外,Flink社区文档和官方论坛也是寻求帮助的好去处。以下是一些常见的操作报错及其可能的原因与解决策略。
|
Ubuntu 机器人 网络安全
ubuntu22.04 SSH和ROS2控制下位机
本文介绍了如何在Ubuntu 22.04系统中通过SSH远程控制机器人服务器,包括安装SSH服务、配置防火墙规则、修改`/etc/hosts`文件、使用密钥认证等步骤,并提供了使用ROS2控制下位机的方法和一些常用指令。
324 0
|
机器学习/深度学习 计算机视觉 Python
深度学习实战】行人检测追踪与双向流量计数系统【python源码+Pyqt5界面+数据集+训练代码】YOLOv8、ByteTrack、目标追踪、双向计数、行人检测追踪、过线计数(3)
深度学习实战】行人检测追踪与双向流量计数系统【python源码+Pyqt5界面+数据集+训练代码】YOLOv8、ByteTrack、目标追踪、双向计数、行人检测追踪、过线计数
|
机器学习/深度学习 存储 算法
深度学习实战】行人检测追踪与双向流量计数系统【python源码+Pyqt5界面+数据集+训练代码】YOLOv8、ByteTrack、目标追踪、双向计数、行人检测追踪、过线计数(2)
深度学习实战】行人检测追踪与双向流量计数系统【python源码+Pyqt5界面+数据集+训练代码】YOLOv8、ByteTrack、目标追踪、双向计数、行人检测追踪、过线计数