nvidia安装ros和深度学习环境搭建步骤总结
#############todesk ################
sudo dpkg -i todesk_4.1.0_aarch64.deb
####################################
#############500g ##################
lsblk
/dev/nvme0n1
fdisk /dev/nvme0n1
n
p
enter
enter
sudo mkfs -t ext4 /dev/nvme0n1p1
sudo gedit /etc/fstab
/dev/nvme0n1p1 /media/rosbag ext4 defaults 0 0
####################################
sudo apt-get update
sudo apt-get install python3-pip
JetPack:5.0.2
jetson-stats
sudo -H pip3 install -U jetson-stats
jtop
sudo systemctl restart jtop.service
jetpack:
a. sudo apt update
b. sudo apt upgrade
c. sudo apt install nvidia-jetpack -y
查看版本:/etc/apt/sources.list.d/nvidia-l4t-apt-source.list 文件中
######################ubuntu20.04 ros noetic install############################
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install ros-noetic-desktop-full
sudo pip install rosdepc // sudo pip3 install rosdepc
sudo rosdepc init
rosdepc update
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
tf2_sensor_msgs:
sudo apt-get install ros-noetic-tf2-sensor-msgs
sudo apt install libqt5serialport5-dev libudev-dev
sudo apt-get install ros-noetic-geographic-msgs
vim ~/.bashrc:
source /opt/ros/noetic/setup.bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ros/noetic/lib
ros-numpy:
sudo apt-get install ros-noetic-ros-numpy
catkin_make : catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
catkin_make -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3
cuda: /usr/local
a. CUDA 检查是否安装成功
nvcc -V
如果报错,需要把nvcc添加到环境变量。
vim ~/.bashrc
export LD_LIBRARY_PATH=/usr/local/cuda/lib64
export PATH=$PATH:/usr/local/cuda/bin
source ~/.bashrc
出现如下则表示安装正确:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_May__4_00:02:26_PDT_2022
Cuda compilation tools, release 11.4, V11.4.239
Build cuda_11.4.r11.4/compiler.31294910_0
安装过程
conda:
root: sh Miniforge-pypy3-4.14.0-2-Linux-aarch64.sh
conda create -n py38 -y
sudo apt-get install libopenblas-base libopenmpi-dev libomp-dev
conda activate py38
pytorch:py38 ---------copy torch-1.11.0-cp38-cp38-linux_aarch64.whl from usb
pip3 install torch-1.11.0-cp38-cp38-linux_aarch64.whl
torchvision: -----------copy vision-0.12.0.zip from usb
cd torchvision
export BUILD_VERSION=0.12.0
python3 setup.py install --user
cd ../
pycuda:
nvidia@tegra-ubuntu:/$ python3 -m pip install 'pycuda<2021.1'
cupy:
pip install cupy # only good use for (base)root
if can not import cupy: pip uninstall numpy & pip install numpy==1.23.5
(py38)root: python3
import tensorrt
import torch
import pycuda
import cupy
(base)root: python3
import cupy
import numpy
import pycuda
import
untitled test:
(base)root@tegra-ubuntu: catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
numpy:
pip uninstall numpy
pip install -U numpy==1.23.5
rviz:
frame: zvision_lidar1
protobuf 3.0.0 :
gmock-1.7.0