MiguelMonteiro / permutohedral_lattice

Permutohedral Lattice C++/CUDA implementation + TensorFlow Op (CPU/GPU)
83 stars 18 forks source link

15 errors detected in the compilation of "/tmp/tmpxft_00002c51_00000000-6_LatticeFilterkernal.cpp1.ii" #2

Closed liferlisiqi closed 6 years ago

liferlisiqi commented 6 years ago

hi, I have tried to use your source code to compiler lattice_filter.so, but there are so many error when I excute sh build.sh the final information is 15 errors detected in the compilation of "/tmp/tmpxft_00002c51_00000000-6_LatticeFilterkernal.cpp1.ii", could help me check where lead to there errors? Thank you

MiguelMonteiro commented 6 years ago

Did you change the compilers paths of the gcc and nvcc compiler in the build.sh script to match the compilers in your machine?

liferlisiqi commented 6 years ago

Yes, I did. My version g++ 4.8 and cuda 9.0. At the beginning of compiling, there are several information show that both tow compiler is work well. All the errors occur after 50% are compile task is done and i see this [50%] Building CUDA object CMakeFiles/lattice_filter.dir/src/LatticeFilterkernel.cu.o

MiguelMonteiro commented 6 years ago

Ok, what system are you using? Linux, Windows, MAC? If you could provided me with the error log that would also help.

liferlisiqi commented 6 years ago

I use Linux, and this is all the error log, thank you very much!!!

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(88): error: operand types are incompatible ("int" and "void *")

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(89): error: expected an expression

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(94): error: operand types are incompatible ("int" and "void *")

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(95): error: expected an expression

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(88): error: label "vd" was referenced but not defined

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(461): error: no instance of function template "createLattice" matches the argument list argument types are: (int, const float , float , MatrixEntry , HashTableGPU<float, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=float, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T , int, int, int, __nv_bool) [with T=float]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(107): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(464): error: no instance of function template "cleanHashTable" matches the argument list argument types are: (, HashTableGPU<float, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=float, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T *, int, int, int, __nv_bool) [with T=float]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(107): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(468): error: no instance of function template "splatCache" matches the argument list argument types are: (int, const float , MatrixEntry , HashTableGPU<float, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=float, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T *, int, int, int, __nv_bool) [with T=float]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(107): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(472): error: no instance of function template "blur" matches the argument list argument types are: (, float , MatrixEntry , int, HashTableGPU<float, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=float, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T *, int, int, int, __nv_bool) [with T=float]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(107): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(477): error: no instance of function template "slice" matches the argument list argument types are: (int, float , MatrixEntry , HashTableGPU<float, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=float, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T *, int, int, int, __nv_bool) [with T=float]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(107): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(461): error: no instance of function template "createLattice" matches the argument list argument types are: (int, const double , double , MatrixEntry , HashTableGPU<double, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=double, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T , int, int, int, __nv_bool) [with T=double]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(109): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(464): error: no instance of function template "cleanHashTable" matches the argument list argument types are: (, HashTableGPU<double, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=double, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T *, int, int, int, __nv_bool) [with T=double]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(109): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(468): error: no instance of function template "splatCache" matches the argument list argument types are: (int, const double , MatrixEntry , HashTableGPU<double, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=double, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T *, int, int, int, __nv_bool) [with T=double]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(109): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(472): error: no instance of function template "blur" matches the argument list argument types are: (, double , MatrixEntry , int, HashTableGPU<double, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=double, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T *, int, int, int, __nv_bool) [with T=double]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(109): here

/home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/PermutohedralLatticeGPU.cuh(477): error: no instance of function template "slice" matches the argument list argument types are: (int, double , MatrixEntry , HashTableGPU<double, , 1>) detected during: instantiation of "void PermutohedralLatticeGPU<T, pd, vd>::filter(T , const T , const T , __nv_bool) [with T=double, pd=, vd=1]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(90): here instantiation of "void LatticeFilter<Eigen::GpuDevice, T>::operator()(const Eigen::GpuDevice &, tensorflow::OpKernelContext , T , const T , const T *, int, int, int, __nv_bool) [with T=double]" /home/mc16/download_models/CRFasRNNLayer/permutohedral_lattice/src/LatticeFilterKernel.cu(109): here

15 errors detected in the compilation of "/tmp/tmpxft_00002c51_00000000-6_LatticeFilterKernel.cpp1.ii". make[2]: [CMakeFiles/lattice_filter.dir/src/LatticeFilterKernel.cu.o] Error 1 make[1]: [CMakeFiles/lattice_filter.dir/all] Error 2 make: *** [all] Error 2 cp: cannot stat ‘lattice_filter.so’: No such file or directory

MiguelMonteiro commented 6 years ago

I think I know what the problem is. The nvcc of CUDA 9.0 is incompatible with gcc 4.8. Since you need a CMAKE_CUDA_HOST_COMPILER as well as a CMAKE_CUDA_COMPILER to compile GPU code these two need to be compatible. Try using gcc 6 or higher, it will probably solve the problem. You can search the web to see which gcc compilers are compatible with which versions of CUDA.

liferlisiqi commented 6 years ago

Thanks very much. You are right, CUDA9.0 is incompatible with gcc 4.8, this should be the problem. I'll update gcc and try again.