Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: token ""__CUDACC_VER__ is no longer supported. #5994

Closed
hanlhan opened this issue Oct 18, 2017 · 12 comments
Closed

error: token ""__CUDACC_VER__ is no longer supported. #5994

hanlhan opened this issue Oct 18, 2017 · 12 comments

Comments

@hanlhan
Copy link

hanlhan commented Oct 18, 2017

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):

@hanlhan
Copy link
Author

hanlhan commented Oct 18, 2017

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.

@hanlhan hanlhan closed this as completed Oct 18, 2017
@ccaamad
Copy link

ccaamad commented Nov 22, 2017

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.

@kol310
Copy link

kol310 commented Jul 3, 2018

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

@lucasjinreal
Copy link

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

@JZDSS
Copy link

JZDSS commented Jun 29, 2019

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

@RyuShai
Copy link

RyuShai commented Aug 27, 2019

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

@zhaozhongch
Copy link

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

@Chuck-Yu
Copy link

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.

@heiwang1997
Copy link

heiwang1997 commented Jul 17, 2020

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.

@WorstCodeWay
Copy link

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

@rajk97
Copy link

rajk97 commented Aug 18, 2023

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.

Upgrading eigen worked for me too.

@dragonQian
Copy link

dragonQian commented Aug 18, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests