Torch7: Installation failure when running './install.sh'

Created on 12 Oct 2017  路  19Comments  路  Source: torch/torch7

The following are the error messages received after running './install.sh'

1 error detected in the compilation of "/tmp/tmpxft_000005a7_00000000-6_THCTensorMathPairwise.cpp1.ii".
CMake Error at THC_generated_THCTensorMathPairwise.cu.o.cmake:267 (message):
  Error generating file
  /home/vipaacc/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMathPairwise.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:4216: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/vipaacc/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/vipaacc/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_00000605_00000000-6_THCTensorMath.cpp1.ii".
CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message):
  Error generating file
  /home/vipaacc/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
CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.

Most helpful comment

This has been reported and fixed in https://github.com/torch/cutorch/issues/797
Set env var: export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

All 19 comments

i have a same error

Same error, Ubuntu 16.04, cuda 9.0

Same problem, further up the compile log I see:

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

1 error detected in the compilation of "/tmp/tmpxft_000078f9_00000000-6_THCTensorMathPairwise.cpp1.ii".
CMake Error at THC_generated_THCTensorMathPairwise.cu.o.cmake:267 (message):
  Error generating file
  /home/brian/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMathPairwise.cu.o


lib/THC/CMakeFiles/THC.dir/build.make:140: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/brian/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/brian/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_00007911_00000000-6_THCTensorMath.cpp1.ii".
CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message):
  Error generating file
  /home/brian/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:112: 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
CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Ubuntu 16.04, cuda 9.0

This has been reported and fixed in https://github.com/torch/cutorch/issues/797
Set env var: export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

@tastyminerals
Still not working in CUDA 9.1

Are you sure, because I have CUDA 9.1 installed and working with Torch.
Please provide the error message.

@tastyminerals
I've solved this problem.
I used sudo but export is for the current user.

@tastyminerals
Just use su and it will solve this problem.

Met the same question,not work by using method above,any other suggestions?

This worked for me:

sudo su
export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"
bash install-deps
yes | bash ./install.sh

The solution given by @adam-dziedzic worked for me! Thanks!

The solution given by @adam-dziedzic worked for me too! Only a few modifications on ~/torch/install/bin/torch-activate and chown for some files in ~/torch/install/bin. Thanks!

Be careful with the solution that @adam-dziedzic provided because installing torch under sudo su changes the installation path of torch which may break your luarocks package manager.

@mherrera-dsci Did the chown you did on ~/torch/install/bin and the other modifications you did allow you to use luarocks from a non super-user? I'm finding that I can only use luarocks in super-user mode.

The solution given by @adam-dziedzic worked for me too! Only a few modifications on ~/torch/install/bin/torch-activate and chown for some files in ~/torch/install/bin. Thanks!

Hi, could you please tell me how to modify? I found that after using sudo su to install torch, the torch can only be used in su.

This worked for me:

sudo su
export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"
bash install-deps
yes | bash ./install.sh

year, this is also worked for me! I solved this problem.

This worked for me:

sudo su
export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"
bash install-deps
yes | bash ./install.sh

thanks, worked for me

@adam-dziedzic 's solution works for me, however I don't use the command sudo su. Many thxs!

Be careful with the solution that @adam-dziedzic provided because installing torch under sudo su changes the installation path of torch which may break your luarocks package manager.

Yes, mine is broken. How to solve this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suice07 picture suice07  路  5Comments

spiralswimmer picture spiralswimmer  路  6Comments

n3011 picture n3011  路  9Comments

visonpon picture visonpon  路  3Comments

galv picture galv  路  4Comments