Caffe: error: token ""__CUDACC_VER__ is no longer supported.

Created on 18 Oct 2017  路  10Comments  路  Source: BVLC/caffe

Hi Guys,
I was trying to compile the caffe at first,I meet this error:
nvcc fatal : Unsupported gpu architecture 'compute_20'
And I delete this two lines in Makefile.config, but I meet this error:
NVCC src/caffe/layers/eltwise_layer.cu In file included from /usr/local/cuda/include/common_functions.h:50:0, from /usr/local/cuda/include/cuda_runtime.h:115, from <command-line>:0: /usr/local/cuda/include/crt/common_functions.h:64:24: error: token ""__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions #define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __ ^ Makefile:594: recipe for target '.build_release/cuda/src/caffe/layers/eltwise_layer.o' failed make: *** [.build_release/cuda/src/caffe/layers/eltwise_layer.o] Error 1

I'm very appreciate if anyone can help.

Operating system: ubuntu 17.04
Compiler: GCC/G++ v5.4.1
CUDA version (if applicable):9.0
CUDNN version (if applicable):v6.0.21
BLAS:
Python or MATLAB version (for pycaffe and matcaffe respectively):

Most helpful comment

sorry, I solved this issue for myself. For me, I just comments /usr/local/cuda/include/crt/common_functions.h line 64:
#define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."

and recompile.

All 10 comments

sorry, I solved this issue for myself. For me, I just comments /usr/local/cuda/include/crt/common_functions.h line 64:
#define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."

and recompile.

This issue may be closed now, but I found an alternative solution that did not require modifying the CUDA headers: upgrade boost to at least 1.65.1 and then try building caffe again.

Upgrading boost to 1.67.0 didn't help me right now.

It is wrong for say upgrade boost version remove the error. It does not work .............

I upgrade boost from 1.62 to 1.65 and the problem is solved...

comfirm again with caffe from nvida 0.15.x and cuda 9.2 on ubuntu 18.04. install libboost-all-dev ver 1.65.1 is solve problem

My cuda version is relatively new currently
My cuda version is 10.1, ubuntu 18.04, boost version 1.65.1. gcc version 7.5.0
I don't want to modify the cuda header. My boost version is new enough
I used the so called modern cmake method (https://cliutils.gitlab.io/modern-cmake/chapters/packages/CUDA.html) to compile the code, cmake file looks like the following

cmake_minimum_required(VERSION 3.8 FATAL_ERROR)

project(some_name LANGUAGES CUDA CXX)
...
add_executable(file file.cu)

Normally this can compile successfully, but when I tried this in a complex program, I meet the mentioned error. Then I just tried to use the "classic" way to compile cuda program, which is like

cmake_minimum_required(VERSION 2.8)

project(some_name)

find_package(CUDA QUIET REQUIRED)

include_directories(
${CUDA_INCLUDE_DIRS}
)
...
cuda_add_executable(file file.cu)

Compile is fine now.
Maybe it is just I am not familiar with the "modern" way to compile cuda enough and there are some tricks there...

Operating system: ubuntu 18.04
CUDA version (if applicable):10.1

In my case, this error is caused by the mismatched eigen version and CUDA(>9).
After I remove the old eigen and install the latest version(3.3.90). Compile is fine.

My problem is also solved by upgrading eigen.

For anyone wondering why the compiler refuse to reveal that it is eigen that actually causes the problem (but instead shows the error in cuda_runtime.h), here is the reason that I discovered:

The cmake compiling system includes the eigen headers (and maybe all other headers which may cause this problem, e.g. boost) using the flag -isystem. Different from -I, -isystem assumes that the include folder is a system include folder and will suppress all the warning&note messages from that file.

Hence, for anyone who meet this problem, I would suggest the following procedure to debug:

  • run the makefile with VERBOSE=1 make
  • locate the nvcc compling command which cause this error.
  • change all the -isystem to -I and rerun the nvcc command.
  • Check the compiler output. It should now point out the actual place where this macro is expanded.

This issue may be closed now, but I found an alternative solution that did not require modifying the CUDA headers: upgrade boost to at least 1.65.1 and then try building caffe again.

Doesn't work for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erogol picture erogol  路  3Comments

Ruhjkg picture Ruhjkg  路  3Comments

sdemyanov picture sdemyanov  路  3Comments

dfotland picture dfotland  路  3Comments

serimp picture serimp  路  3Comments