Vitis-AI 3.0 GPU Docker 安装踩坑及修改

参考视频 Bili
参考blog CSDN
安装的版本为vitis ai 3.0
特别鸣谢ChatGPT

启动docker获得的报错

走完上述步骤后,启动docker

./docker_run.sh xilinx/vitis-ai-pytorch-gpu:latest

报错如下:

Error response from daemon: pull access denied for xilinx/vitis-ai-pytorch-gpu, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

==========
== CUDA ==
==========

CUDA Version 11.3.1

Container image Copyright (c) 2016-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

Setting up qhy 's environment in the Docker container...
usermod: no changes
Running as vitis-ai-user with ID 0 and group 0 

bash: /usr/local/bin/gosu: No such file or directory

这里的第一个ERROR是由于docker pull导致的,由于gpu的image是自己生成的,所以不需要docker pull,所以需要把docker_run.sh中的docker pull注释掉

touch .confirm 
# docker pull $IMAGE_NAME 
if [[ $IMAGE_NAME == *"gpu"* ]]; then

第二个错误是没有安装gosu,这个首先需要进入docker,需要把docker_run.sh中的执行终端都改为sh。共有三处需要修改

#!/bin/sh
# Copyright 2022 Xilinx Inc.

DEFAULT_COMMAND="sh"

if [[ $# -gt 0 ]]; then
  shift 1;
  DEFAULT_COMMAND="$@"
  if [[ -z "$1" ]]; then
    DEFAULT_COMMAND="sh"
  fi
fi

改完之后再执行

./docker_run.sh xilinx/vitis-ai-pytorch-gpu:latest

就能够进入sh的终端,这个时候再手动安装gosu即可使用bash。

安装GOSU

❯ ./docker_run.sh xilinx/vitis-ai-pytorch-gpu:latest

==========
== CUDA ==
==========

CUDA Version 11.3.1

Container image Copyright (c) 2016-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.


执行

GOSU_VERSION=1.12
wget -O gosu "https://github.com# /tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)"
wget -O gosu.asc "https://github.com/tianon/gosu/releases/download/$GO--2023-05-18 01:46:09--  https://github.com/tianon/gosu/releases/download/1.12/gosu-amd64
SU_VERSION/gosu-$(dpkg --print-architecture).asc"

输出如下

  1. 从 GitHub 下载 Gosu 的二进制文件和签名文件。首先,找到要下载的版本号。可以在 Gosu 的发布页面上找到。假设你要下载的版本号是1.12,那么你可以运行以下命令来下载它:
GOSU_VERSION=1.12
wget -O gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)"
wget -O gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc"

  1. 导入 Gosu 的 GPG 密钥。运行以下命令:
    export GNUPGHOME="$(mktemp -d)" gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
  1. 验证下载的 Gosu 二进制文件。运行以下命令:
gpg --batch --verify gosu.asc gosu

如果该命令的输出表示签名是有效的,那么 Gosu 二进制文件就是安全的。

  1. 给下载的 Gosu 二进制文件赋予可执行权限,然后将其移动到 /usr/local/bin,这样所有用户都可以使用它。运行以下命令:
chmod +x gosu sudo mv gosu /usr/local/bin
  1. 清理你在步骤4中创建的临时GPG目录。运行以下命令:
rm -r "$GNUPGHOME"
  1. 测试 Gosu 是否正确安装。运行以下命令:
gosu root id

你应该会看到关于 root 用户的信息,这表明 Gosu 已经正确安装了。

执行

bash

得到如下输出


Setting up xxx 's environment in the Docker container...
usermod: no changes
Running as vitis-ai-user with ID 0 and group 0 


==========================================
 
__      ___ _   _                   _____
\ \    / (_) | (_)            /\   |_   _|
 \ \  / / _| |_ _ ___ ______ /  \    | |
  \ \/ / | | __| / __|______/ /\ \   | |
   \  /  | | |_| \__ \     / ____ \ _| |_
    \/   |_|\__|_|___/    /_/    \_\_____|
 
==========================================

Docker Image Version: latest   (GPU) 
Vitis AI Git Hash: 2057c588c 
Build Date: 2023-05-18
WorkFlow: pytorch

vitis-ai-user@spin3090:/workspace$ conda activate vitis-ai-pytorch
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值