out of memory

I have a

01:00.0 VGA compatible controller: nVidia Corporation GeForce 8400M GS (rev a1)

on my system. Apparently it is CUDA compatible. I downloaded the latest 2.1 version. Installed and compiled everything fine. But when I run the programs I am getting errors like this:

cudaSafeCall() Runtime API error in file <matrixMul.cu>, line 112 : out of memory.

Here are the diagnostics that might help,

tried different versions of the driver (180.22 and 180.44), neither worked.
tried g+±4.3 and g+±4.2, neither worked.

The only thing that seems to help is restarting the X server. All test programs seem to work fine for a while, but after running a few other programs, errors appear again.

My system has 2 GB of main memory and I have no other memory related problems.

I have already tried the Grub trick, /boot/grub/menu.lst :

title Debian GNU/Linux, kernel 2.6.26-1-686
root (hd0,0)
uppermem 524288
kernel /boot/vmlinuz-2.6.26-1-686 root=/dev/sda1 ro vmalloc=256MB
initrd /boot/initrd.img-2.6.26-1-686

It does not work either.

Any help will be highly appreciated.


This means you are out of graphics memory, not system memory. How much graphics memory does your GPU have? (deviceQuery in the SDK will show you this as well)

below is the output of the deviceQuery program’s output


There is 1 device supporting CUDA

Device 0: “GeForce 8400M GS”

Major revision number: 1

Minor revision number: 1

Total amount of global memory: 66387968 bytes

Number of multiprocessors: 2

Number of cores: 16

Total amount of constant memory: 65536 bytes

Total amount of shared memory per block: 16384 bytes

Total number of registers available per block: 8192

Warp size: 32

Maximum number of threads per block: 512

Maximum sizes of each dimension of a block: 512 x 512 x 64

Maximum sizes of each dimension of a grid: 65535 x 65535 x 1

Maximum memory pitch: 262144 bytes

Texture alignment: 256 bytes

Clock rate: 0.80 GHz

Concurrent copy and execution: Yes


Press ENTER to exit…

i am not very sure what each field of the above output means, but i know the GeForce 8400M GS has 256MB of memory.

i doubt there is any reason for the device ram to be full under these conditions. do you have any ideas why the device memory would be filled and not freed during normal desktop usage?

Thanks for your help.

Found new evidence at the crime scene, syslog contains the following line during the boot sequence in about all the boot ups:

Dec 2 10:07:43 canbey4 kernel: [ 0.350222] PCI: Failed to allocate mem resource #6:20000@e0000000 for 0000:01:00.0

which happens to be the graphics card

$ lspci |grep -i nv
01:00.0 VGA compatible controller: nVidia Corporation GeForce 8400M GS (rev a1)

Could this point at some problems with the kernel version? Is there a required version for by the nvidia?

I have the Debian stock kernel 2.6, which is not the latest one

$ uname -a
Linux canbey4 2.6.26-1-686 #1 SMP Sat Jan 10 18:29:31 UTC 2009 i686 GNU/Linux

or am I misinterpreting the syslog message?

Thanks for any help.

This looks suspicious right here. The CUDA driver thinks you have a little less than 64 MB of device (“global”) memory. That’s definitely not enough to run any CUDA programs. Is this a separate card, or an integrated GPU on the motherboard that takes some of system memory for the GPU?

Hmm I was suspicious about that number : ) Thanks about the clarification.

If Sony is not tricking me here, it should be a separate card. This is a Sony VGN-SZ71MN laptop. I shall check the bios about that, but it did not see any menus offering graphics card memory settings.

I did check the bios right now, and there is no such option. I also checked the nvidia-settings utility and it seems to report 256MB ram, although this number could as well just be a table lookup from the device name.

I am thinking this might be a kernel related issue? Any ideas on that end?

Thanks again.

It’s possible, but I’m out of ideas now. This is possibly some kind of kernel or driver problem, but the NVIDIA employees will have to comment.

It is worth noting that Ubuntu is a supported CUDA platform, but not Debian. You should check what kernel version Ubuntu 8.04 uses and maybe try that. It still might not work since each distro is known to add their own patches before the upstream kernel developers do.

Thanks for your help : ) Waiting to hear from NVidia people.

Looked up the laptop specs, it has 64MB of actual VRAM–that’s what’s available for CUDA to use.

Could give more information which specs are you looking at?

This model has two graphics devices, which you can switch between with a manual switch. One of the devices is the onboard intel device, which may have 64MB, but the other mode is supposed to have a 8400M GS working.

Are you saying this is not the case with the VRAM?


I found a similar laptop on the Sony site (slightly different model number, but I think it was a US versus Euro difference–it had the dual GPUs and very similar specs to what I had seen elsewhere), and it said that it had a lot of “shared video memory,” but only 64MB of dedicated video memory on the 8400M GS. So, there’s only 64MB available to CUDA.

I have no reason to think this is any sort of driver bug.

The page below lists the memory amount 64MB as well:


Apparently Sony is screwing customers by advertaising 8400M GS, but putting 64MB of RAM along with it… Very interesting really.

I guess I will need to get a decent desktop to work with CUDA, as always notebooks find a way to stab you in the back.

I am pretty sure there is no upgrade option on memory RAM available, or is there?

Thanks a lot for your help.