Cutorch installation issue

1,030 views
Skip to first unread message

Riddhiman Dasgupta

unread,
Nov 13, 2014, 4:18:05 PM11/13/14
to tor...@googlegroups.com
-- Build files have been written to: /tmp/luarocks_cutorch-scm-1-8303/cutorch/build
[  7%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir//./THC_generated_THC.cu.o
In file included from /tmp/luarocks_cutorch-scm-1-8303/cutorch/lib/THC/THCBlas.h:4:0,
                 from /tmp/luarocks_cutorch-scm-1-8303/cutorch/lib/THC/THCBlas.cu:1,
                 from /tmp/luarocks_cutorch-scm-1-8303/cutorch/lib/THC/THC.cu:4:
/tmp/luarocks_cutorch-scm-1-8303/cutorch/lib/THC/THCGeneral.h:4:23: fatal error: THGeneral.h: No such file or directory
compilation terminated.
CMake Error at THC_generated_THC.cu.o.cmake:206 (message):
  Error generating
  /tmp/luarocks_cutorch-scm-1-8303/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THC.cu.o


make[2]: *** [lib/THC/CMakeFiles/THC.dir/./THC_generated_THC.cu.o] Error 1
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
make: *** [all] Error 2

Error: Build error: Failed building.


This is the error I keep running into whenever I try to install cutorch. The weird thing is that require 'cutorch' works fine, but require 'cunn' or 'cunnx' says that 'cutorch' is a dependency and needs to be installed, and then this happens. Any help to fix this is much appreciated.

soumith

unread,
Nov 13, 2014, 10:22:29 PM11/13/14
to torch7 on behalf of Riddhiman Dasgupta
Can you please specify your OS?
Also, can you reinstall torch and cutorch with
luarocks install torch
luarocks install cutorch

--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at http://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.

Riddhiman Dasgupta

unread,
Nov 13, 2014, 11:00:20 PM11/13/14
to tor...@googlegroups.com
OS is Ubuntu 12.04.4 LTS.
I installed Torch by following the instructions here: https://github.com/clementfarabet/torchinstall/blob/master/install-torch
I do not have luarocks installed. Do you want me to uninstall whatever I installed and reinstall using the luarocks method?

On Friday, November 14, 2014 8:52:29 AM UTC+5:30, smth chntla wrote:
Can you please specify your OS?
Also, can you reinstall torch and cutorch with
luarocks install torch
luarocks install cutorch

soumith

unread,
Nov 13, 2014, 11:17:53 PM11/13/14
to torch7 on behalf of Riddhiman Dasgupta
oh wow, can you please use https://github.com/torch/torch7/wiki/Cheatsheet for any and all instructions.
That repo you installed from is sooo old and I have no clue what it has.

How did you find that repo at all?

Riddhiman Dasgupta

unread,
Nov 14, 2014, 12:36:02 AM11/14/14
to tor...@googlegroups.com
OK, I removed all existing Torch and Lua files and folders, and reinstalled everything using the instructions over at the cheatsheet.
All modules installed correctly using luarocks, and I can even see them using luarocks list.
However, when I start Torch using th, and try to load a module, this is what I am getting currently:
th> require 'cutorch'
[string "require 'cutorch'"]:1: loop or previous error loading module 'cutorch'
stack traceback:
[C]: in function 'require'
[string "require 'cutorch'"]:1: in main chunk
[C]: in function 'xpcall'
/home/sanchit/local/share/lua/5.1/trepl/init.lua:769: in function 'repl'
/home/sanchit/local/lib/luarocks/rocks/trepl/scm-1/bin/th:183: in main chunk
[C]: at 0x004050d0
                                                                      [0.0001s]

This is happening for all modules. What did I do wrong?


On Friday, November 14, 2014 9:47:53 AM UTC+5:30, smth chntla wrote:
oh wow, can you please use https://github.com/torch/torch7/wiki/Cheatsheet for any and all instructions.
That repo you installed from is sooo old and I have no clue what it has.

How did you find that repo at all?

soumith

unread,
Nov 14, 2014, 12:42:30 AM11/14/14
to torch7 on behalf of Riddhiman Dasgupta
did you use the clean-old.sh script to cleanup? https://github.com/torch/ezinstall/blob/master/clean-old.sh

Can you just try a locally contained installed using this: https://github.com/soumith/torch-distro
I am not sure if there are system files that are conflicting still. This locally contained install will give you a torch that is only fully installed into this folder and nowhere else.

Riddhiman Dasgupta

unread,
Nov 14, 2014, 12:46:27 AM11/14/14
to tor...@googlegroups.com
I had installed everything locally. I'll try to use the clean-old.sh script by changing the directory paths, to make sure I didn't miss anything.


On Friday, November 14, 2014 11:12:30 AM UTC+5:30, smth chntla wrote:
did you use the clean-old.sh script to cleanup? https://github.com/torch/ezinstall/blob/master/clean-old.sh

Can you just try a locally contained installed using this: https://github.com/soumith/torch-distro
I am not sure if there are system files that are conflicting still. This locally contained install will give you a torch that is only fully installed into this folder and nowhere else.

Riddhiman Dasgupta

unread,
Nov 14, 2014, 1:03:56 AM11/14/14
to tor...@googlegroups.com
I cleaned up everything yet again, and installed yet again. Same problem as before. Trying to load any module gives the same error.
 require 'nn'
 require 'nn'
[string " require 'nn'"]:1: loop or previous error loading module 'nn'
stack traceback:
[C]: in function 'require'
[string " require 'nn'"]:1: in main chunk
[C]: in function 'xpcall'
/home/user/local/share/lua/5.1/trepl/init.lua:769: in function 'repl'
/home/user/local/lib/luarocks/rocks/trepl/scm-1/bin/th:183: in main chunk
[C]: at 0x004050d0



On Friday, November 14, 2014 11:12:30 AM UTC+5:30, smth chntla wrote:
did you use the clean-old.sh script to cleanup? https://github.com/torch/ezinstall/blob/master/clean-old.sh

Can you just try a locally contained installed using this: https://github.com/soumith/torch-distro
I am not sure if there are system files that are conflicting still. This locally contained install will give you a torch that is only fully installed into this folder and nowhere else.
On Fri, Nov 14, 2014 at 12:36 AM, Riddhiman Dasgupta via torch7 <torch7+APn2wQeNHKc-IzgwSDiWYp4O9xfeR6iToU_yl26WAKKTOHO-rgJzVZ0oY@googlegroups.com> wrote:
OK, I removed all existing Torch and Lua files and folders, and reinstalled everything using the instructions over at the cheatsheet.
All modules installed correctly using luarocks, and I can even see them using luarocks list.
However, when I start Torch using th, and try to load a module, this is what I am getting currently:
th> require 'cutorch'
[string "require 'cutorch'"]:1: loop or previous error loading module 'cutorch'
stack traceback:
[C]: in function 'require'
[string "require 'cutorch'"]:1: in main chunk
[C]: in function 'xpcall'
/home/user/local/share/lua/5.1/trepl/init.lua:769: in function 'repl'
/home/user/local/lib/luarocks/rocks/trepl/scm-1/bin/th:183: in main chunk
[C]: at 0x004050d0
                                                                      [0.0001s]

Riddhiman Dasgupta

unread,
Nov 14, 2014, 1:15:30 AM11/14/14
to tor...@googlegroups.com
I have also tried using the torch-distro installation you provided. Still the same error.


On Friday, November 14, 2014 11:12:30 AM UTC+5:30, smth chntla wrote:
did you use the clean-old.sh script to cleanup? https://github.com/torch/ezinstall/blob/master/clean-old.sh

Can you just try a locally contained installed using this: https://github.com/soumith/torch-distro
I am not sure if there are system files that are conflicting still. This locally contained install will give you a torch that is only fully installed into this folder and nowhere else.

Cyril b-r

unread,
Nov 14, 2014, 9:21:32 AM11/14/14
to tor...@googlegroups.com
I have a very similar error.

th> require 'nn'
/usr/local/share/lua/5.1/nn/init.lua:1: loop or previous error loading module 'torch'
stack traceback:
[C]: in function 'require'
/usr/local/share/lua/5.1/nn/init.lua:1: in main chunk
[C]: in function 'f'
[string "local f = function() return require 'nn' end ..."]:1: in main chunk
[C]: in function 'xpcall'
/usr/local/share/lua/5.1/trepl/init.lua:553: in function </usr/local/share/lua/5.1/trepl/init.lua:489>

I am on osx 10.9.3.
Any help appreciated. I have been trying to go through the tutorial, but I cannot import any package.

Thanks in advance.
Cyril

Cyril b-r

unread,
Nov 14, 2014, 9:30:02 AM11/14/14
to tor...@googlegroups.com
And I get the same error with the locally installed torch-distro.

Cyril b-r

unread,
Nov 17, 2014, 2:13:22 AM11/17/14
to tor...@googlegroups.com
My g++ compiler was buggy, and the install script did not install everything properly I suppose.
Re-installing/updating xcode + cleaning torch with the script fixed my issue.

Ozan Arkan Can

unread,
Nov 17, 2014, 3:18:24 AM11/17/14
to tor...@googlegroups.com
I got same error on Ubuntu 14.04

14 Kasım 2014 Cuma 08:03:56 UTC+2 tarihinde Riddhiman Dasgupta yazdı:

soumith

unread,
Nov 17, 2014, 4:32:55 AM11/17/14
to torch7 on behalf of Ozan Arkan Can
I fixed this today in trunk. Please reinstall and check.

Ozan Arkan Can

unread,
Nov 19, 2014, 7:01:21 AM11/19/14
to tor...@googlegroups.com
It works. Thanks.

17 Kasım 2014 Pazartesi 11:32:55 UTC+2 tarihinde smth chntla yazdı:
I fixed this today in trunk. Please reinstall and check.
Reply all
Reply to author
Forward
0 new messages