JupyterHub and PyTorch

Server room showcasing Sharon AI’s GPU infrastructure

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.

7cef87f245f3f4f8babdd60e1a582899ab119f124456b015754724079b2615940862e79b0e4afca9?t=5570bc20efdc1946b1442538d2946896

 

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:

82f193e7e93c4d297c7d5c8f9862a6181bb89f50b38fcddf743910bcd6383074c3dc5209595850a8?t=0a671fec93b4e9704cd516f8ce1ddf28

 

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.

 

5f2adba3c5d70fa7a15b57a3ee183f606e673b67a5eafbada996aa4d05ea92528ce6a2c092a931d7?t=59a737d1f127f48de7339a999b733133

 

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:

6dda8bbd608885c979274fc88302b1a63d194e294b5dbc7f179c63484dd2e0f353ae378b89230e53?t=749685d201c48f787ea9bee8957e0ce9

 

Further steps

Where to from here?  Some suggestions:

 


Related Articles

News & Updates

Want to learn more?

×
By clicking the "submit" button, you agree to and accept our Terms & Conditions and Privacy Policy .
×
By clicking the "submit" button, you agree to and accept our Terms & Conditions and Privacy Policy .
×
By clicking the "submit" button, you agree to and accept our Terms & Conditions and Privacy Policy .
×
By clicking the "submit" button, you agree to and accept our Terms & Conditions and Privacy Policy .
Calculator Icon

Pricing Calculator

GPU Cost in Seconds

Loading...
-
/ hourly cost

Estimate GPU Cloud Costs Instantly

Calculate your GPU cloud computing costs with our interactive pricing tool.

Billing Type

Product Type

GPU Type

Hardware Configuration

Contract Options

No contract discount applied
best value

GPU Plan Estimate

Hourly Cost
Loading...
-
Total cost per month
Loading...
-
Total cost
Loading...
-

Prices shown include all applicable discounts

Total cost per month
Loading...
-
Total cost
Loading...
-