How to allocate all available global memory on the GeForce GTX 690 device?

Good day, all!

I use NVidia devices at my work.
Now I need to allocate all available memory with cuda technology.
I do it with Tesla C2050, Quadro 600 and GeForce GTX 560 Ti by:
First, I allocate 0 bytes of global memory on device. Second step is define available memory of device by cudaMemGetInfo function and make allocation of that available memory. It works for devices listed above.
But this mechanism doesn’t work with GeForce GTX 690.

Could somebody help me, what mechanism can I use to allocate memory on the GeForce GTX 690 device or any paradigm for that operation?

I’ll be very thankful!

It looks like this:

cudaSetDevice(deviceIndex);

int (*reservedMemory);

cudaMalloc(&reservedMemory, 0);

size_t freeMemory, totalMemory;

cudaMemGetInfo(&freeMemory, &totalMemory);

cudaMalloc(&reservedMemory, freeMemory);

On the GeForce GTX 690, one of two existing streaming multiprocessors operate on 2147483648 bytes of memory, but I can allocate only 1341915136 bytes of free global memory that is equal to 2050109440 bytes.
On the Quadro 600, one existing streaming multiprocessor operate on 1073414144 bytes of memory, and I can allocate all available 859803648 bytes of free global memory that is equal to 859803648 bytes.

For an example on Quadro 600 (showed compilation, linking and execution procedure):

D:\Gdmt> nvcc -arch=compute_20 -code=sm_21 -c ./Gdmt.cu -o ./Gdmt.obj
Gdmt.cu
tmpxft_00000bb4_00000000-3_Gdmt.cudafe1.gpu
tmpxft_00000bb4_00000000-8_Gdmt.cudafe2.gpu
Gdmt.cu
tmpxft_00000bb4_00000000-3_Gdmt.cudafe1.cpp
tmpxft_00000bb4_00000000-14_Gdmt.ii

D:\Gdmt> nvcc ./Gdmt.obj -o ./Gdmt.exe

D:\Gdmt> nvcc -arch=compute_20 -code=sm_21 -c ./Gdmt_additional.cu -o ./Gdmt_add
itional.obj
Gdmt_additional.cu
tmpxft_00000858_00000000-3_Gdmt_additional.cudafe1.gpu
tmpxft_00000858_00000000-8_Gdmt_additional.cudafe2.gpu
Gdmt_additional.cu
tmpxft_00000858_00000000-3_Gdmt_additional.cudafe1.cpp
tmpxft_00000858_00000000-14_Gdmt_additional.ii

D:\Gdmt> nvcc ./Gdmt_additional.obj -o ./Gdmt_additional.exe

D:\Gdmt> Gdmt.exe
Total amount of memory: 1073414144 Bytes;
Memory to reserve: 859803648 Bytes;
Memory reserved: 859803648 Bytes;
^C
D:\Gdmt> Gdmt_additional.exe
Allocation is succeeded on 890830848 bytes of reserved memory.
^C
D:\Gdmt>

For an example on GeForce GTX 690 (showed compilation, linking and execution procedure):

J:\Gdmt> nvcc -arch=compute_30 -code=sm_30 -c ./Gdmt.cu -o ./Gdmt.obj
Gdmt.cu
tmpxft_000011f0_00000000-5_Gdmt.cudafe1.gpu
tmpxft_000011f0_00000000-10_Gdmt.cudafe2.gpu
Gdmt.cu
tmpxft_000011f0_00000000-5_Gdmt.cudafe1.cpp
tmpxft_000011f0_00000000-15_Gdmt.ii

J:\Gdmt> nvcc ./Gdmt.obj -o ./Gdmt.exe

J:\Gdmt> nvcc -arch=compute_30 -code=sm_30 -c ./Gdmt_additional.cu -o ./Gdmt_add
itional.obj
Gdmt_additional.cu
tmpxft_00001164_00000000-5_Gdmt_additional.cudafe1.gpu
tmpxft_00001164_00000000-10_Gdmt_additional.cudafe2.gpu
Gdmt_additional.cu
tmpxft_00001164_00000000-5_Gdmt_additional.cudafe1.cpp
tmpxft_00001164_00000000-15_Gdmt_additional.ii

J:\Gdmt> nvcc ./Gdmt_additional.obj -o ./Gdmt_additional.exe

J:\Gdmt> Gdmt.exe
Total amount of memory: 2147483648 Bytes;
Memory to reserve: 2050109440 Bytes;
Warning, memory allocation process is not succeeded!
^C
J:\Gdmt> Gdmt_additional.exe
Allocation is succeeded on 1341915136 bytes of reserved memory.
^C

Examples is archived and located at:

(z7 archive - 78.5 KB ~ 80,434 bytes)
https://docs.google.com/file/d/0BzZ5q0v8n-qTTDctVDV5Mnh2ODA/edit
(zip archive - 163 KB ~ 167,457 bytes)
https://docs.google.com/file/d/0BzZ5q0v8n-qTT2xoV3NXSzhQMDQ/edit

This topic is a clone of topic posted at “The GeForce Lounge”, with the same name. Thanks to BossDweebe for his remark!
https://forums.geforce.com/default/topic/528645/the-geforce-lounge/how-to-allocate-all-available-global-memory-on-the-geforce-gtx-690-device-/