Compile cuda code for CPU

99封情书 提交于 2019-12-17 20:17:55

问题


I'm study cuda 5.5 but i don't have any Nvidia GPU. In old version of nvcc have a flag --multicore to compile cuda code for CPU. In the new version of nvcc, what's is the option?? I'm working on Linux.


回答1:


CUDA toolkits since at least CUDA 4.0 have not supported an ability to run cuda code without a GPU.

If you simply want to compile code, refer to this question.

If you want to run CUDA codes compiled with CUDA 5.5, you will need a CUDA capable GPU.

If you're willing to use older CUDA toolkits, you could install one of the various emulators, such as this one.

Or you could install a very old (e.g. ~ CUDA 3.0) cuda toolkit that had the ability to run CUDA codes on the CPU.




回答2:


Ideally, you'd be able to get access to a CUDA-compatible NVidia GPU.

But short of that, here's an emulator that might help:

  • https://code.google.com/p/cuda-waste/

If you have a Linux box, you can also try Ocelot:

  • http://gpuocelot.gatech.edu/faq/



回答3:


In current versions of CUDA, programs are debugged directly while they are running on the GPU. This is far superior to older versions of CUDA, which used an emulator for debugging. The debugging facilities are also much more powerful in current versions of CUDA.

So, if wish to write any CUDA code, a CUDA capable GPU card will give you immediate return on investment when you need to debug.

You can pick up an older used card for very little. Examine the features of each of the compute capabilities to determine how far back you are willing to go.

There are also some sites online that will let you test out CUDA code. NVIDIA has the CUDA test drive program. The Intro to Parallel Programming course at Udacity includes an online CUDA compiler for the coding assignments.



来源:https://stackoverflow.com/questions/21946701/compile-cuda-code-for-cpu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!