hughperkins / cltorch

An OpenCL backend for torch.
Other
289 stars 26 forks source link

Test failed: could not load cltorch, skipping #18

Closed sorrge closed 8 years ago

sorrge commented 9 years ago

Hi,

I've installed cltorch as described here: https://github.com/hughperkins/cltorch During "luarocks make rocks/cltorch-scm-1.rockspec", I had a lot of warnings but no error message. The last line says "cltorch scm-1 is now built and installed in (license: BSD)"

However, when I run "th -l cltorch -e 'cltorch.test()'" afterwards, it says: could not load cltorch, skipping [string "cltorch.test()"]:1: attempt to index global 'cltorch' (a nil value)

szagoruyko commented 9 years ago

have the same problem on a new macbook

hughperkins commented 9 years ago

Hi, if you install the latest version of 'new-easycl' branch, and install that, how well does that work? ie:

git clone --recursive https://github.com/hughperkins/cltorch.git -b new-easycl
cd cltorch
luarocks make rocks/cltorch-scm-1.rockspec
th -l cltorch -e 'a = torch.ClTensor({3,5,2}); print(a); print(a+2)"
sorrge commented 9 years ago

Tried it (without uninstalling the original cltorch, should I?). The installation seemed to be successful. I have the same result: "could not load cltorch, skipping" and then "attempt to call field 'ClTensor' (a nil value)". I am also on a Mac, BTW. Is there some kind of debug mode that will show more information than just "could not load"?

hughperkins commented 9 years ago

Ah, fair enough. Out of ideas for now. If nothing else comes up, I might need remote access to one of your macs ideally, eg using TeamViewer or similar (TeamViewer lets you see what I'm doing whilst I'm doing it).

BTW. Is there some kind of debug mode that will show more information than just "could not load"?

You can use luajit instead of th. If that's still not sufficiently detailed, need to use gdb to run luajit.

hughperkins commented 9 years ago

Hi. I think I'd like to see two things:

No need to uninstall either of these first. I just want to see what things are failing in these. eg, I suspect maybe gfortran or similar might be missing.

szagoruyko commented 9 years ago

adding

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:~/torch/install/lib

to .bash_profile solved the problem

sorrge commented 9 years ago

Thanks! That works. An update to the installation instructions would be nice.

hughperkins commented 9 years ago

Hmmm, is that not already part of torch-activate? However, I shall update the instructions for cltorch to mention this point.

hughperkins commented 9 years ago

Edit: by the way, glad it works. Thank-you very much Sergey for solving this :-)

hughperkins commented 8 years ago

Seems like this can be closed, right?