Using JupyterLab on AI.Panther

JupyterLab can be used on AI.Panther by launching it inside an interactive Slurm job on a compute node and forwarding the Jupyter port to your local machine over SSH.

Jupyter must not be run on login nodes.

Prerequisites

Before starting JupyterLab, you should have:

  • A working Python environment (e.g., Conda or venv)

  • JupyterLab installed in that environment

  • An IPython kernel registered for the environment

Install Jupyter and kernel (inside your environment)

Activate your environment first, then run:

conda install -c conda-forge jupyterlab ipykernel

Register the kernel:

python -m ipykernel install --user --name myenv --display-name "Python (myenv)"

Step 1: Start an Interactive Job

Jupyter must run on a compute node, not the login node.

CPU example

srun -p med --nodes=1 --ntasks=1 --mem=50G --time=01:00:00 --pty bash -i

GPU example

srun -p gpu1 --nodes=1 --ntasks=1 --mem=50G --time=01:00:00 --pty bash -i

Adjust partition, time, and memory based on your workload.

Step 2: Launch JupyterLab on the Compute Node

Once inside the interactive job:

NODE=$(hostname -f)
BASE=$(( 8000 + ($UID % 1000) ))

jupyter lab --no-browser --ip="$NODE" --port=$BASE --port-retries=200

Jupyter will print a URL similar to:

http://node01:8123/lab?token=...

Make note of:

  • Compute node name

  • Port number

Step 3: Forward the Port from Your Local Machine

On your local computer, open a new terminal (PowerShell, Terminal, etc.) and run:

ssh -N -L LOCAL_PORT:COMPUTE_NODE:REMOTE_PORT username@ai-panther.fit.edu

Example

If Jupyter printed:

http://node01:8123/...

Run:

ssh -N -L 8123:node01:8123 username@ai-panther.fit.edu

Keep this SSH session open.

Note: If you see an error like bind [127.0.0.1]:8123: Permission denied,it means the local port you requested is already in use. Simply choose a different local port.

Example:

ssh -N -L 8124:node01:8123 username@ai-panther.fit.edu

Step 4: Open JupyterLab in Your Browser

In your local browser, go to:

http://localhost:8123/lab

Enter your token in the password field (all characters after token=).

Stopping Jupyter

  • Press Ctrl+C in the compute-node terminal to stop Jupyter

  • Exit the interactive job:

    exit
    
  • Close the SSH port-forwarding session

Notes & Best Practices

  • Do not run Jupyter on login nodes

  • Use interactive jobs for development and exploration

  • For long-running or production workloads, use batch jobs instead

  • Memory-heavy environments (large Conda solves, ML stacks) should be created on compute nodes

  • If multiple Jupyter instances are running, the port auto-selection avoids collisions