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

CUDA 9.0 + cudnn 7.0 + torch build error #1133

Open
Spiral-Galaxy opened this issue Feb 25, 2018 · 14 comments
Open

CUDA 9.0 + cudnn 7.0 + torch build error #1133

Spiral-Galaxy opened this issue Feb 25, 2018 · 14 comments

Comments

@Spiral-Galaxy
Copy link

I have CUDA 9.0 + cudnn 7.0 on my computer and my OS is Ubuntu 16.04.3.
When I run the code ./install.sh , which is the third line in this official installation guide: http://torch.ch/docs/getting-started.html#installing-torch

And then it threw an error and terminated the compilation.
Here is the error message:

Building on 4 cores
-- Found Torch7 in /home/leonardo/torch/install
-- Removing -DNDEBUG from compile flags
-- TH_LIBRARIES: TH
-- MAGMA not found. Compiling without MAGMA support
-- Autodetected CUDA architecture(s): 5.0
-- got cuda version 9.0
-- Found CUDA with FP16 support, compiling with torch.CudaHalfTensor
-- CUDA_NVCC_FLAGS: -gencode;arch=compute_50,code=sm_50;-DCUDA_HAS_FP16=1
-- THC_SO_VERSION: 0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/leonardo/torch/extra/cutorch/build
[  1%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o
[  2%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o
[  4%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/generated/THC_generated_THCTensorMathPointwiseShort.cu.o
[  4%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/generated/THC_generated_THCTensorMathCompareShort.cu.o
[  5%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/generated/THC_generated_THCTensorMathReduceShort.cu.o
/home/leonardo/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(393): error: more than one operator "==" matches these operands:
            function "operator==(const __half &, const __half &)"
            function "operator==(half, half)"
            operand types are: half == half

/home/leonardo/torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(414): error: more than one operator "==" matches these operands:
            function "operator==(const __half &, const __half &)"
            function "operator==(half, half)"
            operand types are: half == half

2 errors detected in the compilation of "/tmp/tmpxft_000064e3_00000000-4_THCTensorMath.cpp4.ii".
CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message):
  Error generating file
  /home/leonardo/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o


lib/THC/CMakeFiles/THC.dir/build.make:2735: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1

It seems that there is something wrong and the compilation is failed. I cannot use 'th' to start an interactive session.

And I found some answers through the Internet, which suggested to add an environment variable
export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

I have tried but there is no use.

What should I do to complete the installation?

@tastyminerals
Copy link

tastyminerals commented Feb 26, 2018

Did you run ./clean.sh?

./clean.sh
export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"
./install.sh

@Spiral-Galaxy
Copy link
Author

@tastyminerals Thank you! It works.

@Jun0413
Copy link

Jun0413 commented Mar 19, 2018

@Spiral-Galaxy @tastyminerals Hi! Sorry for bothering you. I was also building torch on CUDA9 + cudnn7, and successfully went through the installation process by calling the export command. However, I cannot require cudnn in torch, as 'libcudnn (R5) not found in library path., yet I have cudnn 7 installed and cannot find a libcudnn.so.5. May I know if you have any suggestions for this issue?

@tastyminerals
Copy link

tastyminerals commented Mar 19, 2018

Did you run luarocks install cudnn?

@Naruto-Sasuke
Copy link

vim ./.bashrc
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBARARY_PATH

@ProGamerGov
Copy link

@Jun0413 libcudnn.so.5 is from cuDNN v5. What you want is libcudnn.so.7, which is from cuDNN v7

@kaisark
Copy link

kaisark commented Mar 26, 2018

@Jun0413 you might need to check out the Revision 7 branch:

git clone https://github.com/soumith/cudnn.torch -b R7
cd cudnn.torch
luarocks make cudnn-scm-1.rockspec


Older versions
For version CuDNN R1, checkout the branch R1 For version CuDNN R2, checkout the branch R2 For version CuDNN R3, checkout the branch R3 For version CuDNN R4, checkout the branch R4

@Jun0413
Copy link

Jun0413 commented Mar 26, 2018

@ProGamerGov I actually had tried pointing the library path to libcudnn.so.7, but it looked like the torch which I installed following the official documentation did not support cuDNN v7. Do you know any version that supports v7?
@Naruto-Sasuke The version does not match and I tried your approach which did not work...
@tastyminerals I tried before and it did not help.

@Jun0413
Copy link

Jun0413 commented Mar 26, 2018

Hi all! I just tried https://github.com/soumith/cudnn.torch/issues/383, and it seems that I can normally call require 'cudnn'. Thank you very much!

@Jun0413
Copy link

Jun0413 commented Mar 26, 2018

@kaisark That worked! Thank you very much!

@HopLee6
Copy link

HopLee6 commented Jul 22, 2018

soumith/cudnn.torch#383
is not exist anymore. Please share the solution again. Thanks @Jun0413 !

@weiyx16
Copy link

weiyx16 commented Oct 24, 2018

Hi all! I just tried https://github.com/soumith/cudnn.torch/issues/383, and it seems that I can normally call require 'cudnn'. Thank you very much!

Sorry to find that this issue has gone and I'm facing just the same problem, can you share what you did? Thank u in advance!

@Jun0413
Copy link

Jun0413 commented Oct 24, 2018

@HopLee6 @weiyx16
https://github.com/soumith/cudnn.torch/issues/383
Hey the link works for me.

@weiyx16
Copy link

weiyx16 commented Oct 27, 2018

@HopLee6 @weiyx16
https://github.com/soumith/cudnn.torch/issues/383
Hey the link works for me.
yes, Thank you! I found that myself later, it seems that directly clicking the provided url in your previous answer would lead to a strange place.. Anyway, I have solved the problem, so nice of you!

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

8 participants