cudaDeviceProp.totalGlobalMem returns 0, why??

I have two GTX1070 gpu cards running in SLI mode.

I have written a simple program to check the device information. The value of cudaDeviceProp.totalGlobalMem is 0 but other infomation from cudaDeviceProp is correct, which makes me very confused.

Who can help me identify the cause of the problem? Thanks very much!

maybe you are using the wrong variable type (e.g. int instead of size_t). Study the CUDA sample code deviceQuery