easy question - compiling CUDA code

is it possible to compile CUDA code on a machine without a CUDA enabled card and just have the CPU do all the work?

Yes, that’s the device emulation mode

im using winXP with visual studio, how do i get the device emulation mode to work? Currently when i compile it complains about not having a device

Oops, maybe I am wrong. To run device emulation you need to load cudart.dll, which is included in the CUDA display driver,…so if you dont have the card, you can not install the driver I guess…then you won’t be able to run any cuda program. However I suspect I can force to install and load cudart under Linux without gpu installed…

(Sorry it has been a while that I work with CUDA on Windows…I shifted to Linux long time ago)

Any one tried it before?

YOu can run “Device emulation” on a box without gpu… Thats y device emulation is in place,.

YOu need to add “–deviceemu” compiler option while compiling…

I hope you have first installed CUDA on your machine where you want to compile. YOu need to the driver and SDK installed first. It does NOT matter if you dont have the card. So, go ahead, install driver and SDK and then compile code.

I hope you know how to compile CUDA code (.cu file, custom build rule using nvcc etc.)

Best Regards,

MCUDA also looks interesting, but I am not sure you can download it anywhere yet.


[url=“MCUDA - Google Search”]MCUDA - Google Search

It would be great if this research were integrated into the CUDA toolchain to generate binaries that worked on both CUDA and non-CUDA systems. Not having to hand-code a CPU-only path would be nice.

We have a similar solution in the work.
You will be able to recompile your CUDA code to multicore changing just a compiler flag.

Awesome! Some kind of runtime selection between the two code paths would be nice too, but a compile time selection is good enough for me.

Very nice. I’ve been wanting to add multicore support to HOOMD for a while, but didn’t really have the time to devote to it. Now, I’ll be getting it for free through CUDA :) CUDA is the best thing since homemade bread (sliced bread stinks :P ).

Yes it is possible and you dont even have to install the driver. My windows laptop has ATI card and I just installed the toolkit and SDK for windows and thats it. Now i can compile emudebug and emurelease versions of the SDK examples. OpenGL examples has other issues which i m not interested in.

And for the MCUDA, I just printed it out for the way back home but abstract sounds good.And hearing NVIDIA has already a work for this, is just better.