How to fix the error of NvAPI_EnumPhysicalGPUs

I would like to retrieve the GPU information using NVAPI. And I’m trying code based on samples.
But I’ve faced the following error when I use NvAPI_EnumPhysicalGPUs.
Error : NVAPI_NVIDIA_DEVICE_NOT_FOUND

I checked that my two GPU operate correctly by device manager.
And also I got the information of driver version by NvAPI_SYS_GetDriverAndBranchVersion.

How do I fix this error?

did you get the solved, i got the same problem, and i found that it can work correctly in driver 22.21.13.8253, after upgrade, the problem comes

did you get the solved, i got the same problem, and i found that it can work correctly in driver 22.21.13.8253, after upgrade, the problem comes