一、软硬件信息
1. 服务器厂家:
Shanghai UDH Technologies Co., Ltd.
XRS302
- 沐曦 GPU 型号:
MetaX C500
PCI BDF: 0000:41:00.0
GPU 数量: 1 -
操作系统内核版本:
Linux localhost.localdomain 4.19.90-24.4.v2101.ky10.x86_64 #1 SMP Mon May 24 12:14:55 CST 2021 x86_64 x86_64 x86_64 GNU/Linux -
是否开启 CPU 虚拟化:
虚拟化: VT-x -
mx-smi 回显:
mx-smi version: 2.3.4
Attached GPUs: 1
GPU#0 MXC500 0000:41:00.0
MACA: 3.8.1.3
BIOS: 1.25.1.10
KMD: 3.9.6
SMP0: 1.25.1.10
SMP1: 1.25.1.10
CCX0: 1.35.0.0
CCX1: 1.35.0.0
CCX2: 1.35.0.0
VR0: 0.13.0.5
VR1: 0.13.0.5
MCU: 1.2.6.0
6. docker info 回显:
目前已知 docker version:
Docker Client: 20.10.24
Docker Engine: 20.10.24
OS/Arch: linux/amd64
docker info:
Client:
Context: default
Debug Mode: false
Server:
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 2
Server Version: 20.10.24
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2
Default Runtime: runc
Init Binary: docker-init
containerd version: 2806fc1057397dbaeefbea0e4e17bddfbd388f38
runc version:
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 4.19.90-24.4.v2101.ky10.x86_64
Operating System: Kylin Linux Advanced Server V10 (Sword)
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 250.6GiB
Name: localhost.localdomain
ID: XRGJ:QUBP:O5A7:W2TB:DYTX:4MV2:6LY6:XJI2:JIQM:34DC:3K57:XM6M
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
WARNING: IPv4 forwarding is disabled
7. 镜像版本:
cr.metax-tech.com/public-library/maca:3.8.1.2-kylinv11-amd64
注意:宿主机是麒麟 V10,但镜像标签包含 kylinv11,请 MetaX 确认该镜像是否支持当前麒麟 V10 环境。
8. 启动容器命令:
docker run -it \
--name maca381-profiler \
--privileged \
--network host \
--ipc host \
-v /dev:/dev \
-v /sys:/sys:ro \
-v /run:/run \
-v /var/log/mxvs:/var/log/mxvs \
-v /root/mxlog:/root/mxlog \
-v /home/lijl/桌面/linux-perf-kit-3.8.1.3:/opt/linux-perf-kit \
cr.metax-tech.com/public-library/maca:3.8.1.2-kylinv11-amd64 \
bash
9. 容器内执行命令:
export MACA_ROOT=/opt/maca
export MACA_PATH=/opt/maca
export MACA_ETC_PATH=/opt/maca/etc
export PATH=/opt/maca/bin:/opt/maca/mxgpu_llvm/bin:$PATH
export LD_LIBRARY_PATH=/opt/maca/lib:/opt/maca/lib64
readlink -f /opt/maca
mx-smi --show-version
cd /opt/linux-perf-kit/mcProfiler-ubuntu18.04
chmod +x mcProfiler profiler_server
./mcProfiler perf_exec \
--cmdline "mxvs stress --xcore --duration=00:01" \
--kernelname stress \
--casename maca381_docker_test \
--cwd /root \
--metrics "Total Cycles" \
--host 127.0.0.1 \
--port 50124
二、问题现象
在 MACA 3.8.1 Docker 容器中,C500 可以正常识别,mxvs stress 可以运行,但 mcProfiler 无法获取性能计数器数据。
Profiler 日志报错:
Access perfcount channel failed!
submit configsPerfCounter ret: 800!
config perf counter fail
mcProfiler config failed!
Profile is not available, Do not register profile services!
客户端报错:
MctxStreamProfilerCountDataGet Error
status = StatusCode.UNIMPLEMENTED
宿主机 dmesg 报错:
failed to alloc all perfcounter, block_type:0
failed to alloc all type 0 of perfcounter, slot:ffff, pasid:8000
block_id 255 block 0 failed, -16
failed to alloc all perfcounter, block_type:0
failed to alloc all type 0 of perfcounter, slot:8000ffff, pasid:8001
block_id 255 block 0 failed, -16
其中 -16 是 Linux EBUSY,表示性能计数器资源无法分配或处于忙状态。
同时,stress 本身可以执行:
GPU#0 MXC500 ... Available
xcore ... OK
XCORE 100 %
errors: 0
mcModuleLaunchKernel successed, ret = 0
stress 算力表现
C500 计算功能正常;
stress 可以运行;
Profiler 性能计数器分配失败;
MctxStreamProfilerCountDataGet 返回 UNIMPLEMENTED;
Profiler 未生成有效性能指标报告。
像是两个 profiler 相关进程或 GPU 上下文发生了时间重叠:
- 已提供的 UMD 文件对应 PID 87,日志中还有 /shm_snapshot_87。
- PID 87 一直运行到 13:57:02。
- 13:56:08 又出现新的 pasid:8001 分配失败。
- 最终 mcProfiler 明确要求检查另一个文件 umd.135.*log(该文件实际不存在)。操作记录.txt (line 311)
因此,很可能是 PID 87 尚未释放计数器时,PID 135 又尝试申请。但这不一定是用户手工启动了两个 mcProfiler,也可能是单次 perf_exec 内部的目标进程、重试或批次调度发生重叠。
另外还有一条不能忽略的独立故障:本次运行出现了 StatusCode.UNIMPLEMENTED,连接的是端口 39975,而 PID 87 的 UMD server 监听 36081。操作记录.txt (line 248) 这可能表示多目标实例、残留 server,或者客户端/服务端协议不匹配;单纯的性能计数器争抢不能解释它。
两个进程都继承了同一套 profiler 环境。
PID 17443 mxvs stress PPID=1
PID 17446 python .../mxvs stress PPID=17440
上传以下原始附件: