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

Trying to call nvcc with an OpenCL context #2190

Closed
marcino239 opened this issue Oct 19, 2014 · 7 comments
Closed

Trying to call nvcc with an OpenCL context #2190

marcino239 opened this issue Oct 19, 2014 · 7 comments

Comments

@marcino239
Copy link

I'm not sure what the status of opencl implementation is in theano, but I'm getting the following exception when running example from deeplearning.net:

(trusty)marcino@localhost:~/work/DeepLearningTutorials/code$ THEANO_FLAGS="device=opencl0:0,floatX=float32" python logistic_sgd.py 
Using device opencl0:0: Mali-T604
... loading data
... building the model
Traceback (most recent call last):
  File "logistic_sgd.py", line 438, in <module>
    sgd_optimization_mnist()
  File "logistic_sgd.py", line 340, in sgd_optimization_mnist
    y: train_set_y[index * batch_size: (index + 1) * batch_size]
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function.py", line 265, in function
    profile=profile)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/pfunc.py", line 511, in pfunc
    on_unused_input=on_unused_input)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function_module.py", line 1341, in orig_function
    defaults)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/compile/function_module.py", line 1207, in create
    _fn, _i, _o = self.linker.make_thunk(input_storage=input_storage_lists)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/link.py", line 489, in make_thunk
    output_storage=output_storage)[:3]
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/vm.py", line 891, in make_all
    no_recycling))
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/op.py", line 724, in make_thunk
    output_storage=node_output_storage)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 1023, in make_thunk
    keep_lock=keep_lock)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 965, in __compile__
    keep_lock=keep_lock)
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 1395, in cthunk_factory
    key = self.cmodule_key()
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 1104, in cmodule_key
    compile_args=self.compile_args(),
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/gof/cc.py", line 822, in compile_args
    ret += c_compiler.compile_args()
  File "/usr/local/lib/python2.7/dist-packages/Theano-0.6.0-py2.7.egg/theano/sandbox/gpuarray/comp.py", line 43, in compile_args
    raise Exception, "Trying to call nvcc with an OpenCL context"
Exception: ('The following error happened while compiling the node', GpuCrossentropySoftmaxArgmax1HotWithBias(GpuDot22.0, b, GpuElemwise{Cast{int32}}[]<gpuarray>.0), '\n', 'Trying to call nvcc with an OpenCL context')
@abergeron
Copy link
Member

Most of the ops are CUDA-only, but not all of them indicate it correctly. If you have time, you could help porting the ops properly so that they actually work on OpenCL.

@nouiz
Copy link
Member

nouiz commented Oct 20, 2014

Porting the code to OpenCL would be the best. But if you want to help but don't have enough time for this, just making sure that the op that are cuda only don't get inserted in the graph when we use opencl would help.

I did a commit in this PR that tag 2 optimization to don't introduce CUDA only op. If you find more, you can make tag those optimization to do this the same way.

#2192

@marcino239
Copy link
Author

Ok - I'll see what I can do. Where's the best place to ask questions on graph / algo details? Github or theano-users mail group?

@abergeron
Copy link
Member

theano-users

@nouiz nouiz closed this as completed May 20, 2015
@jongwook
Copy link

I still see the same error with Theano 0.7 and Theano/libgpuarray@34967bb.

Any reason or follow-up issue that could explain why this is closed?

@abergeron
Copy link
Member

This was fixed in the theano master with #3364

@nouiz
Copy link
Member

nouiz commented Sep 23, 2015

So you need to use the development version:

http://deeplearning.net/software/theano/install.html#bleeding-edge-install-instructions

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

4 participants