Faster-RCNN_TF icon indicating copy to clipboard operation
Faster-RCNN_TF copied to clipboard

warning: calling a constexpr __host__ function from a __host__ __device__ function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

Open XChuanLee opened this issue 8 years ago • 5 comments

I'm not familier to this. when i make in /lib, there come a lot warnings, i'm not sure if it can work. Could anyone answer my question... I'm truely confused...

Here's my log, it doesn't look like right...

irondroid@PC:~/Faster-RCNN_TF-master/lib$ make python setup.py build_ext --inplace running build_ext cythoning utils/bbox.pyx to utils/bbox.c building 'utils.cython_bbox' extension creating build creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/utils {'gcc': ['-Wno-cpp', '-Wno-unused-function']} gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/home/irondroid/anaconda2/include/python2.7 -c utils/bbox.c -o build/temp.linux-x86_64-2.7/utils/bbox.o -Wno-cpp -Wno-unused-function gcc -pthread -shared -L/home/irondroid/anaconda2/lib -Wl,-rpath=/home/irondroid/anaconda2/lib,--no-as-needed build/temp.linux-x86_64-2.7/utils/bbox.o -L/home/irondroid/anaconda2/lib -lpython2.7 -o /home/irondroid/Faster-RCNN_TF-master/lib/utils/cython_bbox.so cythoning utils/nms.pyx to utils/nms.c building 'utils.cython_nms' extension {'gcc': ['-Wno-cpp', '-Wno-unused-function']} gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/home/irondroid/anaconda2/include/python2.7 -c utils/nms.c -o build/temp.linux-x86_64-2.7/utils/nms.o -Wno-cpp -Wno-unused-function gcc -pthread -shared -L/home/irondroid/anaconda2/lib -Wl,-rpath=/home/irondroid/anaconda2/lib,--no-as-needed build/temp.linux-x86_64-2.7/utils/nms.o -L/home/irondroid/anaconda2/lib -lpython2.7 -o /home/irondroid/Faster-RCNN_TF-master/lib/utils/cython_nms.so cythoning nms/cpu_nms.pyx to nms/cpu_nms.c building 'nms.cpu_nms' extension creating build/temp.linux-x86_64-2.7/nms {'gcc': ['-Wno-cpp', '-Wno-unused-function']} gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/home/irondroid/anaconda2/include/python2.7 -c nms/cpu_nms.c -o build/temp.linux-x86_64-2.7/nms/cpu_nms.o -Wno-cpp -Wno-unused-function gcc -pthread -shared -L/home/irondroid/anaconda2/lib -Wl,-rpath=/home/irondroid/anaconda2/lib,--no-as-needed build/temp.linux-x86_64-2.7/nms/cpu_nms.o -L/home/irondroid/anaconda2/lib -lpython2.7 -o /home/irondroid/Faster-RCNN_TF-master/lib/nms/cpu_nms.so cythoning nms/gpu_nms.pyx to nms/gpu_nms.cpp building 'nms.gpu_nms' extension {'gcc': ['-Wno-unused-function'], 'nvcc': ['-arch=sm_35', '--ptxas-options=-v', '-c', '--compiler-options', "'-fPIC'"]} /usr/local/cuda/bin/nvcc -I/home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/usr/local/cuda/include -I/home/irondroid/anaconda2/include/python2.7 -c nms/nms_kernel.cu -o build/temp.linux-x86_64-2.7/nms/nms_kernel.o -arch=sm_35 --ptxas-options=-v -c --compiler-options '-fPIC' ptxas info : 0 bytes gmem ptxas info : Compiling entry function '_Z10nms_kernelifPKfPy' for 'sm_35' ptxas info : Function properties for _Z10nms_kernelifPKfPy 0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads ptxas info : Used 25 registers, 1280 bytes smem, 344 bytes cmem[0], 8 bytes cmem[2] {'gcc': ['-Wno-unused-function'], 'nvcc': ['-arch=sm_35', '--ptxas-options=-v', '-c', '--compiler-options', "'-fPIC'"]} gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/usr/local/cuda/include -I/home/irondroid/anaconda2/include/python2.7 -c nms/gpu_nms.cpp -o build/temp.linux-x86_64-2.7/nms/gpu_nms.o -Wno-unused-function cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from /home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0, from /home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18, from /home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from nms/gpu_nms.cpp:283: /home/irondroid/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp] #warning "Using deprecated NumPy API, disable it by "
^ g++ -pthread -shared -L/home/irondroid/anaconda2/lib -Wl,-rpath=/home/irondroid/anaconda2/lib,--no-as-needed build/temp.linux-x86_64-2.7/nms/nms_kernel.o build/temp.linux-x86_64-2.7/nms/gpu_nms.o -L/usr/local/cuda/lib64 -L/home/irondroid/anaconda2/lib -Wl,-R/usr/local/cuda/lib64 -lcudart -lpython2.7 -o /home/irondroid/Faster-RCNN_TF-master/lib/nms/gpu_nms.so rm -rf build sh make.sh /home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include /home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1052): warning: calling a constexpr host function("real") from a host device function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1052): warning: calling a constexpr host function("imag") from a host device function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1052): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1052): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1057): warning: calling a constexpr host function("real") from a host device function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1057): warning: calling a constexpr host function("imag") from a host device function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1057): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

/home/irondroid/anaconda2/lib/python2.7/site-packages/tensorflow/include/unsupported/Eigen/CXX11/../../../Eigen/src/Core/MathFunctions.h(1057): warning: calling a constexpr host function from a host device function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.

XChuanLee avatar Nov 10 '16 09:11 XChuanLee

I have the same warning ,but all things can work well. You can run demo and train net.

miraclebiu avatar Nov 11 '16 03:11 miraclebiu

what about your environment? is tensorflow installed by pip or make by yourself? cuda version is 7.5, cudnn is v3 in my environment.

emily2he avatar Nov 25 '16 03:11 emily2he

My environment is CUDA 8.0 cudnn 5, work well (demo and test) If you think The experimental flag '--expt-relaxed-constexpr' can be used to allow this. is annoyed you can modify make.sh like below, add --expt-relaxed-constexpr

if [ -d "$CUDA_PATH" ]; then
	nvcc -std=c++11 -c -o roi_pooling_op.cu.o roi_pooling_op_gpu.cu.cc \
		-I $TF_INC -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC $CXXFLAGS \
		-arch=sm_37 --expt-relaxed-constexpr

xxi511 avatar Jan 04 '17 11:01 xxi511

I meet the same problem and my tensorflow is installed by pip, CUDA 8.0 cudnn 5? can you help me ?

angelfish91 avatar Feb 03 '17 18:02 angelfish91

I experienced this problem in some of my own cuda code. I'm currently figuring out how to get rid of it since it doesn't seem to be right. For me it happens when using thrust::exp in a host function. Oddly enough compiling the same code with gcc works perfectly fine but compiling when it with nvcc and gcc it spits out those warnings but still works perfectly fine.

So for now just ignore it - I will try to update you if I found a solution.

EDIT:

It seems like you can't really get rid of those warnings except with --expt-relaxed-constexpr which I'd strongly advise against since you don't know with what else in the code it might interfere. As long as everything still works it happens to be only host code and everything should be fine. I know it's annoying but just ignore those warnings.

Nummer42O avatar Nov 18 '21 15:11 Nummer42O