jupyterhub and theano -- problems setting LD_LIBRARY_PATH

1,694 views
Skip to first unread message

Ben Willmore

unread,
May 27, 2016, 11:42:40 AM5/27/16
to Project Jupyter
I tried to use theano with jupyterhub, but had no luck. To use the GPU, theano needs to have environment variables set (e.g. PATH=/usr/local/cuda/bin and LD_LIBRARY_PATH=/usr/local/cuda/lib). I tried to set these with EXPORT before running jupyterhub. This works for $PATH, but for some reason, $LD_LIBRARY_PATH does not get passed through to the jupyter notebook.

Any suggestions? Thanks!

Ben

Carol Willing

unread,
May 27, 2016, 12:02:40 PM5/27/16
to Project Jupyter
Hi Ben,

I think it’s possible that you may be running into the issue described
here
(https://github.com/jupyter/notebook/issues/1290#issuecomment-206064636).

Carol
> --
> You received this message because you are subscribed to the Google
> Groups "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jupyter+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/69f465ea-bfe3-4e1c-a2be-35f1f9b02861%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


Carol Willing
Research Software Engineer, Project Jupyter @ Cal Poly
Director, Python Software Foundation

Matthias Bussonnier

unread,
May 27, 2016, 12:14:18 PM5/27/16
to jup...@googlegroups.com
You might also want to have a specific Theano kernelspec that set the
environment, that is to say you need to set the env variable for the
**kernel** that run the code, not the hub.

See for example https://github.com/minrk/a2km that is a util that
helps to manage kernels.
The example show how to set an ENV variable for spark.

Hope that make sens.
--
m
> https://groups.google.com/d/msgid/jupyter/33C8C411-4587-4A72-A138-09513F0225AF%40gmail.com.

Ben Willmore

unread,
May 28, 2016, 6:31:56 AM5/28/16
to Project Jupyter
Thanks for your replies, which led me to a solution -- I added the following to jupyterhub_config_global.py:

import os
c = get_config()
os.environ['LD_LIBRARY_PATH'] = '/usr/local/cuda-7.5/lib64'
c.Spawner.env.update('LD_LIBRARY_PATH')
c.Spawner.env_keep.append('LD_LIBRARY_PATH')

Ben

Carol Willing

unread,
May 28, 2016, 2:57:08 PM5/28/16
to Project Jupyter
Glad that you got it working. If you have any tips for folks working
with Theano and the notebooks, please let us know. Thanks!
>>>> email to jupyter+u...@googlegroups.com <javascript:>.
>>>> To post to this group, send email to jup...@googlegroups.com
>> <javascript:>.
>>>> To view this discussion on the web visit
>>>>
>> https://groups.google.com/d/msgid/jupyter/69f465ea-bfe3-4e1c-a2be-35f1f9b02861%40googlegroups.com.
>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> Carol Willing
>>> Research Software Engineer, Project Jupyter @ Cal Poly
>>> Director, Python Software Foundation
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>> Groups
>>> "Project Jupyter" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send
>> an
>>> email to jupyter+u...@googlegroups.com <javascript:>.
>>> To post to this group, send email to jup...@googlegroups.com
>> <javascript:>.
>>> To view this discussion on the web visit
>>>
>> https://groups.google.com/d/msgid/jupyter/33C8C411-4587-4A72-A138-09513F0225AF%40gmail.com.
>>
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jupyter+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/571c7ced-fe42-4ee4-b384-41c88f1ddd75%40googlegroups.com.

Brian Granger

unread,
May 28, 2016, 3:31:04 PM5/28/16
to Project Jupyter
Would probably be great if you could put a note about this into the
theano docs...
> https://groups.google.com/d/msgid/jupyter/4C33CF85-5EE7-4F70-B30B-4E6C7BCD4809%40gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgra...@calpoly.edu and elli...@gmail.com

Carol Willing

unread,
May 28, 2016, 7:51:06 PM5/28/16
to Project Jupyter
I have filed an issue to track Ben's solution and addition to Jupyter or Theano docs: https://github.com/jupyterhub/jupyterhub/issues/592


For more options, visit https://groups.google.com/d/optout.



--
Carol Willing

Research Software Engineer
Project Jupyter at Cal Poly SLO

Director, Python Software Foundation


Signature strengths
Empathy - Relator - Ideation - Strategic - Learner
Reply all
Reply to author
Forward
0 new messages