MiguelMonteiro / CRFasRNNLayer

Conditional Random Fields as Recurrent Neural Networks (Tensorflow)
MIT License
82 stars 20 forks source link

CUDA compiler fails to compile a simple test program #24

Open gvalvano opened 3 years ago

gvalvano commented 3 years ago

Hello :) thank you for sharing this great work.

I've tried to use your implementation of CRF as RNN. Unfortunately, I cannot compile it anymore since I updated my CUDAs. This is what I've tried to do:

inside permutohedral_lattice/build.sh I used the following configuration:

# define compilers to use
CUDA_COMPILER=$CONDA_PREFIX/bin/nvcc 
CXX_COMPILER=/usr/bin/g++   
CUDA_INCLUDE=$CONDA_PREFIX/include 

# Parameters:
SPATIAL_DIMS=2
INPUT_CHANNELS=4
REFERENCE_CHANNELS=1
MAKE_TESTS=False

cmake -DCMAKE_BUILD_TYPE=Debug -D CMAKE_CUDA_COMPILER=${CUDA_COMPILER} \
                               -D CMAKE_CXX_COMPILER=${CXX_COMPILER} \
                               -D CMAKE_CUDA_HOST_COMPILER=${CXX_COMPILER} \
                               -D CUDA_INCLUDE=${CUDA_INCLUDE} \
                               -D SPATIAL_DIMS="${SPATIAL_DIMS}" \
                               -D INPUT_CHANNELS="${INPUT_CHANNELS}" \
                               -D REFERENCE_CHANNELS="${REFERENCE_CHANNELS}" \
                               -D MAKE_TESTS="${MAKE_TESTS}" \
                               -G "CodeBlocks - Unix Makefiles" ../

Here, $CONDA_PREFIX is the symbolic link created by my conda environment (tf114), and points to:

/home/username/venvs/conda/miniconda3/envs/tf114

However, running build.sh I obtain the following error:

-- The CXX compiler identification is GNU 10.1.0 -- The CUDA compiler identification is unknown -- Check for working CXX compiler: /usr/bin/g++ -- Check for working CXX compiler: /usr/bin/g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working CUDA compiler: /home/username/venvs/conda/miniconda3/envs/tf114/bin/nvcc -- Check for working CUDA compiler: /home/username/venvs/conda/miniconda3/envs/tf114/bin/nvcc -- broken CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCUDACompiler.cmake:46 (message): The CUDA compiler

"/home/username/venvs/conda/miniconda3/envs/tf114/bin/nvcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: [...]/permutohedral_lattice/build_dir/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_5c722/fast"
/usr/bin/make -f CMakeFiles/cmTC_5c722.dir/build.make CMakeFiles/cmTC_5c722.dir/build
make[1]: Entering directory '[...]/permutohedral_lattice/build_dir/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_5c722.dir/main.cu.o
/home/username/venvs/conda/miniconda3/envs/tf114/bin/nvcc -ccbin=/usr/bin/g++    -x cu -c [...]/permutohedral_lattice/build_dir/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_5c722.dir/main.cu.o
/home/username/venvs/conda/miniconda3/envs/tf114/bin/nvcc: line 2: /bin/nvcc: No such file or directory
CMakeFiles/cmTC_5c722.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_5c722.dir/main.cu.o' failed
make[1]: *** [CMakeFiles/cmTC_5c722.dir/main.cu.o] Error 127
make[1]: Leaving directory '[...]/permutohedral_lattice/build_dir/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_5c722/fast' failed
make: *** [cmTC_5c722/fast] Error 2

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred! See also "[...]/permutohedral_lattice/build_dir/CMakeFiles/CMakeOutput.log". See also "[...]/permutohedral_lattice/build_dir/CMakeFiles/CMakeError.log". make: *** No targets specified and no makefile found. Stop.

Do you know what this may be due to? Thanks a lot for any help you can provide :)


Edit I'm using CUDA 10.2