Debug Emulation Emulation Mode


I’m new to CUDA. I don’t have hardware yet on my Windows Vista (32bit) PC and want to start developing using the emulation projects in Visual Studio C/C++.

The sample project I’m trying to run is: histogram64_vc90
It runs to the line indicated below

printf("Initializing data...\n");
    printf("...allocating CPU memory.\n");
    h_Data      = (unsigned char *)malloc(DATA_SIZE);
    h_ResultCPU = (unsigned int *)malloc(HISTOGRAM_SIZE);
    h_ResultGPU = (unsigned int *)malloc(HISTOGRAM_SIZE);

    printf("...generating input data\n");
    for(i = 0; i < DATA_N; i++) 
        h_Data[i] = rand() % 256;

    printf("...allocating GPU memory and copying input data\n");
    cutilSafeCall( cudaMalloc((void **)&d_Data, DATA_SIZE  ) );          <<<<<<< Runs to here >>>>>>>>>>>>>
    cutilSafeCall( cudaMemcpy(d_Data, h_Data, DATA_SIZE, cudaMemcpyHostToDevice) );

and stops with the following error:

Unhandled exception at 0x1001618e in histogram64.exe: 0xC0000005: Access violation reading location 0x00000104.

I’ve tried running other examples and get the same error at the line: cutilSafeCall(cudaMalloc …

Its seems to me that something is not being set up correctly to enable the emulation to work.

Can anyone help me with this?

Thanks in advance

  • ShoreNuff