From bc029b599a9e335e05cfbdfc6b95e311274614a2 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Fri, 18 Sep 2026 11:22:22 +0800 Subject: [PATCH] fix(ascend): inject the driver tree whole, for the tool that answers device addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The three driver subdirectories carry the libraries and the topology file but not hccn_tool, and a transport building Device RoCE endpoints reads each NPU's NIC address through it: a container holding the libraries without the tool cannot open that transport at all, and every process that does dies at startup reporting a device-ip lookup. /etc/hccn.conf, added for the same reason, is the other place those addresses can be read from — but only on a host that keeps them there, while the tool answers from the driver on every host that has one. The wider mount covers both cases with one entry and matches what the Kubernetes chart and the worker's own container already mount. The driver belongs to the host on every Ascend containerization path, the image supplying the toolkit, so injecting more of it shadows nothing a container ships with. --- gpustack_runtime/deployer/cdi/ascend.py | 27 +++++++++++-------- .../deployer/test_ascend_ranktable.py | 4 +-- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/gpustack_runtime/deployer/cdi/ascend.py b/gpustack_runtime/deployer/cdi/ascend.py index da33483..ebbadd3 100644 --- a/gpustack_runtime/deployer/cdi/ascend.py +++ b/gpustack_runtime/deployer/cdi/ascend.py @@ -43,14 +43,22 @@ https://gitcode.com/Ascend/mind-cluster/blob/master/docs/en/scheduling/references/appendix.md. """ -_HCCN_CONF_PATH = "/etc/hccn.conf" +_ASCEND_DRIVER_PATH = "/usr/local/Ascend/driver" """ -The device NIC addresses, as configured on the host. A transport that builds -RoCE endpoints reads them from this file or from hccn_tool, which lives in a -driver directory none of the mounts below covers; without either, the engine -fails to initialize with "Failed to get device ip from hccn.conf and -hccn_tool". A container that talks to another node over Device RoCE therefore -needs this file, and one that does not is unaffected by its presence. +The host driver tree, injected whole rather than as the three subdirectories +the libraries and the topology file sit in. + +What the wider mount adds is hccn_tool: a transport that builds Device RoCE +endpoints reads each NPU's NIC address through it, and a container holding the +driver libraries but not the tool cannot open that transport at all -- it +fails with "Failed to get device ip from hccn.conf and hccn_tool" and every +process that opens it dies at startup. Reading the addresses out of +/etc/hccn.conf instead works too, but only on a host that keeps them there, +while the tool answers from the driver on every host that has one. + +The driver belongs to the host on every Ascend containerization path -- the +image supplies the toolkit -- so injecting more of it shadows nothing a +container ships with its own image. """ _A5_RANKTABLE_VERSION = "2.0" @@ -170,10 +178,7 @@ def generate( mount_paths = [ _HCCL_RANKTABLE_PATH, - _HCCN_CONF_PATH, - "/usr/local/Ascend/driver/topo", - "/usr/local/Ascend/driver/lib64", - "/usr/local/Ascend/driver/include", + _ASCEND_DRIVER_PATH, "/usr/local/dcmi", "/usr/local/bin/npu-smi", "/var/queue_schedule", diff --git a/tests/gpustack_runtime/deployer/test_ascend_ranktable.py b/tests/gpustack_runtime/deployer/test_ascend_ranktable.py index abbd7d0..2c25dfe 100644 --- a/tests/gpustack_runtime/deployer/test_ascend_ranktable.py +++ b/tests/gpustack_runtime/deployer/test_ascend_ranktable.py @@ -79,9 +79,7 @@ def test_a5_omits_the_host_ranktable(): targets = _mount_targets(cfg) assert cdi_ascend._HCCL_RANKTABLE_PATH not in targets # The rest of the vendor's named list is untouched. - assert "/usr/local/Ascend/driver/topo" in targets - assert "/usr/local/Ascend/driver/lib64" in targets - assert "/usr/local/Ascend/driver/include" in targets + assert cdi_ascend._ASCEND_DRIVER_PATH in targets assert "/usr/local/dcmi" in targets assert "/usr/local/bin/npu-smi" in targets