How to Use emulation mode in Visual Studio?

Hi,

I am newbie and am currently working on VS .NET 2003 with 8800GTX.

I need to debug this program of mine and it would be great if I can use the emulation mode.

Can some one explain how to use emulation mode in VS if possible with a small example?

Look at sample nVidia projects available in SDK they might help you.

Amd generally to run in emulation mode you should compile all your “.cu”-files in project in similar way:

D:\CUDA\bin\nvcc.exe -ccbin “D:\Program Files\Microsoft Visual Studio 8\VC\bin” -deviceemu -c -DWIN32 -D_CONSOLE -D_MBCS -Xcompiler /EHsc,/W3,/nologo,/Wp64,/Zi, -I"D:\CUDA\include" -I./ -I"D:\CUDA\SDK"/common/inc -o CUDADebug\CUDABenchmark.obj CUDABenchmark.cu

BTW, I need help from more qualified CUDA users than me. Am I able to run emulation of two devices?

Hi,

I am total nOOb. Can somebooy explain in detail?

There is a template project in the SDK when you can copy and modify to include your sources (instructions are in the README). Using this project, compiling emulation mode is as easy as changing the build mode in visual studio, as there are separate modes built into the project for emulation debug, non debug emulation, etc…

ramesh2006 gave your a command line to build the project and run in emulation model.
And you can also use the VS ,and choose the build model by emulation;
nvidia_form_emulation.PNG

Hi,

I am new to using both CUDA and Visual Studio. I copied my project from the template, so I have four build modes, which all work, but I have another problem with the debug emulation mode. When debugging in emulation mode, if I try to step into a kernel invocation, it informs me that there is no source code for the kernel, just like when running in “normal” modes. How do you solve this problem?
I am running Visual Studio 8.

Thanks,

Andrew

Don’t step into a kernel from emulation–try setting a breakpoint no the first line of the kernel and continuing until you hit that.

That works just fine. Now I feel a little silly for not thinking of that. Thanks.