目录
1. 简介
2. 单核性能对比
2.1 PassMark
2.2 geekbench
2.3 CPU-7
2.4 选择 UM790 pro
3. Ubuntu 22.04 物理机
3.1 安装 Ubuntu 22.04
3.2 安装 Vitis 2022.1
3.3 缺点
4. Ubuntu 20.04 物理机
4.1 安装 Ubuntu 20.04
4.2 实用命令
4.2.1 SSH 保持活跃
4.2.2 文件管理器
4.2.3 控制中心
4.2.4 磁盘管理器
4.2.5 打开默认浏览器
4.2.6 系统监视器
4.2.7 终端
4.3 安装 Jupyter Lab
4.3.1 下载 Anaconda
4.3.2 执行安装
4.3.3 直接运行 JupyterLab
4.3.4 后台运行 JupyterLab
4.3.5 使用配置文件
5. 性能测试
6. 总结
1. 简介
选购一款专用于 Vitis 和 Vivado 开发的主机,Vivado 的编译速度很大程度上取决于 CPU 的单核性能,尤其是在布线和综合阶段,最终选择一款迷你主机,不考虑使用独显,核性数一般即可。
按照 Single Thread Performance 对比即可,挑选一款最佳性价比产品。
对比 Ubuntu 22.04 和 Ubuntu 20.04 运行 Vivado 的兼容性。
2. 单核性能对比
2.1 PassMark
PassMark CPU Benchmarks - Single Thread Performancehttps://www.cpubenchmark.net/singleThread.html
Intel i5-10500 CPU @ 3.10GHz Tb 4.5GHz:Not on the list
Intel i7-1165G7 CPU @2.80GHz Tb 4.7GHz:Not on the list
Intel i7-11800H CPU @ 2.30GHz Tb 4.6GHz:Not on the list
Intel i7-13700 CPU @ 2.10GHz Tb 5.2GHz:4116
AMD R9 7940HS @ 4.0GHz Tb 5.2GHz:3956
Intel i9-14900K CPU @ 3.2GHz Tb 6GHz:4732
2.2 geekbench
Processor Benchmarks - Geekbenchhttps://browser.geekbench.com/processor-benchmarks
Intel i5-10500 CPU @ 3.10GHz Tb 4.5GHz:1526
Intel i7-1165G7 CPU @2.80GHz Tb 4.7GHz:1740
Intel i7-11800H CPU @ 2.30GHz Tb 4.6GHz:1900
Intel i7-13700 CPU @ 2.10GHz Tb 5.2GHz:2653
AMD R9 7940HS @ 4.0GHz Tb 5.2GHz:2460
Intel i9-14900K CPU @ 3.2GHz Tb 6GHz:3079
2.3 CPU-7
单核性能排名CPU天梯图,包含Intel Core2, Intel Core2 Quad和AMD Phenom四核处理器,ZHAOXIN-cpu7网比较了具有多个内核的Intel Xeon CPU,Intel Core i7 / i9 CPU,AMD Ryzen / Threadripper CPU和AMD Epyc的性能。英特尔(Intel)处理器与AMD芯片-找出最适合您的新游戏平台或服务器的CPU性能!完整cpu天梯图https://www.cpu7.com/single/thread.html
Intel i5-10500 CPU @ 3.10GHz Tb 4.5GHz:2765
Intel i7-1165G7 CPU @2.80GHz Tb 4.7GHz:2828
Intel i7-11800H CPU @ 2.30GHz Tb 4.6GHz:3091
Intel i7-13700 CPU @ 2.10GHz Tb 5.2GHz:4143
AMD R9 7940HS CPU @ 4.0GHz Tb 5.2GHz:4013
Intel i9-14900K CPU @ 3.2GHz Tb 6GHz:4780
2.4 选择 UM790 pro
我选择的配置:
- AMD R9 7940HS
- 32G DDR5-5600
- 1TB M2-2280 PCIE4.0
图片来自铭凡官网。
3. Ubuntu 22.04 物理机
3.1 安装 Ubuntu 22.04
1)安装 Ubuntu 22.04
安装 Ubuntu 后,首先安装 SSH,并设置好 IP 地址,后续要用到。
sudo apt update
sudo apt install openssh-server
2)upgrade
sudo apt update
sudo apt upgrade
3)解决黑屏
运行 upgrade 后,重启会出现显示器黑屏的情况,但可以 ping 通,也可以通过 SSH 连接。风扇似乎也在全速运行。
sudo nano /etc/default/grub
找到对应位置,添加如下内容:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset" // 这里添加 nomodeset
GRUB_CMDLINE_LINUX="rw" //这里需要填写为rw
使 grub 配置生效,并重启:
sudo update-grub
sudo reboot
3.2 安装 Vitis 2022.1
1)安装必要的库
sudo apt install libncurses5
运行 AppImage 格式的应用程序需要安装如下库:
sudo apt install libfuse2
2)修改 /opt 权限
sudo chmod 777 /opt
3)运行安装程序
./xsetup
如果跳过了 3.1-(4),虽然安装过程不会报错,但是运行 vivado,则会报错:
>> vivado
---
application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory
4)安装 JTAG 驱动
cd /opt/Xilinx/Vivado/2022.1/data/xicom/cable_drivers/lin64/install_script/install_drivers/
sudo ./install_drivers.sh
3.3 缺点
无法安装 xrt 2022.1,导致不能使用无法运行自定义 DPU Overlay。
放弃 Ubuntu 22.04 + Vivado 2022.1 组合。
4. Ubuntu 20.04 物理机
4.1 安装 Ubuntu 20.04
步骤和 Ubuntu 22.04 一致,无需解决黑屏问题。
参考如下博客安装:
Vitis AI 基础配置(安装VMware+ubuntu 20.04+必要软件)_vitis ai安装-CSDN博客
4.2 实用命令
在 MobaXTerm 的 SSH 中,直接运行如下命令,可实现 X11 转发,在 Windows 窗口中直接显示 Ubuntu 20.04 的内容,非常方便。
4.2.1 SSH 保持活跃
Settings -> Configuration -> SSH
4.2.2 文件管理器
>> nautilus
直接打开了最大化的页面,而且无法修改窗口大小。
4.2.3 控制中心
>> gnome-control-center
4.2.4 磁盘管理器
>> gnome-disks
4.2.5 打开默认浏览器
>> gnome-www-browser
4.2.6 系统监视器
>> gnome-system-monitor
4.2.7 终端
>> gnome-terminal
4.3 安装 Jupyter Lab
4.3.1 下载 Anaconda
1)打开官网
2)跳过注册
3)下载对应版本
4.3.2 执行安装
./Anaconda3-2024.10-1-Linux-x86_64.sh
1)安装过程中,有三处需要介入:
- 同意协议
- 安装路径:/opt/anaconda3
- no:手动控制环境的激活
2)可以在后续通过命令配置 Conda:
>> cd /opt/anaconda3/bin/
>> ./conda init bash
3)取消配置 Conda:
conda init --reverse
4.3.3 直接运行 JupyterLab
jupyter lab --no-browser --port 8888 --ip 192.168.1.23jupyter lab --no-browser --port 8888 --ip 192.168.137.3
- --ip 0.0.0.0 非常重要,jupyter lab 运行在服务器上并且需要从本地计算机访问 JupyterLab。
- localhost 或 127.0.0.1 只允许从服务器本身访问。
可从下面找到入口地址:
[C 2024-12-24 21:04:03.619 ServerApp]To access the server, open this file in a browser:file:///home/dd/.local/share/jupyter/runtime/jpserver-24343-open.htmlOr copy and paste one of these URLs:http://192.168.1.23:8888/lab?token=12331cf760b687e788e9100aac28fbb84517b2e30a3eee57http://127.0.0.1:8888/lab?token=12331cf760b687e788e9100aac28fbb84517b2e30a3eee57
4.3.4 后台运行 JupyterLab
nohup jupyter lab --no-browser &
- nohup 命令使进程忽略挂断信号,即使终端关闭也能继续运行。
- & 符号将进程放到后台运行。
运行此命令后,你可能会看到一个输出,例如 [1] 12345,其中 12345 是进程 ID (PID)。
要停止后台运行的 JupyterLab,你需要找到其进程 ID (PID),然后使用 kill 命令。
或者,可以使用 pkill 命令直接按进程名杀死进程:
pkill jupyter
4.3.5 使用配置文件
对于更高级的配置,你可以创建一个 Jupyter 配置文件。
1)生成配置文件:
jupyter lab --generate-config
这将在 ~/.jupyter/jupyter_lab_config.py 创建一个配置文件。
2)编辑配置文件:
打开 ~/.jupyter/jupyter_lab_config.py 并修改以下设置:
c.ServerApp.open_browser = False # 禁止自动打开浏览器
c.ServerApp.port = 8888 # 设置端口(可选)
c.ServerApp.ip = '0.0.0.0' # 设置IP地址(可选,允许远程访问)
然后,你可以简单地使用 jupyter lab 命令启动 JupyterLab,它将使用配置文件中的设置。
5. 性能测试
使用官方脚本,构建一个 DPU 工程。
CPU 大部分时间都是单核在在拉满,其余核心都在等待。
用时统计时如下:
[23:43:11] Run vpl: Step create_project: Started
Creating Vivado project.
[23:43:14] Run vpl: Step create_project: Completed
[23:43:14] Run vpl: Step create_bd: Started
[23:43:18] Run vpl: Step create_bd: Completed
[23:43:18] Run vpl: Step update_bd: Started
[23:43:18] Run vpl: Step update_bd: Completed
[23:43:18] Run vpl: Step generate_target: Started
[23:43:36] Run vpl: Step generate_target: Completed
[23:43:36] Run vpl: Step config_hw_runs: Started
[23:43:38] Run vpl: Step config_hw_runs: Completed
[23:43:38] Run vpl: Step synth: Started
[23:44:08] Block-level synthesis in progress, 0 of 20 jobs complete, 8 jobs running.
[23:44:38] Block-level synthesis in progress, 7 of 20 jobs complete, 8 jobs running.
[23:45:08] Block-level synthesis in progress, 15 of 20 jobs complete, 5 jobs running.
[23:45:38] Block-level synthesis in progress, 19 of 20 jobs complete, 1 job running.
[23:46:08] Block-level synthesis in progress, 19 of 20 jobs complete, 1 job running.
[23:46:38] Block-level synthesis in progress, 19 of 20 jobs complete, 1 job running.
[23:47:08] Block-level synthesis in progress, 19 of 20 jobs complete, 1 job running.
[23:47:38] Block-level synthesis in progress, 19 of 20 jobs complete, 1 job running.
[23:48:09] Block-level synthesis in progress, 19 of 20 jobs complete, 1 job running.
[23:48:39] Block-level synthesis in progress, 19 of 20 jobs complete, 1 job running.
[23:49:09] Block-level synthesis in progress, 19 of 20 jobs complete, 1 job running.
[23:49:39] Block-level synthesis in progress, 20 of 20 jobs complete, 0 jobs running.
[23:50:09] Run vpl: Step synth: Completed
[23:50:09] Run vpl: Step impl: Started
[23:51:10] Finished 2nd of 6 tasks (FPGA linking synthesized kernels to platform). Elapsed time: 00h 08m 02s[23:51:10] Starting logic optimization..
[23:51:40] Phase 1 Retarget
[23:51:40] Phase 2 Constant propagation
[23:51:40] Phase 3 Sweep
[23:51:40] Phase 4 BUFG optimization
[23:51:40] Phase 5 Shift Register Optimization
[23:51:40] Phase 6 Post Processing Netlist
[23:52:10] Finished 3rd of 6 tasks (FPGA logic optimization). Elapsed time: 00h 01m 00s[23:52:10] Starting logic placement..
[23:52:10] Phase 1 Placer Initialization
[23:52:10] Phase 1.1 Placer Initialization Netlist Sorting
[23:52:10] Phase 1.2 IO Placement/ Clock Placement/ Build Placer Device
[23:52:10] Phase 1.3 Build Placer Netlist Model
[23:52:40] Phase 1.4 Constrain Clocks/Macros
[23:52:40] Phase 2 Global Placement
[23:52:40] Phase 2.1 Floorplanning
[23:52:40] Phase 2.1.1 Partition Driven Placement
[23:52:40] Phase 2.1.1.1 PBP: Partition Driven Placement
[23:53:10] Phase 2.1.1.2 PBP: Clock Region Placement
[23:53:10] Phase 2.1.1.3 PBP: Discrete Incremental
[23:53:10] Phase 2.1.1.4 PBP: Compute Congestion
[23:53:10] Phase 2.1.1.5 PBP: Macro Placement
[23:53:10] Phase 2.1.1.6 PBP: UpdateTiming
[23:53:10] Phase 2.1.1.7 PBP: Add part constraints
[23:53:10] Phase 2.2 Update Timing before SLR Path Opt
[23:53:10] Phase 2.3 Post-Processing in Floorplanning
[23:53:10] Phase 2.4 Global Placement Core
[23:54:10] Phase 2.4.1 Physical Synthesis In Placer
[23:54:41] Phase 3 Detail Placement
[23:54:41] Phase 3.1 Commit Multi Column Macros
[23:54:41] Phase 3.2 Commit Most Macros & LUTRAMs
[23:54:41] Phase 3.3 Small Shape DP
[23:54:41] Phase 3.3.1 Small Shape Clustering
[23:54:41] Phase 3.3.2 Flow Legalize Slice Clusters
[23:54:41] Phase 3.3.3 Slice Area Swap
[23:54:41] Phase 3.3.3.1 Slice Area Swap Initial
[23:55:11] Phase 3.4 Re-assign LUT pins
[23:55:11] Phase 3.5 Pipeline Register Optimization
[23:55:11] Phase 3.6 Fast Optimization
[23:55:11] Phase 4 Post Placement Optimization and Clean-Up
[23:55:11] Phase 4.1 Post Commit Optimization
[23:55:41] Phase 4.1.1 Post Placement Optimization
[23:55:41] Phase 4.1.1.1 BUFG Insertion
[23:55:41] Phase 1 Physical Synthesis Initialization
[23:55:41] Phase 4.1.1.2 Post Placement Timing Optimization
[23:56:11] Phase 4.2 Post Placement Cleanup
[23:56:11] Phase 4.3 Placer Reporting
[23:56:11] Phase 4.3.1 Print Estimated Congestion
[23:56:11] Phase 4.4 Final Placement Cleanup
[23:57:11] Finished 4th of 6 tasks (FPGA logic placement). Elapsed time: 00h 05m 00s[23:57:11] Starting logic routing..
[23:57:11] Phase 1 Build RT Design
[23:57:11] Phase 2 Router Initialization
[23:57:11] Phase 2.1 Fix Topology Constraints
[23:57:11] Phase 2.2 Pre Route Cleanup
[23:57:11] Phase 2.3 Global Clock Net Routing
[23:57:11] Phase 2.4 Update Timing
[23:57:41] Phase 3 Initial Routing
[23:57:41] Phase 3.1 Global Routing
[23:58:11] Phase 4 Rip-up And Reroute
[23:58:11] Phase 4.1 Global Iteration 0
[00:09:43] Phase 4.2 Global Iteration 1
[00:10:13] Phase 4.3 Global Iteration 2
[00:10:43] Phase 5 Delay and Skew Optimization
[00:10:43] Phase 5.1 Delay CleanUp
[00:10:43] Phase 5.1.1 Update Timing
[00:10:43] Phase 5.2 Clock Skew Optimization
[00:10:43] Phase 6 Post Hold Fix
[00:10:43] Phase 6.1 Hold Fix Iter
[00:10:43] Phase 6.1.1 Update Timing
[00:10:43] Phase 7 Route finalize
[00:10:43] Phase 8 Verifying routed nets
[00:10:43] Phase 9 Depositing Routes
[00:11:14] Phase 10 Resolve XTalk
[00:11:14] Phase 11 Route finalize
[00:11:14] Phase 12 Post Router Timing
[00:11:14] Finished 5th of 6 tasks (FPGA routing). Elapsed time: 00h 14m 02s
6. 总结
尝试安装 Ubuntu 22.04,发现运行 Xilinx 有些工具有兼容性问题。故而放弃。
使用 Ubuntu 20.04 最为保险,可以通过 X11 转发实现大部分远程功能。
简单测试,后续补充更多内容。