[SOLVED] nvcc fatal : Unsupported gpu architecture 'compute_21'

I’ve recently installed cuda toolkit from the cuda_5.5.22… installer, as you can see from my previous topics: How to install properly in Ubuntu 12.04?? - Linux - NVIDIA Developer Forums

Now I am able to compile and run deviceQuery. But I am not able to compile and run the sample boxFilter.
I get the following error:
uilding file: …/src/boxFilter_kernel.cu
Invoking: NVCC Compiler
/usr/local/cuda-5.5/bin/nvcc -I"/home/bruno/NVIDIA_CUDA-5.5_Samples/NVIDIA_CUDA-5.5_Samples/3_Imaging" -I"/home/bruno/NVIDIA_CUDA-5.5_Samples/NVIDIA_CUDA-5.5_Samples/common/inc" -I"/home/bruno/MyCPP/CUDA/boxFilter" -G -g -O0 -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_20,code=sm_21 -odir “src” -M -o “src/boxFilter_kernel.d” “…/src/boxFilter_kernel.cu”
/usr/local/cuda-5.5/bin/nvcc --compile -G -I"/home/bruno/NVIDIA_CUDA-5.5_Samples/NVIDIA_CUDA-5.5_Samples/3_Imaging" -I"/home/bruno/NVIDIA_CUDA-5.5_Samples/NVIDIA_CUDA-5.5_Samples/common/inc" -I"/home/bruno/MyCPP/CUDA/boxFilter" -O0 -g -gencode arch=compute_20,code=compute_21 -gencode arch=compute_20,code=sm_20 -m64 -x cu -o “src/boxFilter_kernel.o” “…/src/boxFilter_kernel.cu”
nvcc fatal : Unsupported gpu architecture ‘compute_21’
make: *** [src/boxFilter_kernel.o] Errore 255

I’m using Nsight Eclipse Edition, and i have a GeForce GT 610.

Thanks for your help

Bruno

It seems there are a couple of things here that are not quite right. As far as I know, a “code” specification cannot refer to “compute_??” only “sm_??”. In addition, compute capability 2.1 is not a separate architecture as seen by the compiler. The instruction set architecture of a compute capability 2.1 device is sm_20, but the code generation can be tweaked for sm_21. So the following specification looks correct for compute capability 2.1:

-gencode arch=compute_20,code=sm_21

and should work (I am not in front of a CUDA-capable machine right now to confirm), while this:

-gencode arch=compute_20,code=compute_21

will not work and leads to the error message shown above.

1 Like

The problem is no more there if i use the Nsight import wizard for CUDA samples.

Sorry for the waste of time.

Bruno.