Results from 8600M GT 128mb SDK example errors found on Mac Book Pro

As mentioned elsewhere some of the examples will not run on a Mac Book Pro with a 8600M GT 128mb. I was curious on the specifics and thought others might be interested as well and so on a default configuration I found the following examples to not work:
MonteCarlo(Bus Error)
asyncAPI(Hangs)
bandwidthTest(Bus Error)

In addition the following programs will run but not pass their own test:
BlackScholes
MersenneTwister
alignedTypes
convolutionFFT2D
convolutionSeparable
convolutionTexture
simpleStreams
simpleTexture
simpleTextureDrv

A good number of these examples will pass their test on Windows(using Bootcamp) so it seems to be more a result of CUDA being in Beta on Mac OS X than the limited amount of memory. Regardless, with the ability to compile other linux examples found on the web unmodified using make I am really glad to see CUDA on Mac OS X and look forward to future releases.

The errors are related to the limited amount of memory.
Each OS uses a different amount of memory to drive the display (Mac OS X and Vista more than XP for example) , so the failures on the same hardware will be different.

Ahh okay, that makes sense given I was using XP. Thanks.

nbody --benchmark worked showing 16Gflps, but in gaphics mode its unusable with the display jumping around. Though I thought this in particular was demoned at SC07

Mandlebort displays only a blank window.

FluidsGL gets many errors and display its initial screen and claims to be updating at 0.5fps but I see o evidence that it is actually doing so.

Bandwidth test works and a few of the other test programs work but I have not found anything that is a decent demo for use on a MacBookPro with 128MB of GPU memory, so that’s a bit disappointing since this points to this not being a viable development environment even if the final target is something bigger.

This is why in the README we recommend 256MB of VRAM.

The machine that was running the demo at SC07 had 256MB of VRAM

Will reducing the screen resolution give CUDA more room to breathe?

This code will tell you the amount of memory available on the GPU, try to change the screen resolution to see if there is a considerable effect.

/*

g++ -o gpumeminfo gpumeminfo.c -I /usr/local/cuda/include/  -L /usr/local/cuda/lib/ -lcuda

*/

#include <cuda.h>

#include <stdio.h>

static unsigned long inKB(unsigned long bytes)

{ return bytes/1024; }

static unsigned long inMB(unsigned long bytes)

{ return bytes/(1024*1024); }

static void printStats(unsigned long free, unsigned long total)

{

    printf("^^^^ Free : %lu bytes (%lu KB) (%lu MB)\n", free, inKB(free), inMB(free));

    printf("^^^^ Total: %lu bytes (%lu KB) (%lu MB)\n", total, inKB(total), inMB(total));

    printf("^^^^ %f%% free, %f%% used\n", 100.0*free/(double)total, 100.0*(total - free)/(double)total);

}

int main(int argc, char **argv)

{

    unsigned int free, total;

    int gpuCount, i;

    CUresult res;

    CUdevice dev;

    CUcontext ctx;

   cuInit(0);

   cuDeviceGetCount(&gpuCount);

    printf("Detected %d GPU\n",gpuCount);

   for (i=0; i<gpuCount; i++)

    {

    cuDeviceGet(&dev,i);

    cuCtxCreate(&ctx, 0, dev);

    res = cuMemGetInfo(&free, &total);

    if(res != CUDA_SUCCESS)

        printf("!!!! cuMemGetInfo failed! (status = %x)", res);

    printf("^^^^ Device: %d\n",i);

    printStats(free, total);

    cuCtxDetach(ctx);

    }

   return 0;

}

You might also want to check out the “Quartz Debug” application and see if disabling Quartz Extreme frees up some video memory. (check the Tools menu of Quartz Debug)

I have the same hardware as the op.

With the default configuration (Quartz Extreme ON, Quartz GL OFF):

Detected 1 GPU

^^^^ Device: 0

^^^^ Free : 18983168 bytes (18538 KB) (18 MB)

^^^^ Total: 134021120 bytes (130880 KB) (127 MB)

^^^^ 14.164311% free, 85.835689% used

With (Quartz Extreme ON, Quartz GL OFF):

Detected 1 GPU

^^^^ Device: 0

^^^^ Free : 27764992 bytes (27114 KB) (26 MB)

^^^^ Total: 134021120 bytes (130880 KB) (127 MB)

^^^^ 20.716878% free, 79.283122% used

So as you predicted, this does free up a bit of graphics memory. Still, 80% usage of the graphics memory by the OS seems pretty high. I imagine game developers must have to find some way around this, i.e. maybe if you run fullscreen the OS will temporarily give up control of the graphics hardware…

Thanks for the code snippet! I think this may explain some intermittent behavior of the sample code on my machine, though it means my Macbook Pro will barely even be useful for prototyping… can’t wait for my new graphics card to arrive!

Cheers,

Drew

With an external screen plugged in, it won’t even init the environment!

#include <cuda.h>

#include <stdio.h>

#  define CU_SAFE_CALL_NO_SYNC( call ) do {								  \

	CUresult err = call;													 \

	if( CUDA_SUCCESS != err) {											   \

		fprintf(stderr, "Cuda driver error %x in file '%s' in line %i.\n",   \

				err, __FILE__, __LINE__ );								   \

	} } while (0)

static unsigned long inKB(unsigned long bytes)

{ return bytes/1024; }

static unsigned long inMB(unsigned long bytes)

{ return bytes/(1024*1024); }

static void printStats(unsigned long free, unsigned long total)

{

  printf("^^^^ Free : %lu bytes (%lu KB) (%lu MB)\n", free, inKB(free), inMB(free));

  printf("^^^^ Total: %lu bytes (%lu KB) (%lu MB)\n", total, inKB(total), inMB(total));

  printf("^^^^ %f%% free, %f%% used\n", 100.0*free/(double)total, 100.0*(total - free)/(double)total);

}

int main(int argc, char **argv)

{

	unsigned int free, total;

	int gpuCount, i;

	CUresult res;

	CUdevice dev;

	CUcontext ctx;

	char devName[256];

	

	CU_SAFE_CALL_NO_SYNC(cuInit(0));

	CU_SAFE_CALL_NO_SYNC(cuDeviceGetCount(&gpuCount));

	

	printf("Detected %d GPU\n",gpuCount);

	

	for (i=0; i<gpuCount; i++)

	{

		CU_SAFE_CALL_NO_SYNC(cuDeviceGet(&dev,i));

		CU_SAFE_CALL_NO_SYNC(cuCtxCreate(&ctx, 0, dev));

		res = cuMemGetInfo(&free, &total);

		if(res != CUDA_SUCCESS)

			printf("!!!! cuMemGetInfo failed! (status = %x)\n", res);

		CU_SAFE_CALL_NO_SYNC(cuDeviceGetName(devName, 256, i));

		printf("^^^^ Device: %d - %s\n", i, devName);

		printStats(free, total);

		cuCtxDetach(ctx);

	}

	

	return 0;

}

Detected 1 GPU

Cuda driver error 2 in file ‘gpumeminfo.c’ in line 46.

!!! cuMemGetInfo failed! (status = c9)

^^^^ Device: 0 - GeForce 8600M GT

^^^^ Free : 0 bytes (0 KB) (0 MB)

^^^^ Total: 2413823420 bytes (2357249 KB) (2302 MB)

^^^^ 0.000000% free, 100.000000% used

part of that will be used by the CUDA context, but OSX and Vista are both hogs when it comes to memory usage just to display a UI.