Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To use MKL 2018 with Theano you MUST set "MKL_THREADING_LAYER=GNU" #1

Open
billpage opened this issue Jan 15, 2018 · 3 comments
Open

Comments

@billpage
Copy link

billpage commented Jan 15, 2018

With Jyptyer worksheet anaconda_kernel:

import theano
from theano import tensor

I get the following error message:

RuntimeErrorTraceback (most recent call last)
<ipython-input-1-78067c42f5c0> in <module>()
----> 1 import theano
      2 from theano import tensor
/opt/conda/lib/python2.7/site-packages/theano/__init__.pyc in <module>()
    122 from theano.printing import pprint, pp
    123 
--> 124 from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
    125                                 scan_checkpoints)
    126 
/opt/conda/lib/python2.7/site-packages/theano/scan_module/__init__.py in <module>()
     39 __contact__ = "Razvan Pascanu <r.pascanu@gmail>"
     40 
---> 41 from theano.scan_module import scan_opt
     42 from theano.scan_module.scan import scan
     43 from theano.scan_module.scan_checkpoints import scan_checkpoints
/opt/conda/lib/python2.7/site-packages/theano/scan_module/scan_opt.py in <module>()
     58 
     59 import theano
---> 60 from theano import tensor, scalar
     61 from theano.tensor import opt, get_scalar_constant_value, Alloc, AllocEmpty
     62 from theano import gof
/opt/conda/lib/python2.7/site-packages/theano/tensor/__init__.py in <module>()
     15 from theano.tensor import opt
     16 from theano.tensor import opt_uncanonicalize
---> 17 from theano.tensor import blas
     18 from theano.tensor import blas_scipy
     19 from theano.tensor import blas_c
/opt/conda/lib/python2.7/site-packages/theano/tensor/blas.py in <module>()
    153 from theano.scalar import bool as bool_t
    154 from theano.tensor import basic as T
--> 155 from theano.tensor.blas_headers import blas_header_text
    156 from theano.tensor.blas_headers import blas_header_version
    157 from theano.tensor.opt import in2out, local_dimshuffle_lift
/opt/conda/lib/python2.7/site-packages/theano/tensor/blas_headers.py in <module>()
    985 
    986 
--> 987 if not config.blas.ldflags:
    988     _logger.warning('Using NumPy C-API based implementation for BLAS functions.')
    989 
/opt/conda/lib/python2.7/site-packages/theano/configparser.pyc in __get__(self, cls, type_, delete_key)
    330             except KeyError:
    331                 if callable(self.default):
--> 332                     val_str = self.default()
    333                 else:
    334                     val_str = self.default
/opt/conda/lib/python2.7/site-packages/theano/configdefaults.pyc in default_blas_ldflags()
   1406             res = try_blas_flag(flags)
   1407             if res:
-> 1408                 check_mkl_openmp()
   1409                 maybe_add_to_os_environ_pathlist('PATH', lib_path[0])
   1410                 return res
/opt/conda/lib/python2.7/site-packages/theano/configdefaults.pyc in check_mkl_openmp()
   1250         import mkl
   1251         if '2018' in mkl.get_version_string():
-> 1252             raise RuntimeError('To use MKL 2018 with Theano you MUST set "MKL_THREADING_LAYER=GNU" in your environement.')
   1253     except ImportError:
   1254         raise RuntimeError("""
RuntimeError: To use MKL 2018 with Theano you MUST set "MKL_THREADING_LAYER=GNU" in your environement.
@billpage
Copy link
Author

Work-round:

import os
os.environ["MKL_THREADING_LAYER"] = "GNU"

Restart kernel.

@ktaletsk
Copy link
Owner

ktaletsk commented Feb 1, 2018

I could not verify the problem with the latest version. My output is:

Using cuDNN version 7005 on context None
Mapped name None to device cuda0: GeForce GTX 780 (0000:02:00.0)

@MohamedElashri
Copy link

I could not verify the problem with the latest version. My output is:

Using cuDNN version 7005 on context None
Mapped name None to device cuda0: GeForce GTX 780 (0000:02:00.0)

If someone else came to here from Google search. One solution could be defining cuda first.

[global]
device = cuda
floatX = float32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants