Using CUDA compiled for compute capability 3.7 on Maxwell GPUs?

孤街醉人 提交于 2021-02-16 09:11:16

问题


My development workstation(s) currently have NVIDIA Quadro K2200 and K620. Both of which have CUDA compute capability 5.0. However, the final production system has a Tesla K80 which has CUDA compute capability 3.7.

Is it possible to install and develop CUDA programs for compute capability 3.7 on my Quadro GPUs and then move them to the K80 without having to make significant changes?


回答1:


Yes, it's possible. Be sure not to use any compute capability 5.0+ specific features in your code, and you should be able to run your code properly on either a cc3.7 device or a cc5.0 device.

When compiling your codes, specify target architectures for both compute capabilities, e.g.

-gencode arch=compute_50,code=sm_50 -gencode arch=compute_37,code=sm_37

and such a compilation method should be usable on either platform to create a usable binary. Furthermore, compiling that way will cause the compiler to flag any situations where you may have inadvertently used a cc5.0+ specific feature.

I think it's unlikely that you would inadvertently use a cc5.0+ specific feature; they wouldn't be part of common CUDA usage. As an example, if you attempted to use the lop3.b32 instruction in inline PTX, that would not work on a cc3.7 device (and using the above compile switches, the compiler would flag that for you.)



来源:https://stackoverflow.com/questions/37325630/using-cuda-compiled-for-compute-capability-3-7-on-maxwell-gpus

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