CUDA开发在不同的卡? [英] CUDA development on different cards?

查看:332
本文介绍了CUDA开发在不同的卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始学习如何做CUDA开发(使用版本4),想知道是否可以在不同的卡上开发,然后我打算使用?正如我学到的,这将是很高兴知道这一点,所以我可以留意,如果差异会影响我。

I'm just starting to learn how to do CUDA development(using version 4) and was wondering if it was possible to develop on a different card then I plan to use? As I learn, it would be nice to know this so I can keep an eye out if differences are going to impact me.

我有一个2010年中期macbook pro一个Nvidia GeForce 320M显卡(它是一个漂亮的基本的笔记本电脑集成卡),但我打算在EC2的NVIDIA TeslaFermiM2050 GPU上运行我的代码。我想知道它是否可能在我的笔记本电脑上进行本地开发,然后在EC2上运行它的最小更改(我这样做的个人项目,不想花费2.4美元用于开发)。

I have a mid-2010 macbook pro with a Nvidia GeForce 320M graphic cards(its a pretty basic laptop integrated card) but I plan to run my code on EC2's NVIDIA Tesla "Fermi" M2050 GPUs. I'm wondering if its possible to develop locally on my laptop and then run it on EC2 with minimal changes(I'm doing this for a personal project and don't want to spend $2.4 for development).

一个具体的问题是,我听说更新的卡(也许不是在我的笔记本电脑)支持递归,如果我在笔记本电脑上运行递归gpu?会踢出一个错误或将运行,但不利用硬件功能? (我不需要具体的答案,但这是我正在得到的)。

A specific question is, I heard that recursions are supported in newer cards(and maybe not in my laptops), what if I run a recursion on my laptop gpu? will it kick out an error or will it run but not utilize the hardware features? (I don't need the specific answer to this, but this is kind of the what I'm getting at).

如果这将是一个问题,有没有模拟器的功能不能在我目前的卡?

If this is going to be a problem, is there emulators for features not avail in my current card? or will the SDK emulate it for me?

很抱歉,如果这个问题太基本了。

Sorry if this question is too basic.

推荐答案

是的,使用不同的GPU进行开发和生产是一个很常见的做法。 nVidia的GPU代是向后兼容的,所以如果你的程序运行在较旧的卡(即如果320M(CC1.3)),它肯定会运行在M2070(CC2.0))。

Yes, it's a pretty common practice to use different GPUs for development and production. nVidia GPU generations are backward-compatible, so if your program runs on older card (that is if 320M (CC1.3)), it would certainly run on M2070 (CC2.0)).

如果你想获得最大的性能,你应该配置你的程序在相同的架构,你将使用它,但通常一切都很好,没有任何变化,从1.x移动到2.0。任何模拟器提供了更糟糕的视图,显示运行在无所谓的旧的GPU上。

If you want to get maximum performance, you should, however, profile your program on same architecture you are going to use it, but usually everything works quite well without any changes when moving from 1.x to 2.0. Any emulator provide much worse view of what's going on than running on no-matter-how-old GPU.

关于递归:试图编译一个程序有明显的递归1.3架构产生编译时错误:

Regarding recursion: an attempt to compile a program with obvious recursion for 1.3 architecture produces compile-time error:

nvcc rec.cu -arch=sm_13
./rec.cu(5): Error: Recursive function call is not supported yet: factorial(int)

该程序可能会编译(我不知道编译器在检测递归是多么聪明),但肯定不会工作:在1.x架构中没有调用堆栈,并且所有的函数调用实际上是内联的,所以递归技术上不可能。

In more complex cases the program might compile (I don't know how smart the compiler is in detecting recursions), but certainly won't work: in 1.x architecture there was no call stack, and all function calls were actually inlined, so recursion is technically impossible.

但是,我强烈建议您不要任何代价避免递归:它违反GPGPU编程范式,一定会导致非常差的性能。大多数算法容易重写而不使用递归,并且它是更好的方式来使用它们,不仅在GPU上,而且在CPU上。

However, I would strongly recommend you to avoid recursion at any cost: it goes against GPGPU programming paradigm, and would certainly lead to very poor performance. Most algorithms are easily rewritten without the use of recursion, and it is much more preferable way to utilize them, not only on GPU, but on CPU as well.

这篇关于CUDA开发在不同的卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆