# Debug Emulation Emulation Mode

**URL:** <https://forums.developer.nvidia.com/t/debug-emulation-emulation-mode/6715>\
**Category:** CUDA Programming and Performance\
**Created:** [December 6, 2008, 7:26am UTC](https://forums.developer.nvidia.com/t/debug-emulation-emulation-mode/6715 "2008-12-06T07:26:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShoreNuff](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ShoreNuff](https://forums.developer.nvidia.com/u/ShoreNuff)\
**Post date:** [December 6, 2008, 7:26am UTC](https://forums.developer.nvidia.com/t/debug-emulation-emulation-mode/6715/1 "2008-12-06T07:26:59Z")

</div>

Hi,

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");
    srand(2007);
    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
