- 查看GPU信息,不是使用nvidia-smi,而是使用tegrastats
- 讓docker使用gpu,使用下面的代碼來代替docker命令,將下面的代碼保存為txdocker.sh文件,加入執(zhí)行權(quán)限。
#!/bin/bash
#Jason T. 2-6-2018
# Check specifically for the run command
if [[ $# -ge 2 && $1 == "run" ]]; then
# Tell docker to share the following folders with the base system
# This allows the docker containers to find CUDA, cuDNN, TensorRT
LIB_MAPS="/usr/lib/aarch64-linux-gnu \
/usr/local/cuda \
/usr/local/cuda/lib64"
# GPU device sharing is for a docker container to have access to
# system devices as found in the /dev directory
DEVICES="/dev/nvhost-ctrl \
/dev/nvhost-ctrl-gpu \
/dev/nvhost-prof-gpu \
/dev/nvmap \
/dev/nvhost-gpu \
/dev/nvhost-as-gpu"
# There is a need to map the libraries inside the container
# in the exact way programs would expect to find them as
# though the TX2 were operating without containers
LIBS=""
for lib in $LIB_MAPS; do
LIBS="$LIBS -v $lib:$lib"
done
DEVS=""
for dev in $DEVICES; do
DEVS="$DEVS --device=$dev"
done
#echo "docker run $LIBS $DEVS ${@:2}"
docker run $LIBS $DEVS ${@:2}
else
# Run command not found, run everything straight through docker
#echo "docker $@"
docker $@
fi
- 在更換軟件源的時(shí)候,需要注意,清華源中格式為
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
應(yīng)該將其改成
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
加一個(gè)-ports,這是因?yàn)閤avier中自帶的源的格式就是這樣的
- bazel 安裝
與在linux下的安裝不同,bazel需要從源碼進(jìn)行編譯
首先要安裝java
sudo apt-get install openjdk-8-jdk
然后下載bazel的源碼包
wget https://github.com/bazelbuild/bazel/releases/download/0.19.2/bazel-0.19.2-dist.zip
此處我使用的是0.19.2版本
然后就是編譯了
unzip bazel-0.19.2-dist.zip
cd bazel
./compile.sh
sudo cp output/bazel /usr/local/bin
- tensorflow安裝
首先是安裝依賴
$ sudo apt-get install autoconf automake libtool curl make # Protobuf Dependencies
$ sudo apt-get install python-numpy swig python-dev python-wheel # TensorFlow Dependencies
然后按照下面教程進(jìn)行安裝就好
https://devtalk.nvidia.com/default/topic/1055131/jetson-agx-xavier/building-tensorflow-1-13-on-jetson-xavier/post/5355747/#5355747