nvcc compiler warning 'compute_20'..........

Hi

I am programming on windows with mingw gcc , and i just installed the CUDA kit, as soon as i ran the nvcc compiler i was presented with this warning

“C:\Users\User>nvcc
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc fatal : No input files specified; use option --help for more information”

how do i fix this problem? is this something that can be changed in settings or is this to do with my graphics hardware which is unchangeable?

i know i can suppress this warning but i would rather solve it if it is solvable easily and doesn’t require you to turn heaven and hell in place to make it work

what is that you are trying to fix?

the warning about the compute capability target or the fatal error because you didn’t specify any files for nvcc?

You can’t suppress the error. You have to give nvcc something sensible to do.

Regarding the warning, it is coming about because you have installed CUDA 8.0. The warning is there for exactly the reason it states: to let you know that a future CUDA toolkit may not support the compute capability target you have specified. In this case, you haven’t specified one, but the default compute capability is cc2.0, which gives rise to the warning.

In general you could avoid the warning by specifying a non-cc2.x target architecture, e.g.

nvcc -arch=sm_30 …

but for the …, you actually need to specify something for nvcc to do, or it will give you the error. (and you should specify a target architecture compatible with the GPUs you plan to run on.)

If you just want to know what version nvcc you have, try

nvcc --version

okay basically i am asking is how do i change the default settings so that i am compiling a version that will be compatible with architecture that is not depreciated anymore?

is there some setting option for architecture?

nvcc -arch=sm_30 ...
     ^^^^^^^^^^^

http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#nvcc-command-options

1 Like

is there a way to change the default values permanently without having to add that option every time i compile something?

In visual studio, if you are using the IDE, you could easily clone from a project that has that already specified. You wouldn’t have to add it every time. But if you are referring to command line compilation, not as far as I know. Maybe others will have ideas.

Also note that mingw gcc is not really directly usable (officially compatible) as the host compiler on windows for nvcc.

nvcc must/expects to have cl.exe, the host compiler from visual studio, available to it.

The informational deprecation message tells you what to do to get rid of the warning:

“Use -Wno-deprecated-gpu-targets to suppress warning”

That should take of it if you actually need to include sm_2x as a target architecture (at this point very few people do). If you do not need sm_2x as a target architecture, simply compile for the desired targets specifically, that is standard procedure for building CUDA binaries.

Alternatively you can use CUDA 7.5, which doesn’t have the deprecation warning, or wait for a future CUDA version in which sm_2x support is removed.

Hallo guys.

I use the following components:

  • NVIDIA GTX 1080
  • Visual Studio 2015
  • Cuda 8.0

1. I create a new empty Cuda 8 project see screenshot 1

2. Then I change the device proberties to compute_50,sm_50 see screenshot 2

3. I compile the kernel.cu but I got the following warning:
CUDACOMPILE : nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).

I specify the GPU architecture in den device see screenshot 2 but I get a compiler warning. How must i set the architecture correctly in the visual studio proberties?

I have the same problem in ubuntu14.04, GTX1080,cuda_8.0.61_375.26_linux.run, however it works fine for cuda_8.0.27_linux.run

I have the exact same problem that Pimbolie1979 reported. I don’t even need to post the screenshots because they look exactly the same as his.

Visual Studio 2015 Community + CUDA 8.0 + Windows 10 on GTX 1050Ti

I set up compute_50,sm_50 but I still get the warning.

Just to make it simple: the code is building correctly then I don’t care about the warnings.

If there’s another setting hidden away in Visual Studio that is preventing my code from building exactly the way I want it to (using exactly the architecture I specified), then I would like to know where to go to change that.

Thanks!

The previously posted screenshots are unreadable, at least on my monitor. What is the exact command line used by the IDE to invoke nvcc (you may have to increase logging level to see it)?

I only use CUDA 8.0 nvcc directly from the command line, and I don’t see the warning unless building for CC 2.x (either explicitly or implicitly). Example:

C:\Users\Norbert\My Programs>nvcc -o tailcall.exe tailcall.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : nvcc support for Microsoft Visual Studio 2010 and earlier has been deprecated and is no longer being maintained
tailcall.cu
ptxas warning : Stack size for entry function '_Z6kernelfi' cannot be statically determined
support for Microsoft Visual Studio 2010 has been deprecated!
   Creating library tailcall.lib and object tailcall.exp

C:\Users\Norbert\My Programs>nvcc -o tailcall.exe -arch=sm_50 tailcall.cu
nvcc warning : nvcc support for Microsoft Visual Studio 2010 and earlier has been deprecated and is no longer being maintained
tailcall.cu
ptxas warning : Stack size for entry function '_Z6kernelfi' cannot be statically determined
support for Microsoft Visual Studio 2010 has been deprecated!
   Creating library tailcall.lib and object tailcall.exp

njuffa, I decided to try your approach and tried building using the command line instead of Visual Studio. The warnings went away. Everything is running smoothly.

basically just running this:

nvcc -o kernel.exe kernel.cu --gpu-architecture=compute_50 --gpu-code=compute_50,sm_50

It compiles fine and it runs fine.

Just for laughs, here’s what visual studio was spitting out:

1>------ Rebuild All started: Project: CudaTest, Configuration: Release x64 ------
1>
1>  c:\Workspace\CudaTest\CudaTest>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64"  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include"     --keep-dir x64\Release -maxrregcount=0  --machine 64 --compile      -DWIN32 -DWIN64 -DNDEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /FS /Zi  /MD " -o x64\Release\kernel.cu.obj "c:\Workspace\CudaTest\CudaTest\kernel.cu" -clean
1>CUDACOMPILE : nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
1>  kernel.cu
1>  Compiling CUDA source file kernel.cu...
1>
1>  c:\Workspace\CudaTest\CudaTest>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" -gencode=arch=compute_50,code=\"sm_50,compute_50\" --use-local-env --cl-version 2015 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64"  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include"     --keep-dir x64\Release -maxrregcount=0  --machine 64 --compile -cudart static     -DWIN32 -DWIN64 -DNDEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /FS /Zi  /MD " -o x64\Release\kernel.cu.obj "c:\Workspace\CudaTest\CudaTest\kernel.cu"
1>  kernel.cu
1>  LINK : /LTCG specified but no code generation required; remove /LTCG from the link command line to improve linker performance
1>  CudaTest.vcxproj -> c:\Workspace\CudaTest\x64\Release\CudaTest.exe
1>  CudaTest.vcxproj -> c:\Workspace\CudaTest\x64\Release\CudaTest.pdb (Full PDB)
1>  copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\cudart*.dll" "c:\Workspace\CudaTest\x64\Release\"
1>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\cudart32_80.dll
1>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\cudart64_80.dll
1>          2 file(s) copied.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

And by the way I have NO IDEA why VS is making it so complicated and why it needs to call nvcc twice even. I Can see that the first call is missing the architecture option but the second has it … so the second is not causing issues. It’s the first one that is triggering the warning.

I’m totally fine running the command line build … but I’d be curious to understand what VS is screwing with …

Maybe I’m oversimplifying this and I’m missing something?

From the build log, it seems that MSVS is running nvcc twice, once to compile source code into object files, then a second time to link the object files into an executable. That is a common approach when building any non-trivial project, so nothing unusual there.

However, it seems that the GPU architecture is specified only during the link step, but not during the compilation step, and the latter therefore prints the sm_2x warning. That seems wrong, or at least not what one would expect. You might want to hunt down which MSVS setting needs to be changed to specify the GPU architecture during the compilation step (.cu → .obj), as desired.

The scenario here is precisely why I steer people towards classical makefiles and away from IDEs and CMAKE: Even when a programmer knows exactly what compiler flags they want and need for particular build steps, it can be a pain in the behind to try to find how to tell these tools what to do (another level of indirection). And with GUI-based IDEs where the options are hidden away in numerous pull-down dialogues it is sometimes hard to establish what build settings are actually in effect at any given time.

Ok, so it seems that I fixed it.

Njuffa, following your lead here’s what I did: I went into the Project Properties->CUDA C/C++ → Command Line

At the bottom of the window there’s a box that says Additional Options.

I copied and pasted this:

-gencode=arch=compute_50,code=\"sm_50,compute_50\"

The warnings went away. Problem solved. Now Visual Studio works just fine.

You definitely steered me in the right direction! Thanks for your help!

PS: I’m just stubborn … I didn’t need to fix this I just don’t like to give up. :)

I would have been totally fine using the command line and not waste any time with this Visual Studio shenanigans … I’m with you in that I prefer classic makefiles myself. Thanks!

i dont use visual studio at all, i only use visual code from microsoft editors and mingw in command line

mingw is not a supported platform for the CUDA host compiler on windows

Hello!

I’m trying to compile GROMACS 5.1.5 for GPU usage to run on CENTOS 6.9. The GPUs are NVIDIA TITAN X with installed CUDA 9.0. However, it is ending up with following error. I know compute_20 is no longer supported in cuda 9.0 but i didn’t get how to disable it and make TITAN_X working. Could anyone please help to make it work?

nvcc fatal : Unsupported gpu architecture ‘compute_20’
nvcc fatal : Unsupported gpu architecture ‘compute_20’
CMake Error at libgromacs_generated_pmalloc_cuda.cu.o.Release.cmake:207 (message):

Thanks!

[url]c++ - nvcc fatal : Unsupported gpu architecture 'compute_20' while cuda9.0 is installed - Stack Overflow