```
[root@b9feba924e07 finetune]# python device.py
DrvMngGetConsoleLogLevel failed. (g_conLogLevel=3)
[ERROR] ATRACE(1409,python):2025-08-20-06:20:11.265.654 [trace_driver_api.c:56](tid:1409) get platform info failed, drvErr=87.
[EVENT] PROFILING(1409,python):2025-08-20-06:20:11.269.368 [msprof_callback_impl.cpp:358] >>> (tid:1409) Started to register profiling ctrl callback.
[EVENT] PROFILING(1409,python):2025-08-20-06:20:11.269.662 [msprof_callback_impl.cpp:365] >>> (tid:1409) Started to register profiling hash id callback.
[INFO] PROFILING(1409,python):2025-08-20-06:20:11.269.746 [prof_atls_plugin.cpp:117] (tid:1409) RegisterProfileCallback, callback type is 7
[EVENT] PROFILING(1409,python):2025-08-20-06:20:11.269.815 [msprof_callback_impl.cpp:372] >>> (tid:1409) Started to register profiling enable host freq callback.
[INFO] PROFILING(1409,python):2025-08-20-06:20:11.269.881 [prof_atls_plugin.cpp:117] (tid:1409) RegisterProfileCallback, callback type is 8
[INFO] RUNTIME(1409,python):2025-08-20-06:20:11.272.021 [task_fail_callback_data_manager.cc:58] 1409 TaskFailCallBackManager: Constructor.
[INFO] HCCL(1409,python):2025-08-20-06:20:11.343.120 [adapter_rts.cc:2720] [1409][adapter_rts.cc][CallBackInitRts] g_deviceType [6] g_deviceLogicId [-1] g_devicePhyId [-1]
[INFO] PROFILING(1409,python):2025-08-20-06:20:11.795.995 [prof_atls_plugin.cpp:210] (tid:1409) Module[0] register callback of ctrl handle.
[INFO] PROFILING(1409,python):2025-08-20-06:20:11.935.496 [prof_atls_plugin.cpp:210] (tid:1409) Module[61] register callback of ctrl handle.
/usr/local/python3.10.17/lib/python3.10/site-packages/torch_npu/npu/__init__.py:371: UserWarning: Can't get ascend_hal device count
warnings.warn("Can't get ascend_hal device count")
[ERROR] RUNTIME(1409,python):2025-08-20-06:20:12.011.311 [runtime_keeper.cc:66]1409 GetDeviceType:Call halGetDeviceInfo failed: drvRet=87, module type=0, info type=1.
[INFO] RUNTIME(1409,python):2025-08-20-06:20:12.015.229 [runtime_keeper.cc:149] 1409 CreateRuntimeImpl: Open libruntime_v100.so success
[ERROR] RUNTIME(1409,python):2025-08-20-06:20:12.050.017 [runtime.cc:1380]1409 CheckHaveDevice:Call halGetDeviceInfo failed: drvRet=87, module type=0, info type=1.
[INFO] PROFILING(1409,python):2025-08-20-06:20:12.050.812 [prof_atls_plugin.cpp:210] (tid:1409) Module[7] register callback of ctrl handle.
[ERROR] RUNTIME(1409,python):2025-08-20-06:20:12.051.003 [driver.cc:65]1409 GetDeviceCount:Call drvGetDevNum, drvRetCode=87.
[ERROR] RUNTIME(1409,python):2025-08-20-06:20:12.051.116 [api_c_device.cc:23]1409 rtGetDeviceCount:ErrCode=507899, desc=[driver error:internal error], InnerCode=0x7020010
[ERROR] RUNTIME(1409,python):2025-08-20-06:20:12.051.187 [error_message_manage.cc:53]1409 FuncErrorReason:report error module_type=3, module_name=EE8888
[ERROR] RUNTIME(1409,python):2025-08-20-06:20:12.051.257 [error_message_manage.cc:53]1409 FuncErrorReason:rtGetDeviceCount execute failed, reason=[driver error:internal error]
[ERROR] ASCENDCL(1409,python):2025-08-20-06:20:12.051.369 [device.cpp:341]1409 aclrtGetDeviceCount: get device count failed, runtime result = 507899.
[INFO] RUNTIME(1409,python):2025-08-20-06:20:12.052.006 [api_impl.cc:7464] 1409 PeekLastErr: level=0 err=507899.
[ERROR] APP(1409,python):2025-08-20-06:20:12.052.092 [log_inner.cpp:76]1409 build/CMakeFiles/torch_npu.dir/compiler_depend.ts:device_count:27: "[PTA]:"get device count of NPU failed""
NPU设备不可用!
[INFO] RUNTIME(1409,python):2025-08-20-06:20:13.126.055 [runtime.cc:1540] 1409 ~Runtime: deconstruct runtime
[INFO] RUNTIME(1409,python):2025-08-20-06:20:13.149.326 [runtime.cc:1547] 1409 ~Runtime: wait monitor success, use=0.
[INFO] RUNTIME(1409,python):2025-08-20-06:20:13.171.425 [task_fail_callback_data_manager.cc:63] 1409 ~TaskFailCallBackManager: Destructor.
[root@b9feba924e07 finetune]# touch device2.py
[root@b9feba924e07 finetune]# vim device2.py
[root@b9feba924e07 finetune]# python device2.py
DrvMngGetConsoleLogLevel failed. (g_conLogLevel=3)
[ERROR] ATRACE(1477,python):2025-08-20-06:21:39.762.176 [trace_driver_api.c:56](tid:1477) get platform info failed, drvErr=87.
[EVENT] PROFILING(1477,python):2025-08-20-06:21:39.765.717 [msprof_callback_impl.cpp:358] >>> (tid:1477) Started to register profiling ctrl callback.
[EVENT] PROFILING(1477,python):2025-08-20-06:21:39.766.018 [msprof_callback_impl.cpp:365] >>> (tid:1477) Started to register profiling hash id callback.
[INFO] PROFILING(1477,python):2025-08-20-06:21:39.766.106 [prof_atls_plugin.cpp:117] (tid:1477) RegisterProfileCallback, callback type is 7
[EVENT] PROFILING(1477,python):2025-08-20-06:21:39.766.175 [msprof_callback_impl.cpp:372] >>> (tid:1477) Started to register profiling enable host freq callback.
[INFO] PROFILING(1477,python):2025-08-20-06:21:39.766.239 [prof_atls_plugin.cpp:117] (tid:1477) RegisterProfileCallback, callback type is 8
[INFO] RUNTIME(1477,python):2025-08-20-06:21:39.768.477 [task_fail_callback_data_manager.cc:58] 1477 TaskFailCallBackManager: Constructor.
[INFO] HCCL(1477,python):2025-08-20-06:21:39.838.567 [adapter_rts.cc:2720] [1477][adapter_rts.cc][CallBackInitRts] g_deviceType [6] g_deviceLogicId [-1] g_devicePhyId [-1]
[INFO] PROFILING(1477,python):2025-08-20-06:21:40.274.132 [prof_atls_plugin.cpp:210] (tid:1477) Module[0] register callback of ctrl handle.
[INFO] PROFILING(1477,python):2025-08-20-06:21:40.427.840 [prof_atls_plugin.cpp:210] (tid:1477) Module[61] register callback of ctrl handle.
2.5.1.post1.dev20250619
/usr/local/python3.10.17/lib/python3.10/site-packages/torch_npu/npu/__init__.py:371: UserWarning: Can't get ascend_hal device count
warnings.warn("Can't get ascend_hal device count")
[ERROR] RUNTIME(1477,python):2025-08-20-06:21:40.501.385 [runtime_keeper.cc:66]1477 GetDeviceType:Call halGetDeviceInfo failed: drvRet=87, module type=0, info type=1.
[INFO] RUNTIME(1477,python):2025-08-20-06:21:40.505.624 [runtime_keeper.cc:149] 1477 CreateRuntimeImpl: Open libruntime_v100.so success
[ERROR] RUNTIME(1477,python):2025-08-20-06:21:40.541.279 [runtime.cc:1380]1477 CheckHaveDevice:Call halGetDeviceInfo failed: drvRet=87, module type=0, info type=1.
[INFO] PROFILING(1477,python):2025-08-20-06:21:40.542.034 [prof_atls_plugin.cpp:210] (tid:1477) Module[7] register callback of ctrl handle.
[ERROR] RUNTIME(1477,python):2025-08-20-06:21:40.542.214 [driver.cc:65]1477 GetDeviceCount:Call drvGetDevNum, drvRetCode=87.
[ERROR] RUNTIME(1477,python):2025-08-20-06:21:40.542.313 [api_c_device.cc:23]1477 rtGetDeviceCount:ErrCode=507899, desc=[driver error:internal error], InnerCode=0x7020010
[ERROR] RUNTIME(1477,python):2025-08-20-06:21:40.542.384 [error_message_manage.cc:53]1477 FuncErrorReason:report error module_type=3, module_name=EE8888
[ERROR] RUNTIME(1477,python):2025-08-20-06:21:40.542.452 [error_message_manage.cc:53]1477 FuncErrorReason:rtGetDeviceCount execute failed, reason=[driver error:internal error]
[ERROR] ASCENDCL(1477,python):2025-08-20-06:21:40.542.554 [device.cpp:341]1477 aclrtGetDeviceCount: get device count failed, runtime result = 507899.
[INFO] RUNTIME(1477,python):2025-08-20-06:21:40.543.254 [api_impl.cc:7464] 1477 PeekLastErr: level=0 err=507899.
[ERROR] APP(1477,python):2025-08-20-06:21:40.543.337 [log_inner.cpp:76]1477 build/CMakeFiles/torch_npu.dir/compiler_depend.ts:device_count:27: "[PTA]:"get device count of NPU failed""
0
[INFO] RUNTIME(1477,python):2025-08-20-06:21:41.313.007 [runtime.cc:1540] 1477 ~Runtime: deconstruct runtime
[INFO] RUNTIME(1477,python):2025-08-20-06:21:41.336.892 [runtime.cc:1547] 1477 ~Runtime: wait monitor success, use=0.
[INFO] RUNTIME(1477,python):2025-08-20-06:21:41.368.796 [task_fail_callback_data_manager.cc:63] 1477 ~TaskFailCallBackManager: Destructor.
```
import torch_npu
print(torch_npu.__version__)
print(torch_npu.npu.device_count()) # 应该输出大于0的值
指定这段代码,报错如上