Amount of device memory and maybe device mem recognition

I have 8800 GT 512MB. This is the first time that I have the possibility of filling up device memory (depends on size of input file being manipulated). If my card is 512 MB, can I copy that much data over to global memory to be manipulated, or do i have to subtract constant/shader/instruction memory?

Eventually I would like to detect card type and dynamically adjust mem on device that is available. Is there something like this in a sdk project, or does anyone know where to look for a reference?

Thanx in advance for any help.

Others on the forums have found that roughly 50 MiB of the space is not allocatable. If you run a graphical display on the GPU then even less will be available because of the frame buffer and whatnot.

You don’t need to guess how much memory is free based on the device type. Query it directly with cuMemGetInfo. This is one driver API function that is safe to use in runtime API programs.

thanx. I’ll look into it.