对于那些谁正在寻找答案在2016年…
免责声明
>我毕竟没有效仿GPU。
>如果你满足其列表,可能可以使用gpuocelot
依赖性。
我试图得到一个模拟器的BunsenLabs(Linux 3.16.0-4-686-pae#1 SMP
Debian 3.16.7-ckt20-1 deb8u4(2016-02-29)i686 GNU / Linux)。
我会告诉你我学到了什么。
> nvcc以前在CUDA Toolkit 3.0中有一个-deviceemu选项
我下载了CUDA Toolkit 3.0,安装它并试图运行一个简单的
程序:
#include
__global__ void helloWorld() {
printf("Hello world! I am %d (Warp %d) from %d.\n",
threadIdx.x, threadIdx.x / warpSize, blockIdx.x);
}
int main() {
int blocks, threads;
scanf("%d%d", &blocks, &threads);
helloWorld<<>>();
cudaDeviceSynchronize();
return 0;
}
注意,在CUDA工具包3.0中,nvcc在/usr/local/cuda / bin /中。
原来,我有编译它的困难:
06001
我在互联网上发现,如果我使用gcc-4.2或类似的古代而不是gcc-4.9.2的错误可能会消失。我放弃。
> gpuocelot
Stringer的回答有一个链接到一个非常老的gpuocelot项目网站。所以起初我以为这个项目在2012年左右被放弃了。实际上,它几年后被遗弃了。
以下是一些最新的网站:
我试图安装gpuocelot the guide之后。我在安装期间有几个错误,但我放弃了。 gpuocelot不再受支持,并且依赖于一组非常特定的库和软件版本。
你可能会尝试从2015年7月的this tutorial,但我不保证它会工作。我没有测试它。
> MCUDA
The MCUDA translation framework is a linux-based tool designed to
effectively compile the CUDA programming model to a CPU architecture.
> CUDA废物
它是一个在Windows 7和8上使用的模拟器。我没有尝试过。它似乎不再被开发(最后一次提交日期在2013年7月4日)。