Share this
About
This application stack is composed of three major pieces of software:
- JupyterHub: a login portal for managing multi-user web-based notebooks
- JupyterLab: the next-generation web-based notebook interface
- PyTorch: a powerful machine learning library used for applications such as computer vision, natural language processing, deep learning, neural networks, AI and more.
- Keras: a flexible API for neural networks, machine learning and AI that can work hand-in-hand with PyTorch
This stack of software is configured with matching GPU drivers, support libraries and services to help you test out the application suite quickly.
Installation
From the SHARON AI public web billing portal, choose your desired virtual machine product. We have a wide array of CPU and GPU based virtual machines with dedicated resources that guarantee you performance without contention.
After choosing your product, choose your Operating System and Application. We recommend a recent Ubuntu LTS based distribution such as Ubuntu 22.04 or 24.04 (released in 2022 and 2024 respectively, and each maintained with security patches for 5 years). Older distributions may have problems or performance issues with outdated versions of Python and hardware drivers, and are not recommended.
Configure the rest of the options to suit your needs, including your disk space, SSH public key, etc.
NOTE: The password you set here will be applied to the default `ubuntu` user. We will need this to log in to JupyterHub later.
When happy with your configuration, complete your order process and wait for your virtual machine to start. This process can take several minutes as the application deployment collects the various applications and drivers necessary. Output can be seen in the files `/var/log/cloud-init.log` and `/var/log/cloud-init-output.log`, and for newer distributions followed via the systemd-journal logger using the command `sudo journalctl -f`.
Using the application
JupyterHub and JupyterLab are both web based. These are exposed on port TCP/8000, which you can access in your browser. Find your VM’s IP on your product information page:
So, for example if your product was assigned the IP “123.456.789.123”, you could connect to your JupyterHub service in your browser on “http://123.456.789.123:8000/” .
NOTE: the default application setup uses HTTP and not HTTPS. Please do not use this for secure or sensitive work in this default state. See “Further steps” for tips on how to use SSL/TLS to encrypt your sessions.
Once connected in your browser, you should see the JupyterHub login page:
On your product page under the section “Server Information”, you’ll find your username and password. Typically the username is “ubuntu” (all lower case), and the password is whatever you specified when you created your VM procut. Enter that into JupyterHub, and it will log you in and spawn a JupyterLab instance for you.
From here, you’re ready to use Jupyter and PyTorch! You can run Python based notebooks with the full suite of GPU-accelerated access to tools, use the PyTorch libraries, add even more libraries via “pip install” commands, and more. There’s even a handy terminal app built straight into the browser that will drop you into a shell inside your Python virtual environment and let you either run command line Python tools, or configure your system and add more libraries and applications.
For a quick verification of your GPU capabilities, you can create a new Python3 notebook, and run the following code:
import torch
for i in range(torch.cuda.device_count()):
print(torch.cuda.get_device_properties(i).name)
Here I’ve run this on a VM with a single NVIDIA H100, and I can verify that it’s working with PyTorch and NVIDIA Cuda. If you’ve ordered a product with multiple GPUs, you can verify that PyTorch can interact with all of these from the same command:
Further steps
Where to from here? Some suggestions:
- Add SSL/TLS encryption to JupyterHub for extra security
- Your JupyterHub configuration lives in `/opt/sharonai/jupyterhub_pytorch_nvidia/jupyterhub`, and you can configure it as you see fit. After initial deployment, our tools do no further modification to the running system, and you can manage it freely.
- Read the JupterHub docs for a comprehensive guide on adding certificates and keys. These can be self signed, purchased from a provider, or use free services like LetsEncrypt:
- https://jupyterhub.readthedocs.io/en/latest/tutorial/getting-started/security-basics.html
- These all have different requirements depending on your personal or work-mandated security requirements and software tools. If you need further advice or assistance, please contact SHARON AI support for more information.
- Learn more about PyTorch and Keras
- Read the overview on Wikipedia:
- Browse their online tutorials:
- Search GitHub for interesting PyTorch based projects, software and notebooks:
- Integrate with Hugging Face, and their enormous suite of open source models, code and community tools:
- Utilise ONNX – The Open Neural Network eXchange: