Why isn’t it giving me an accurate figure for total memory? Additionally if I put this at different points in my codebase, I get an accurate total memory, but inaccurate free memory value, other times it just gives me an “unspecified driver error” when I try and call this function.
Any ideas why this particular function might be so problematic? (or if anyone can confirm this by running this simple test?) I’m using the new Fermi Tesla, but my second device is an FX4800 which sees the same problems. I’m on linux running the 195.36.24 NVidia driver and have rebooted my machine since upgrading to this driver.
I filed a bug report for this issue last week. It should be fixed in the 3.1 release.
From my testing, it looks like the most-significant bytes of the size_t variables ‘free’ and ‘total’ are not being set by the cudaMemGetInfo call. As a workaround, you could try initializing ‘total’ and ‘free’ to 0 before calling cudaMemGetInfo.