Vitis-AI之docker指南


由於網絡原因,有時候進入docker官網時候很卡,故摘錄一部分安裝要點,供自己查閱參考
docker安裝原文鏈接:https://docs.docker.com/engine/install/ubuntu/#uninstall-docker-engine docker權限設置原文鏈接:https://docs.docker.com/engine/install/linux-postinstall/
強烈建議看原文安裝!!!看原文!!!非常全面!!!

安裝環境要求

1.1To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions:

Ubuntu Impish 21.10
Ubuntu Hirsute 21.04
Ubuntu Focal 20.04 (LTS)
Ubuntu Bionic 18.04 (LTS)

1.2 安裝之前卸載舊版本

sudo apt-get remove docker docker-engine docker.io containerd runc
It’s OK if apt-get reports that none of these packages are installed.
The contents of /var/lib/docker/, including images, containers, volumes, and networks, are preserved. If you do not need to save your existing data, and want to start with a clean installation, refer to the uninstall Docker Engine section at the bottom of this page.

Uninstall Docker Engine
Uninstall the Docker Engine, CLI, and Containerd packages:

sudo apt-get purge docker-ce docker-ce-cli containerd.io
Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

You must delete any edited configuration files manually.

2.開始安裝(在線安裝)

(采用命令行在線安裝,網絡不好也可以根據官方手冊選擇.deb離線安裝的方式)

2.1 Install using the repository

Update the apt package index and install packages to allow apt to use a repository over HTTPS:

 sudo apt-get update
 sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

Add Docker’s official GPG key:

 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

2.2 Install Docker Engine

一定要選擇19.03以上的版本,否則不支持DPU docker!!!,后續又要重新升級,很麻煩。。。

 sudo apt-get update
 sudo apt-get install docker-ce docker-ce-cli containerd.io

To install a specific version of Docker Engine, list the available versions in the repo, then select and install:

apt-cache madison docker-ce
sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io

test

sudo docker run hello-world

3設置權限

3.1Create the docker group.

sudo groupadd docker

3.2 Add your user to the docker group

sudo usermod -aG docker $USER

3.3測試部分

Log out and log back in so that your group membership is re-evaluated.

If testing on a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.

On a desktop Linux environment such as X Windows, log out of your session completely and then log back in.

On Linux, you can also run the following command to activate the changes to groups:

newgrp docker
Verify that you can run docker commands without sudo.

docker run hello-world

4 安裝xilinx GPU版本的docker

4.進入https://github.com/Xilinx/Vitis-AI按照教程安裝完之后,啟動運行的時候報錯:

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

2解決方案
這是由於沒有配置好docker運行環境導致的,執行安裝容器運行環境(以Ubuntu18.04為例)
執行命令:

sudo apt-get update
sudo apt-get install nvidia-container-runtime
systemctl restart docker



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM