文件最后提交记录最后更新时间
1 个月前
1 个月前
README

Commands List

Query Commands

Setting Commands

Test Commands

hccn_tool Description

Overview

This document describes the external APIs of the cluster network tool hccn_tool, including APIs for querying the system NPU device information and port link status.

This document applies to the Atlas 350 accelerator card.

Deployment Scenario Description

  • If a specific deployment scenario is not mentioned in the command or API description within this document, it indicates that the product does not support that scenario, and no such support is currently planned.
  • In the "Support by Deployment Scenario" table in this document, Y means "supported", N means "not supported", and NA means "not applicable", indicating that the scenario is not planned.

Table 1 Deployment Scenario Definitions and Descriptions

Deployment Scenario

Sub-scenario

Description

Physical machine (PM)a

PM (bare metal)

NPUs run directly on PMs (bare metal).

PM + unprivileged container

Passthrough the physical server's NPU device into an unprivileged container for use.

PM + privileged container

Passthrough the physical server's NPU device into a privileged container for use.

Virtual machine (VM)b

VM passthrough

Dedicate an entire physical NPU for exclusive use by a single virtual machine. Supported passthrough modes include: full-system (all NPUs), partial (a subset of NPUs), and single-device (one NPU)

VM passthrough + unprivileged container

Allocate an entire physical NPU to a VM and then pass its resources through to an unprivileged container running inside that VM.

VM passthrough + privileged container

Allocate an entire physical NPU to a VM and then pass its resources through to a privileged container running inside that VM.

Ascend Virtual Instance (AVI)c

Physical machine + container-based AVI

On a PM, the npu-smi tool or DCMI is used to partition the NPU hardware resources into vNPUs based on user-defined requirements. The created vNPUs are then mounted to containers for use.

PM + VM-based AVI

On a PM, the npu-smi tool or DCMI is used to partition the NPU hardware resources into vNPUs based on user-defined requirements. The created vNPUs are then allocated to the VM for use. A single vNPU can be allocated to only one VM, but a single VM can be mounted with multiple vNPUs.

VM + container-based AVI

Partition the NPU hardware resources into vNPUs using the npu-smi tool or DCMI, based on user-defined requirements. Then allocate specified vNPUs to a VM, and mount the vNPUs to containers in the VM for use.

VM passthrough + container-based AVI

Allocate a single physical NPU entirely to a VM. Then, within that VM, the NPU is partitioned into vNPUs using the npu-smi tool or DCMI based on user-defined requirements. Finally, these vNPUs are passed through to containers for use.

a: Operating NPU resources in a PM environment, including two scenarios: PM and PM + container

b: Operating NPU resources in a VM environment, including two scenarios: VM passthrough and VM passthrough + containers

c: Use resource virtualization technology to partition one NPU into several virtual NPUs (vNPUs) for mounting to VMs or containers, allowing one NPU to handle multiple computing tasks simultaneously. AVI implements this through computing power allocation, enabling secure, multi-tenant resource pooling and on-demand management, which greatly reduces costs and complexity.

Usage Precautions

  • Before using this tool, ensure that the driver has been installed. hccn_tool is installed by default during driver installation. After the installation is complete, hccn_tool is stored in /usr/bin/ symbolic link. The actual path is /usr/local/Ascend/driver/tools.

  • If hccn_tool needs to be used in the container, mount /usr/bin/hccn_tool of the host machine to the container. For details, see "Installation and Uninstallation in a Container" > "Installation Scenarios" > "Host Directory Mounted to the Container" in the Atlas 350 Accelerator Card 25.7.RC1 NPU Driver and Firmware Installation Guide of the corresponding version.

  • hccn_tool does not support Ascend virtual instances.

  • Ascend 950 now provides significantly more NPU ports. However, the legacy hccn_tool can manage only a single port per NPU. It no longer meets the requirements. Therefore, based on network management objects, the next-generation hccn_tool has been reconstructed and optimized to manage multiple ports and network devices. Network management objects are indexed according to categories, as shown in Table 1.

    Table 1 Categories of network management objects

    Category

    Application Scenario

    Syntax

    Example

    NPU device

    Operations on a single NPU device (ignoring details such as its internal ports or UDie).

    hccn_tool -mode -cmd -i <dev_id> [-options]

    • -mode indicates the command mode. The value can be -g (query command), -s (setting command), or -t (test command).
    • -cmd indicates a main command word of an available command. For details, see the help information output in the corresponding mode.
    1. Run the npu-smi info command to obtain the NPU ID (that is, dev_id to be used in the following command).
    2. Run the hccn_tool -mode -cmd -i <dev_id> [-options] command.

      For example, to query NPU information, run the hccn_tool -g -dev_info -i <dev_id> command.

    NPU port

    Operations on a single port.

    hccn_tool -mode -cmd -i <dev_id> -u <udie_id> -p <port_id> [-options]

    1. Run the npu-smi info command to obtain the NPU ID (that is, dev_id to be used in the following command).
    2. Run the hccn_tool -g -dev_info -i <dev_id> command to obtain the UDie ID (udie_id) and port ID (port_id).
    3. Run the hccn_tool -mode -cmd -i <dev_id> -u <udie_id> -p <port_id> [-options] command.

      For example, to obtain the port link status, run the hccn_tool -g -link -i 0 -u 0 -p 4 command.

    Network device

    Operations on Ethernet and UB network devices.

    hccn_tool -mode -cmd -i <dev_id> -d <dev_name> [-options]

    1. Run the npu-smi info command to obtain the NPU ID (that is, dev_id to be used in the following command).
    2. Run the hccn_tool -g -dev_info -i <dev_id> command to obtain the interface name or name (dev_name). For details about the dev_name value, see the description of each command.
    3. Run the hccn_tool -mode -cmd -i <dev_id> -d <dev_name> [-options] command.

      For example, to query the resource quantity statistics list of a network device, run the hccn_tool -g -show_list -i <dev_id> -d <dev_name> command.

    All NPU devices

    Operations on all NPUs.

    hccn_tool -mode -cmd -all [-options]

    1. Run the hccn_tool -mode -cmd -all [-options] command.

      For example, to restore the configurations of all NPU devices, run the hccn_tool -s -cfg_recovery -all command.