I bumped on a problem using cuDeviceGetTotalMem with my C2050.
Instead of showing 3181969408 bytes, it shows -1112997888.
I’m using a ‘long’ value, natives uses a long value, so it should not come from this part. And when using cuDeviceGetTotalMem with CUDA Driver API in C, i get the right value so it should not be a driver problem.
I don’t have a >2GB card, so can not reproduce it for now. The API changes in CUDA 3.2 (and JCuda) had been mainly targeting exactly this issue: The memory size did not fit into an ‘unsigned int’.
If I remember correctly, there once was small bug somewhere in the native part, which could cause this issue. But in the current source it has already been fixed.
The only explaination for me now is that the native lib you are using was not yet updated accordingly. On which Operating System and architecture (32/64bit) does this happen?
If it is urgent, you may use this workaround to obtain the correct size
long size = -1112997888L;
if (size < 0)
{
size -= (long)Integer.MIN_VALUE*2L;
}
At least until I can figure out what causes this error and/or until I can provide an updated native library.
I’m using Windows x64 binaries (under Windows 7 x64) and i grabbed the last version hosted on your website.
Thank you for you patch because i just did a quick calculation and did not find out that it was only a matter of integer limitation… I may be a bit tired. -_-
Anyway, if i can run some tests for you that could help, please ask.
I’ll try to build an updated version of the native driver lib ASAP, and write you a PM - maybe you can test it then, to see whether it’s already fixed or whether it has a different reason.
OK, I had the chance to re-run the compilation on a 64bit machine, and found the reason for the bug (it even prints a Warning, I don’t know how I could overlook this). Some minor modifications will be required, I’ll try to upload an updated version early next week.