We have run into a weird issue where we are unable to allocate more than 2GB of memory on 850M that has 4 GBs. Just to make sure that there is nothing wrong with our program, we wrote a small test app that keeps alloc’ing memory until it receives out of memory error. It works fine on Windows 8, however on Windows 7, it throws error after allocating 2 Gbs, and yet it shows it has 2 Gb free memory available. My question is why I am unable to allocate more than 2Gb memory on Windows 7? Another clue: I rolled back my driver and found out that I get this behavior starting from nvidia driver 352.86 all the way to the latest driver. On older drivers, it works like a charm even on Win 7.
If the driver’s behavior has changed between two driver revisions, you might want to file a bug. You have to be a member of nVidia’s registered CUDA developer program ( there’s no cost involved, just a a registration ).
This may be related to how the Windows Display Driver Model (WDDM) manages memory. I just find it odd that there has been a change between specific CUDA driver revisions.
Edit:cudaMemGetInfo(free,total) on an sm_52 device doesn’t seem to adjust the free count after a single very large allocation. Yet the free count is adjusted on the two sm_50 devices in my 358.50 + Win7/x64 system.
If this is acceptable behavior then the function’s description should probably spell this out.
@allanmac: This is what I am getting:
GeForce GTX 850M ( 5)
free/total (MB): 4011 / 4096
cudaMalloc (MB): 3755
free/total (MB): 4011 / 4096
There is a slight issue in the code. You are not checking for the return code of cudaMalloc call, in my case I am getting memory exception and therefore nothing was actually allocated. So the third line makes sense and is valid. I am quite sure that on your GTX 980, its the same, you are unable to allocate anything and hence the free/total memory stays the same. Please slightly adjust the code to see if you get error on cudaMalloc on GTX 980.