hughperkins / distro-cl

OpenCL Torch
147 stars 17 forks source link

Using cltorch with standard torch #1

Closed vinhqdang closed 8 years ago

vinhqdang commented 8 years ago

Hello

I installed torch as instructed on torch.ch

As I understand now, there is no way to use OpenCL with this distro anymore. Is it correct?

What would happen if I want to keep the standard torch, but also want to use OpenCL with torch? Could I install two distros on the same time?

Thanks,

hughperkins commented 8 years ago

What would happen if I want to keep the standard torch, but also want to use OpenCL with torch? Could I install two distros on the same time?

Yes. by default, the cutting-edge torch distro goes in ~/torch, and the OpenCL distro goes in ~/torch-cl. So, when you want to use cutting-edge torch do eg:

source ~/torch/install/bin/torch-activate
luajit -l cunn -e 'nn.testcuda()'

or for OpenCL torch, do for example:

source ~/torch-cl/install/bin/torch-activate
luajit -l clnn -e 'clnn.test()'
vinhqdang commented 8 years ago

Great!

I have a Nvidia Quadro FX 580 with OpenCL support. Do I have to install Catalyst from AMD, or nvidia-cuda-toolkit on Ubuntu is enough?

hughperkins commented 8 years ago

NVIDIA drivers support OpenCL 1.2. This is all you need :-) Note that clnn will run ~4 times slower or so than cunn, on the same NVIDIA card. But ... we have to start somewhere :-)

vinhqdang commented 8 years ago

👍

Also, I think there is a problem with libqt4-core and libqt4-gui on Ubuntu 16.04.

When I tried to run bash install-deps

It will report that these two packages are not available.

In mainline torch, I think these two packages are removed from install-deps file (https://github.com/torch/distro)

hughperkins commented 8 years ago

Ok. cherry-picked the relevant commit. can you try again please? I confess that personally I eschew all the gui stuff, and just do something like:

sudo apt-get install -y wget git gcc g++ cmake cmake-curses-gui vim language-pack-en gdb 
libffi-dev libblas-dev liblapack-dev gfortran libreadline-dev

(this way I know exactly what it's installing, and without gui stuff, the install.sh command runs a lot faster)

vinhqdang commented 8 years ago

Yes, it should be much easier way

hughperkins commented 8 years ago

Maybe I will provide like a nongui.sh script perhaps???

vinhqdang commented 8 years ago

I think so. Especially for a stupid guy like me.

(well, someone may just want to try Lua and torch and it is quite annoyed if they stuck in installation you know)

hughperkins commented 8 years ago

Addressed in d233b0f Should be a script install-deps-nogui.sh now. It's a bit beta, might be missing one or two packages, but hopefully fairly complete.