DPU on PYNQ-Z2系列—3.1 部署DPU—配置运行环境

DPU on PYNQ-Z2系列—3.1 部署DPU—配置运行环境

环境要求

Quick Way

xilinx-pynqz2-dpu3.0-PYNQv2.5.img
提取码:s2fe
直接把img烧写进SD卡上电即可在jupyter notebook下调用DPU进行编程。

步骤

烧写SD卡

balenaEtcher
烧写成功后将上一步生成的image.ub及BOOT.bin复制到SD卡的fat32分区,复制之前建议备份一下原来的文件。而后上电并确认IP地址,ssh到板子。

安装依赖

  • 更新vim
    国内源的vim有些问题,锁定vim相关的包避免出问题
# 将xilinx用户添加进vim
sudo su
echo "xilinx ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
exit
sudo apt-mark hold vim*
  • 替换sources.list加快更新速度
sudo vim /etc/apt/sources.list

输入如下内容

deb https://mirrors.geekpie.club/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.geekpie.club/ubuntu-ports/ bionic main main restricted universe multiverse
deb https://mirrors.geekpie.club/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.geekpie.club/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.geekpie.club/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.geekpie.club/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.geekpie.club/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.geekpie.club/ubuntu-ports/ bionic-security main restricted universe multiversesudo
  • 更新
sudo apt update
sudo apt upgrade -y
  • 安装依赖
# DNNDK C++环境需要google-glog
sudo apt install libgoogle-glog-dev -y
# DNNDK C++环境需要opencv3.1,3.3或3.4,但是ubuntu18.04默认的是opencv3.2,需要卸载掉opencv3.2才能继续安装
sudo apt remove libopencv-dev -y
# DNNDK安装Python环境需要pip
sudo apt install python-pip -y
# 目前DNNDK的Python API是基于Python2的,为了让jupyter notebook支持python2需要安装ipython kernel
sudo pip install ipykernel matplotlib==2.2.0 pillow -i https://pypi.tuna.tsinghua.edu.cn/simple 

安装DNNDK

mkdir rootfs
tar -xvf rootfs.tar.gz -C rootfs
mkdir -p /usr/local/lib
mkdir -p /usr/local/bin

# 手动将opencv3.3相关的库复制到/usr/lib下
sudo cp -r rootfs/usr/include/openc* /usr/include
sudo cp -d rootfs/usr/lib/libopencv* /usr/lib
sudo cp -d rootfs/usr/lib/libwebp* /usr/lib
sudo cp rootfs/usr/lib/pkgconfig/opencv.pc /usr/lib/pkgconfig

cd PYNQ-Z2
sudo chmod +x install.sh
sudo ./install.sh
sudo reboot

测试环境

cd PYNQ-Z2/samples/resnet50
make
cd model
gcc -fPIC -shared dpu_resnet50_0.elf -o libdpumodelresnet50.so
sudo cp libdpumodelresnet50.so /usr/lib
  • 4
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 19
    评论
评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值