代码拉取完成,页面将自动刷新
#!/bin/bash
# Copyright 2020 Xilinx Inc.
sed -n '1, 5p' ./setup/docker/docker/PROMPT.txt
read -n 1 -s -r -p "Press any key to continue..." key
sed -n '5, 15p' ./setup/docker/docker/PROMPT.txt
read -n 1 -s -r -p "Press any key to continue..." key
sed -n '15, 28p' ./setup/docker/docker/PROMPT.txt
read -n 1 -s -r -p "Press any key to continue..." key
sed -n '28, 61p' ./setup/docker/docker/PROMPT.txt
read -n 1 -s -r -p "Press any key to continue..." key
sed -n '62, 224p' ./setup/docker/docker/PROMPT.txt
read -n 1 -s -r -p "Press any key to continue..." key
sed -n '224, 308p' ./setup/docker/docker/PROMPT.txt
read -n 1 -s -r -p "Press any key to continue..." key
confirm() {
echo -en "\n\nDo you agree to the terms and wish to proceed [y/n]? "
read REPLY
case $REPLY in
[Yy]) ;;
[Nn]) exit 0 ;;
*) confirm ;;
esac
REPLY=''
}
confirm
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: $0 <image>"
exit 2
fi
HERE=$(pwd -P) # Absolute path of current directory
user=`whoami`
uid=`id -u`
gid=`id -g`
DOCKER_REPO="xilinx/"
BRAND=vitis-ai
VERSION=latest
CPU_IMAGE_TAG=${DOCKER_REPO}${BRAND}-cpu:${VERSION}
GPU_IMAGE_TAG=${DOCKER_REPO}${BRAND}-gpu:${VERSION}
IMAGE_NAME="${1:-$CPU_IMAGE_TAG}"
DEFAULT_COMMAND="bash"
if [[ $# -gt 0 ]]; then
shift 1;
DEFAULT_COMMAND="$@"
if [[ -z "$1" ]]; then
DEFAULT_COMMAND="bash"
fi
fi
DETACHED="-it"
xclmgmt_driver="$(find /dev -name xclmgmt\*)"
docker_devices=""
for i in ${xclmgmt_driver} ;
do
docker_devices+="--device=$i "
done
render_driver="$(find /dev/dri -name renderD\*)"
for i in ${render_driver} ;
do
docker_devices+="--device=$i "
done
DOCKER_RUN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ "$PWD" != "$DOCKER_RUN_DIR" ]; then
echo "WARNING: Please start 'docker_run.sh' from the Vitis-AI/ source directory";
fi
docker_run_params=$(cat <<-END
-v /dev/shm:/dev/shm \
-v /opt/xilinx/dsa:/opt/xilinx/dsa \
-v /opt/xilinx/overlaybins:/opt/xilinx/overlaybins \
-v /etc/xbutler:/etc/xbutler \
-e USER=$user -e UID=$uid -e GID=$gid \
-e VERSION=$VERSION \
-v $DOCKER_RUN_DIR:/vitis_ai_home \
-v $HERE:/workspace \
-w /workspace \
--rm \
--network=host \
${DETACHED} \
${RUN_MODE} \
$IMAGE_NAME \
$DEFAULT_COMMAND
END
)
##############################
if [[ $IMAGE_NAME == *"gpu"* ]]; then
docker run \
$docker_devices \
--gpus all \
$docker_run_params
else
docker run \
$docker_devices \
$docker_run_params
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。