when device memory gets full What happens when the device memory gets full and how much memory...

I am asking this here because I find both the Programming Guide and the SDK examples rather unclear on the subject.

  1. When device memory is full, any attempt to allocate memory on the device, such as cudaMalloc, returns 4 = CUDA_ERROR_DEINITIALIZED

  2. What is the actual quota of the device memory usable through CUDA? Is there any way to query for the available device memory?


  • GeForce 9800 GT with 512 MB
  • Cuda Toolkit & SDK 2.1, driver
  • under Windows XP SP2, Microsoft Visual C++ 2005
  • memory explicitly allocated on device ~ 70 MB
  • I find it hard to believe that:
    [ the implicitly allocated memory + a 3D desktop app + usual apps nothing fancy ]
    add up to the remainder of 512 MB of the graphics card.

Please share with me your views on the two matters.

Thank you.

  1. cuMemGetInfo() is usable from the runtime API even though it’s a driver API call. Make sure to include cuda.h and link with libcuda/nvcuda.dll to get that.

Thank you very much for your reply. That is very useful. :thumbup:

It turns out that 3D desktop app actually uses about 100 MB out of the device memory. Now I can investigate further on if the memory allocation in my app really goes the way i think it does. :ph34r:

soory for this noob question:
But how do I link with libcuda/nvcuda.dll? I even can’t find this dll on my computer.

Thanks in advance.

  • Quadro FX 3600M
  • Cuda Toolkit & SDK 2.1,
  • Driver 181.22 (notebook beta)
  • Windows Vista SP1,
  • Microsoft Visual Studio 2008

In Visual Studio, you should just be able to go to the project properties > linker > input.

I have

listed in the Additional Dependencies field.

You may also need to set the ‘Additional Library Directories’ field under the linker > general tab. I have it set to


As a disclaimer, it’s usually not good to include any SDK stuff for release code because there is no guarantee it will always work as it currently does.

Also, if you are not using CUDA VS Wizard, I would suggest it.

Hope that helps,