Installing theano 0.9 with GPU support on Ubuntu 14.04, TitanX pascal, Cuda8.0

467 Views Asked by At

It's driving me crazy. I'm following this guide to install the required libgpuarray. But I keep on getting errors.

In this guide:

cd <dir>
rm -rf build Build
mkdir Build
cd Build
cmake .. -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_BUILD_TYPE=Release
make
make install
DEVICE="<test device>" make test

cd ..

# Run the following export and add them in your ~/.bashrc file
export CPATH=$CPATH:~/.local/include
export LIBRARY_PATH=$LIBRARY_PATH:~/.local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.local/lib

python setup.py build
python setup.py install --user
cd
DEVICE="<test device>" python -c "import pygpu;pygpu.test()"

I'm supposed to reference my gpu in DEVICE="<test device>". However I tried everything here: gpu, gpu0, etc but it still cannot find any GPU...

I get the following errors:

$python setup.py build
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    raise Exception('cython is too old or not installed '
Exception: cython is too old or not installed (at least 0.25 required)

which I just ignore since my pip is not able to install a lower version than the one that is globally installed, although I'm using virtualenv. And finally I get this error:

$DEVICE="gpu0" python -c "import pygpu;pygpu.test()"
ERROR: Failure: ValueError (Unknown device format:gpu)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/myUser/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/test_tools.py", line 5, in <module>
    from .support import (guard_devsup, rand, check_flags, check_meta, check_all,
  File "/home/myUser/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/support.py", line 32, in <module>
    context = gpuarray.init(get_env_dev())
  File "pygpu/gpuarray.pyx", line 634, in pygpu.gpuarray.init (pygpu/gpuarray.c:9407)
  File "pygpu/gpuarray.pyx", line 583, in pygpu.gpuarray.pygpu_init (pygpu/gpuarray.c:9073)
ValueError: Unknown device format:gpu

----------------------------------------------------------------------
Ran 7 tests in 0.002s

FAILED (errors=7)

Edit:
Ok, so it compiles now when using "cuda0"

DEVICE="cuda0" python -c "import pygpu;pygpu.test()"

but still the computation seems to fail:

======================================================================
FAIL: pygpu.tests.test_blas.test_rgemmBatch_3d(16, 16, 9, 16, 'float32', ('f', 'f', 'c'), (False, False), False, 1, True, True, 0.6, 0.6)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/myUser/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/support.py", line 39, in f
    func(*args, **kwargs)
  File "/home/myUser/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/test_blas.py", line 225, in rgemmBatch_3d
    numpy.testing.assert_allclose(cr, numpy.asarray(gr), rtol=1e-5)
  File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 1392, in assert_allclose
    verbose=verbose, header=header)
  File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 739, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=1e-05, atol=0

(mismatch 99.9565972222%)
 x: array([[[ 364.203369,  258.57843 ,  282.774231, ...,  322.785706,
          185.089233,  300.292389],
        [ 203.502457,  226.207962,  202.701843, ...,  213.377808,...
 y: array([[[ 239.617569,  217.584824,  167.131165, ...,  211.116486,
          313.409271,  244.467926],
        [ 248.086868,  237.813416,  164.860977, ...,  216.871902,...

----------------------------------------------------------------------
Ran 7292 tests in 177.637s

FAILED (failures=137)
0

There are 0 best solutions below