本站点使用Cookies,继续浏览表示您同意我们使用Cookies。
Cookies和隐私政策>
浪潮信息致力于构建全球化的智慧计算生态,愿与合作伙伴从业务、资源、战略上全面聚合,共同推动客户数字化转型。
查找当地经销商联系方式或者提交需求表单与经销商联系沟通。
即时进行合作伙伴公司认证查询、学员认证证书查询,了解培训考试达标进展。
Linux OS下启用IOMMU功能后,OS下会联动打开ACS功能,导致设备通信性能下降甚至宕机
说明:
ACS(Access Control Services)访问控制服务:用于控制PCIe数据流向,ACS可以将peer-to-peer转发的功能关闭,强制将其下所有设备通信转发到RootComplex,导致设备间通信带宽降低。且在CPU端没有正确配置的情况下启用ACS会中断GPU Direct。
AMD平台带有Switch芯片的GPU机型
CentOS linux下的配置示例:
编辑grub文件,在GRUB_CMDLINE_LINUX选项下添加 amd_iommu=on iommu=pt。
示例:
#vim /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="amd_iommu=on iommu=pt"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
执行命令生成新的grub.cfg文件
grub2-mkconfig -o /boot/grub2/grub.cfg
# UEFI引导模式执行:
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
重启OS后检查IOMMU是否开启成功。
有输出则表示IOMMU开启成功;无输出则表示IOMMU功能未开启。
# 重启OS
reboot
# 匹配IOMMU关键字
dmesg|grep -i IOMMU
#开启成功示例:
[ 1.589058] pci 0000:66:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.589085] pci 0000:3b:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.589102] pci 0000:2a:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.589115] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.589144] pci 0000:f0:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.589169] pci 0000:c6:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.589192] pci 0000:ad:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.589211] pci 0000:7a:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.880060] pci 0000:66:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.880079] pci 0000:3b:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.880086] pci 0000:2a:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.880091] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.880096] pci 0000:f0:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.880101] pci 0000:c6:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.880106] pci 0000:ad:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.880111] pci 0000:7a:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.888800] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
[ 1.888866] perf/amd_iommu: Detected AMD IOMMU #1 (2 banks, 4 counters/bank).
[ 1.888905] perf/amd_iommu: Detected AMD IOMMU #2 (2 banks, 4 counters/bank).
[ 1.888948] perf/amd_iommu: Detected AMD IOMMU #3 (2 banks, 4 counters/bank).
[ 1.888993] perf/amd_iommu: Detected AMD IOMMU #4 (2 banks, 4 counters/bank).
[ 1.889046] perf/amd_iommu: Detected AMD IOMMU #5 (2 banks, 4 counters/bank).
[ 1.889091] perf/amd_iommu: Detected AMD IOMMU #6 (2 banks, 4 counters/bank).
[ 1.889129] perf/amd_iommu: Detected AMD IOMMU #7 (2 banks, 4 counters/bank).
1)OS下手动执行脚本,关闭ACS功能。
附:执行脚本
sh ACS_Disable.sh
2)完成开机自启动配置
vim /etc/rc.d/rc.local
# 在文件中添加一行, /file_path/ 替换为OS下脚本的绝对路径
bash /file_path/ACS_Disable.sh
# 赋予文件可执行权限
chmod +x /etc/rc.d/rc.local
# 若无/etc/rc.d/rc.local,也可编辑/etc/rc.local文件
vim /etc/rc.local
# 在文件中添加一行, /file_path/ 替换为OS下脚本的绝对路径
bash /file_path/ACS_Disable.sh
# 赋予文件可执行权限
chmod +x /etc/rc.local
完成配置后,建议重启OS 验证开机自启动配置是否生效。
ACS(Access Control Services)访问控制服务:用于控制PCIe数据流向,ACS可以将peer-to-peer转发的功能关闭,强制将其下所有设备通信转发到RootComplex,导致设备间通信带宽降低。且在CPU端没有正确配置的情况下启用ACS会中断GPU Direct。
Linux OS grub中配置amd_iommu=on、iommu=pt。运行脚本,关闭ACS功能,并将该脚本添加至Linux 开机自启动。
*免责声明:本案例只提供参考,不提供专业意见。
AIStore是基于元脑生态打造的商业协作线上平台,作为知识资源平台、交流服务平台和商机孵化平台,赋能“百模”与“千行”的对接,目前已上架200+产品和方案,在智能票据识别、AI工业质检、代码生成、视觉智能标注、AI健康助手等领域实现成功牵手和落地应用,助力千行百业加速AI产业创新,高效释放生产力。
扫码访问AIStore