Theano in JupyterHub on the Ubuntu DSVM RRS feed

  • General discussion

  • The GPU version of Theano is available on the Ubuntu DSVM. To run Theano on a GPU in in JupyterHub, you need to set two environment variables so it can find cuDNN. Before importing Theano in a notebook, add these lines:

    import os
    os.environ['CUDA_ROOT'] ='/usr/local/cuda-8.0'
    os.environ['LIBRARY_PATH'] = '/usr/local/cuda-8.0/lib64'

    Theano will then run on the GPU. 

    The tutorials at deeplearning.net are a great way to get started with Theano if you're new to the framework.

    Tuesday, June 6, 2017 6:06 PM

All replies

  • Paul,

    Is there some kind of bugtracker for Ubuntu DSVM? Where we can post suggestions?

    (the issue I want to report about is connected to this topic)
    Friday, August 4, 2017 1:46 AM
  • Hi Sergey,

    For the moment please feel free to post your suggestions here on the forum itself, we do monitor this frequently.

    If and when we introduce a more formal channel we will inform the DSVM community.

    If suggestions or discussions are business sensitive to you, please feel free to reach out to me directly on LinkedIn @ Barnam Bora - LinkedIn.



    Friday, August 4, 2017 2:27 AM
  • Hi Barnam,

    1. So environment variables for JupyterHub in your Ubuntu DSVM are configured in /etc/jupyterhub/jupyterhub_config.py. There are two specific lines:

    os.environ['LD_LIBRARY_PATH'] = 'blah-blah 1'
    os.environ['PYTHONPATH'] = 'blah-blah 2'

    With these settings Theano can't find cudnn and fails. I added one more line that fixes the issue:

    os.environ['LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']

    2. JupyterHub uses local users' login/pwd for authentication. As most of people, I think, generated keys to access vm via ssh, their users don't have passwords what makes it impossible to login to JupyterHub. I fixed this issue by creating additional user, linking .theano, .keras, and notebooks directories to this additional user's home dir and setting default access permissions so the new files created by JupyterHub are also accessible by my main user.

    3. JupyterHub self-signed certificate misses a field that makes Chrome to count certificate as broken, so I couldn't access JupyterHub by https.

    All these small issues are making DSVM experience horrible for Linux-beginners like me. I've spent almost two days fixing them and from the links and questions I found on SO and other places during the process it looks like I'm not alone. Hope this feedback helps you to improve the DSVM. Feel free to ask for details if needed.


    Friday, August 4, 2017 1:09 PM