cudanvidiatesla

Using CUDA compiled for compute capability 3.7 on Maxwell GPUs?


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?


Solution

  • 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.)