对56号GPU进行虚拟化,得到了id为132的vnpu

设置ASCEND_VISIBLE_DEVICES=132,133,134
运行如下程序:
[ACL ERROR] EE1001: [PID: 209] 2025-04-18-16:08:59.202.056 The argument is invalid.Reason: Set device failed, invalid device, set device=132, valid device range is [0, 3)
Solution: 1.Check the input parameter range of the function. 2.Check the function invocation relationship.
TraceBack (most recent call last):
rtSetDevice execute failed, reason=[device id error][FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:53]
open device 132 failed, runtime result = 107001.[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:161]
比如在此处我配置3个vnpu,他仅能调度[0,3)号设备,但vnpu_id限制取值范围为[phy_id*16 + 100, phy_id * 16+107],应该如何解决?
对56号GPU进行虚拟化,得到了id为132的vnpu
设置ASCEND_VISIBLE_DEVICES=132,133,134
运行如下程序:
#!/usr/bin/env python3 import os import sys from ais_bench.infer.interface import InferSession device_ids = [56, 132] model_path = "weights/resnet18_image_encoder_310P3_FP32.om" if len(sys.argv) > 1: model_path = sys.argv[1] print(f"当前环境变量: ASCEND_VISIBLE_DEVICES={os.environ.get('ASCEND_VISIBLE_DEVICES', '未设置')}") print(f"将尝试以下设备ID: {device_ids}") for device_id in device_ids: print(f"\n尝试使用设备ID: {device_id}") try: os.environ["ASCEND_VISIBLE_DEVICES"] = str(device_id) print(f"设置ASCEND_VISIBLE_DEVICES={device_id}") session = InferSession(device_id, model_path) print(f"成功使用设备ID {device_id} 加载模型!") break except Exception as e: print(f"使用设备ID {device_id} 失败: {e}") [ACL ERROR] EE1001: [PID: 209] 2025-04-18-16:08:59.202.056 The argument is invalid.Reason: Set device failed, invalid device, set device=132, valid device range is [0, 3)
Solution: 1.Check the input parameter range of the function. 2.Check the function invocation relationship.
TraceBack (most recent call last):
rtSetDevice execute failed, reason=[device id error][FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:53]
open device 132 failed, runtime result = 107001.[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:161]
比如在此处我配置3个vnpu,他仅能调度[0,3)号设备,但vnpu_id限制取值范围为[phy_id*16 + 100, phy_id * 16+107],应该如何解决?