文章目录
1 Jetson AGX 开发板编译环境搭建
1.1 官方资料包下载
https://developer.nvidia.com/embedded/jetpack-archive
https://developer.nvidia.com/embedded/jetpack?spm=5176.28103460.0.0.49e33da2EIcDhr
https://developer.nvidia.com/embedded/jetson-linux-r3541
1.2 开发者手册
https://developer.nvidia.com/embedded/learn/jetson-agx-orin-devkit-user-guide/index.html
1.2.1 安装jetpack
https://developer.nvidia.com/embedded/learn/get-started-jetson-agx-orin-devkit
sudo bash -c 'echo "deb https://repo.download.nvidia.com/jetson/common r35.4 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list'
sudo bash -c 'echo "deb https://repo.download.nvidia.com/jetson/t234 r35.4 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list'
sudo apt update
sudo apt dist-upgrade
sudo reboot
sudo apt install nvidia-jetpack # 安装完毕,可以执行nvcc --vesion指令
nvidia-jetpack 是一个包含了一系列 NVIDIA 开发工具和软件包的元包,安装完成后,您可以使用其中的各种工具来进行开发工作。以下是一些常见的 NVIDIA JetPack 工具及其用途:
NVIDIA JetPack 工具
CUDA (Compute Unified Device Architecture):
用于 GPU 计算的软件开发工具包。
cuDNN (CUDA Deep Neural Network library):
用于深度神经网络的高性能 GPU 加速库。
TensorRT:
用于高效推理的优化库。
OpenCV:
用于计算机视觉应用的开源库。
OpenXLA:
用于高性能机器学习和计算的库。
Vulkan:
一种高效的图形和计算 API。
OpenGL:
一种跨平台的图形 API。
OpenGLES:
OpenGL ES 是 OpenGL 的子集,用于移动和嵌入式设备。
Caffe2:
用于构建和训练深度神经网络的框架。
TensorFlow:
用于机器学习和深度学习的端到端开源平台。
2 更新Image文件
2.1 自编译的Image内核文件更新到系统
3 编译文档
https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/index.html
3.1 编译内核步骤
3.1.1 下载kernel_src 源码包 - 方法1
Jetson_Linux_R35.4.1_aarch64.tbz2
./source_sync.sh -t jetson_35.4.1
3.1.1 下载kernel_src 源码包 - 方法2
3.1.3 编译内核
$ export CROSS_COMPILE_AARCH64_PATH=/home/ubuntu/toolchain-for-orin/bin
$ export CROSS_COMPILE_AARCH64=/home/ubuntu/toolchain-for-orin/bin/aarch64-buildroot-linux-gnu-
./nvbuild.sh -o $PWD/kernel_out
3.1.4 内核配置.
工具链 需要export ,参考上面的即可.
ubuntu@1-BJ-EE1000042:~/Linux_for_Tegra/source/public/kernel/kernel-5.10$
make menuconfig ARCH=arm64
3.2 编译内核工具链下载
https://developer.nvidia.com/embedded/downloads
https://developer.nvidia.com/embedded/jetson-linux-r3541 交叉工具链下载
3.3 orin 介绍
https://docs.nvidia.com/jetson/archives/r35.1/DeveloperGuide/text/SO/JetsonAgxOrin.html#
4 csi_trace log文件获取
https://forums.developer.nvidia.com/t/cant-get-mipi-csi-trace-log/180527
echo 1 > /sys/kernel/debug/tracing/tracing_on
echo 30720 > /sys/kernel/debug/tracing/buffer_size_kb
echo 1 > /sys/kernel/debug/tracing/events/tegra_rtcpu/enable
echo 1 > /sys/kernel/debug/tracing/events/freertos/enable
echo 2 > /sys/kernel/debug/camrtc/log-level
echo 1 > /sys/kernel/debug/tracing/events/camera_common/enable
echo > /sys/kernel/debug/tracing/trace
echo file vi2_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file csi2_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file vi4_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file csi.c +p > /sys/kernel/debug/dynamic_debug/control
echo file csi4_fops.c +p > /sys/kernel/debug/dynamic_debug/control
echo file nvcsi.c +p > /sys/kernel/debug/dynamic_debug/control
cat /sys/kernel/debug/tracing/trace
5 安装CUDA驱动
在线安装cuda驱动
Please ensure your device is configured per the CUDA Tegra Setup Documentation.
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/arm64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda
修改环境变量.bashrc
export PATH=$PATH:/usr/local/cuda-12.2/bin
export LD_LIBRARY_PATH=/usr/local/cuda-12.2/compat
gpu驱动 nvgpu
nano@orin-nano:~$ lsmod
Module Size Used by
fuse 131072 7
nvidia_modeset 1093632 6
lzo_rle 16384 36
lzo_compress 16384 1 lzo_rle
zram 32768 6
ramoops 28672 0
reed_solomon 20480 1 ramoops
bnep 28672 2
loop 40960 1
nvgpu 2785280 32
aes_ce_blk 36864 1
crypto_simd 24576 1 aes_ce_blk
rtk_btusb 69632 0
cryptd 32768 1 crypto_simd
rtl8822ce 3117056 0
snd_soc_tegra186_dspk 20480 2
btusb 57344 0
snd_soc_tegra186_asrc 40960 1
aes_ce_cipher 20480 1 aes_ce_blk
snd_soc_tegra210_ope 36864 1
snd_soc_tegra210_iqc 16384 0
snd_soc_tegra210_mvc 20480 2
btrtl 24576 1 btusb
r8168 495616 0
snd_soc_tegra186_arad 28672 2 snd_soc_tegra186_asrc
snd_soc_tegra210_afc 20480 6
ghash_ce 28672 0
input_leds 16384 0
snd_hda_codec_hdmi 61440 1
cfg80211 847872 1 rtl8822ce
snd_soc_tegra210_admaif 131072 1
snd_soc_tegra210_dmic 20480 4
snd_soc_tegra210_adx 32768 4
sha2_ce 20480 0
btbcm 24576 1 btusb
snd_soc_tegra210_amx 36864 4
snd_hda_tegra 16384 0
sha256_arm64 28672 1 sha2_ce
btintel 32768 1 btusb
snd_soc_tegra210_adsp 774144 1
snd_soc_tegra_pcm 16384 1 snd_soc_tegra210_admaif
snd_soc_tegra210_i2s 24576 6
snd_soc_tegra210_mixer 49152 1
sha1_ce 20480 0
snd_soc_tegra_machine_driver 16384 0
snd_soc_tegra210_sfc 61440 4
snd_hda_codec 135168 2 snd_hda_codec_hdmi,snd_hda_tegra
nvadsp 118784 1 snd_soc_tegra210_adsp
snd_soc_tegra_utils 32768 3 snd_soc_tegra210_admaif,snd_soc_tegra_machine_driver,snd_soc_tegra210_adsp
snd_soc_tegra210_ahub 1273856 3 snd_soc_tegra210_ope,snd_soc_tegra210_sfc
snd_soc_spdif_tx 16384 0
snd_hda_core 94208 3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_tegra
pwm_fan 24576 0
fusb301 24576 0
snd_soc_simple_card_utils 24576 1 snd_soc_tegra_utils
ina3221 24576 0
tegra_bpmp_thermal 16384 0
tegra210_adma 28672 2 snd_soc_tegra210_admaif,snd_soc_tegra210_adsp
userspace_alert 16384 0
spi_tegra114 32768 0
nvidia 1327104 13 nvidia_modeset
binfmt_misc 24576 1
nvmap 221184 148 nvgpu
ip_tables 36864 0
x_tables 53248 1 ip_tables