Build for CUDA Capabilities unsupported by current system?

I have a Titan X and build for capabilities 3.5 & 5.2 on my system in VS2013.

On another system, with only a K20 installed, the build for 5.2 fails, but works for 3.5.

Both are using CUDA 6.5 & VS2013.

I was under the impression that I should be able to build for capabilities not available on the build machine. Not so?

CUDA 6.5 allows you to build for sm_52 regardless of the GPU installed in your system. Obviously any sm_52 code generated will not be able to run on the K20.

How exactly does the build fail on the system with the K20? Without some details it is pretty much impossible to render assistance. As a piece of generic advice, check the paths set for executables, include files, and libraries. Check for inconsistent Visual Studio build settings. Due to the nature of the GUI, with build settings typically spread out all over the place, it is not uncommon for builds to build differently than the programmer intended. Turn on verbose settings to get a log of the exact invocation of nvcc and other build tools and their output, and compare this between the working and the non-working system.

What’s the output of nvcc --version on your two systems? On my Windows machine it looks like this:

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Wed_Aug_27_10:28:57_CDT_2014
Cuda compilation tools, release 6.5, V6.5.16

There were two different versions of CUDA 6.5. One of them supported cc 5.2, one did not (only supported up to cc 5.0).

You might check to see if your two CUDA 6.5 versions are actually the same.

As njuffa points out, I think nvcc -v should be instructive.

Both systems output the same nvcc version as yours.

The K20 system error is "nvcc fatal: Unsupported gpu architecture ‘compute_52’ "

The Code Generation entry in VS is “compute_35,sm_35;compute_52,sm_52”

which works on the Titan X system, but not the K20 system

Sorry, correction: the K20 system has nvcc v6.5.13

Pending confirmation by txbob, I think the CUDA 6.5 version with sm_52 support is this one here:

[url]https://developer.nvidia.com/cuda-downloads-geforce-gtx9xx[/url]

Yes. GTX 980/970/960 GPUs (and Titan X) are GM20x cc5.2 GPUs

If you’re going to upgrade, you might want to use CUDA 7 instead. I recognize you’ve got another thread going concerning r349 and higher drivers, but CUDA 7 ships with and only requires r346 drivers.