# How do you run a Jupyter notebook on a cloud GPU?

> Start a GPU machine with JupyterLab, keep notebooks in the saved home, check the kernel sees the GPU, and stop it before an idle night costs you $36.

Source: https://www.nodus-compute.ai/blog/jupyter-notebook-on-cloud-gpu/
Build revision: 7b5f79d9943e8cdfda9f65e7f3c9a4dc0f846aa0

<!-- vale Nodus.Providers = NO -->

To run a Jupyter notebook on a cloud GPU, start a GPU machine with JupyterLab installed, open it over a private connection, and keep notebooks in a directory that survives a stop. On Nodus that machine is a Workspace: pick a GPU in the console, click **JupyterLab**, and everything in `/home/nodus` is saved when it stops, so tomorrow starts where today ended. The parts that trip people up are a kernel that can’t see the GPU, files written outside the saved home, and a GPU left running all night.

This is the hands-on version. If you are still choosing a notebook service, our [Google Colab alternatives roundup](https://www.nodus-compute.ai/blog/google-colab-alternatives-2026/) compares the options; this post assumes you want the steps.

## What are the steps to open JupyterLab on a Nodus GPU?

The fastest path needs only the browser. The [Workspaces guide](https://www.nodus-compute.ai/docs/guides/workspaces/) describes three steps:

1. Open **Workspaces › New workspace** and choose On-demand or Spot capacity.
2. Click a GPU row and review its availability and hourly estimate.
3. Choose **Launch**, then open **JupyterLab** when it is ready.

The console fills in a name, a Python and PyTorch environment and a saved home folder. You don’t need an SSH key, a startup command or the CLI for the browser tools. JupyterLab opens on a private address that only members of your organization can reach after signing in. One thing to know before you start: launching needs a paid top-up or an approved account review, and promotional credit alone is not enough.

If you prefer the terminal, the same machine is one command after `nodus login`:

Terminal window

```console
$ nodus create workspace lab --gpu H100
$ nodus ssh workspace/lab
nodus@lab:~$ nvidia-smi
```

`--gpu H100:2` asks for two GPUs, and the [CLI reference](https://www.nodus-compute.ai/docs/reference/cli/nodus_create_workspace/) shows `--gpu L4` for a cheaper card. From Python, the [SDK guide](https://www.nodus-compute.ai/docs/guides/python/workspaces/) does the same and opens Jupyter for you:

```python
lab = nodus.Workspace.create("lab", gpu="H100:2", image="nodus/workspace-pytorch-cuda", idle_timeout="2h")
lab.wait_ready()
url = lab.open("vscode")          # or "jupyter"; opens the browser and returns the URL
```

The default image on NVIDIA GPUs is `nodus/workspace-pytorch-cuda`, and every catalog image ships VS Code, JupyterLab and Python. If you would rather write notebooks in VS Code, Cursor or JetBrains Gateway, `nodus login` also configures Remote-SSH for every Workspace you can reach.

## How do you check that the notebook kernel can see the GPU?

Run one cell before anything else, and check two things: which Python the kernel is, and whether that Python sees CUDA.

```python
import sys, torch
print(sys.executable)
print(torch.cuda.is_available(), torch.cuda.device_count())
```

`nvidia-smi` in a terminal tells you the machine has a GPU. It does not tell you the notebook does. The usual reason a notebook says `False` on a GPU machine is that the kernel is a different Python from the one where you installed your packages.

We reproduced that trap on a CPU machine with JupyterLab 4.6.6, since it has nothing to do with the GPU itself. We created a virtual environment under the home directory, installed a package into it, and registered it as a kernel named `train` with ipykernel’s install command and its `--user` flag. Then we ran the same import in both kernels.

The default `python3` kernel raised `ImportError: No module named 'tqdm'`; the `train` kernel imported it. Same machine, same notebook, two answers. If you `pip install` a CUDA build of PyTorch into one environment and run the notebook on another kernel, you get the same split, and `torch.cuda.is_available()` looks broken when it isn’t.

The fix is to pick the kernel that matches your environment from JupyterLab’s kernel menu, and print `sys.executable` to prove it. The same test showed something useful for the next section: `--user` wrote the kernel definition to `~/.local/share/jupyter/kernels/train`, inside the home directory.

## Which notebook files survive when the Workspace stops?

Only what lives in `/home/nodus`. When a Workspace stops, the [docs](https://www.nodus-compute.ai/docs/guides/workspaces/) say its home is saved to a Volume and the machine is released; everything else is temporary.

That has three practical consequences for notebook work:

* Keep notebooks, data and checkpoints under `/home/nodus`. The `/workspace` directory is not saved, despite its name.
* Install packages with `pip install --user` or in a virtual environment under `/home/nodus`, so they come back. A kernel registered with `--user`, as above, comes back with them.
* Kernel memory does not survive. The next start restores your saved home on a fresh machine, so a model or DataFrame that only exists as a variable in a running kernel has to be rebuilt. Write anything expensive to a file.

To pull results down to your laptop while the Workspace runs, copy them out:

Terminal window

```console
nodus cp ws/lab:/home/nodus/results ./results
```

## How do you reach your own Jupyter server without exposing it?

Forward a port to your own machine instead of opening one to the internet. Most people won’t need this, because the built-in JupyterLab is already private. It matters when you run your own server, for example a pinned Jupyter version inside your virtual environment.

When we started `jupyter lab --no-browser` on our test machine (Jupyter Server 2.21.1), it listened on `127.0.0.1:8888` with a login token. That default is the safe one. Keep it, and don’t add `--ip=0.0.0.0`, which listens on every network interface. Then forward the port with [`nodus port-forward`](https://www.nodus-compute.ai/docs/reference/cli/nodus_port-forward/), whose local listener also defaults to `127.0.0.1`:

Terminal window

```console
nodus port-forward workspace/lab 8888
```

Open `http://localhost:8888` with the token Jupyter printed. We built that command from the reference’s `KIND/NAME LOCAL[:REMOTE]` form and have not run it against a live Workspace. For terminal access, `nodus ssh` goes through the Nodus gateway with no port open on the machine. Plain `ssh`, `scp` and `rsync` use the same connection after `nodus login`.

## How much does a notebook GPU cost if you leave it running overnight?

A night is 14 hours from 6 pm to 8 am, and a weekend is 62 hours from Friday 6 pm to Monday 8 am. At the listed prices on the [Nodus pricing page](https://www.nodus-compute.ai/pricing/), that is what a forgotten GPU costs:

|GPU|Listed price|Overnight, 14 h|Weekend, 62 h|Idle stop after 1 h|
|-|-|-|-|-|
|NVIDIA L4 24 GB|$0.430/hr|$6.02|$26.66|$0.43|
|NVIDIA A100 80 GB|$1.090/hr|$15.26|$67.58|$1.09|
|NVIDIA H100 SXM 80 GB|$2.600/hr|$36.40|$161.20|$2.60|

Prices checked November 20, 2026, from the [Nodus pricing page](https://www.nodus-compute.ai/pricing/).

![Cost of an idle notebook GPU at Nodus listed prices: L4 $0.43 after a 1-hour idle stop, $6.02 overnight and $26.66 over a weekend; A100 80 GB $1.09, $15.26 and $67.58; H100 SXM $2.60, $36.40 and $161.20.](https://www.nodus-compute.ai/blog-charts/jupyter-notebook-on-cloud-gpu/idle-cost.svg) *An idle stop turns a $161.20 H100 weekend into $2.60.*

Nodus Workspaces stop on their own after an `idleTimeout`, which defaults to 1 hour. The catch is what counts as idle: no SSH session, editor traffic or process. A kernel still crunching or a terminal left connected keeps the meter running.

For a hard backstop, set `maxCostUSD`, which stops and saves the Workspace at your limit, or a schedule with `stopAt`. While a Workspace is stopped you pay only for the saved files.

## When should a notebook become a job instead?

Our rule: when a cell will run longer than you will sit with it, it belongs in a Job. Notebooks are for the loop where you read output and change code. A run you plan to walk away from needs saves and restarts that don’t depend on your browser.

Here is why, priced. Take a 10-hour fine-tune on one H100 SXM, run inside a notebook cell that saves nothing, and lose the machine at hour 9. You repeat 9 hours: 9 x $2.60 = $23.40.

A Nodus Job with `interval: auto` gets at least four checkpoints over its expected run time, per the [checkpoints guide](https://www.nodus-compute.ai/docs/guides/checkpoints/), so on a 10-hour run the gap is at most 2.5 hours. The worst case is 2.5 x $2.60 = $6.50, and Jobs also checkpoint when capacity gives notice before it is reclaimed.

![Repeated work after losing a 10-hour H100 SXM run at hour 9: $23.40 for a notebook cell with no saves, at most $6.50 for a Nodus Job with automatic checkpoints.](https://www.nodus-compute.ai/blog-charts/jupyter-notebook-on-cloud-gpu/lost-work.svg) *The worst case for the Job is under a third of the notebook loss, and a reclaim with notice loses less.*

You don’t have to move your code by hand. Turn the notebook into a script in the same home directory, then submit it from the Workspace:

Terminal window

```console
$ nodus run --from workspace/lab -- python train.py
```

That saves the Workspace’s current home and pins it as the Job’s read-only input, so later edits in the notebook don’t change the run. Your script still has to save and load its own state under `/nodus/state`. The [checkpoints guide](https://www.nodus-compute.ai/docs/guides/checkpoints/) shows the pattern, and [how to resume training after a spot preemption](https://www.nodus-compute.ai/blog/resume-training-after-spot-preemption/) walks through it for PyTorch.

## Can you get a free cloud GPU notebook?

Yes, with limits. Google Colab’s [FAQ](https://research.google.com/colaboratory/faq.html) says the free version gives GPU access. Its notebooks “can run for at most 12 hours, depending on availability and your usage patterns”, and runtimes time out when idle. Kaggle’s [Notebooks docs](https://www.kaggle.com/docs/notebooks) offer a free NVIDIA Tesla P100 with 12 hours of execution per GPU session, and say you may wait in a queue at busy times.

Nodus bills by the hour from prepaid credit, and its pricing page lists no free GPU hours. Free notebooks are the right call for learning, coursework and short experiments that fit a session. Paying by the hour starts to make sense when you need a specific GPU, more memory than a free card has, files that persist between sessions without remounting Drive, or runs longer than a session. For every free program we could verify, including the research credits, see [how to get free cloud GPUs for AI](https://www.nodus-compute.ai/blog/free-cloud-gpus-for-ai/).

## FAQ

### Can I use VS Code instead of JupyterLab on the same GPU?

Yes. A Workspace serves browser VS Code, JupyterLab and SSH at the same time, and after `nodus login` desktop VS Code and Cursor connect over Remote-SSH. VS Code’s notebook editor then runs against the same kernels and the same saved home.

### Does a stopped Workspace still cost money?

Only for the saved home files, not the GPU. Connecting to a Workspace that stopped by itself starts it again, and the console shows a fresh price quote before it wakes.

### Can several people share one notebook GPU?

A Workspace belongs to a project, and every organization member with access to that project can start it and connect with their own account and key. `spec.sshKeys` limits SSH to the keys you name.

### What happens to my notebooks if the Workspace fails?

A Workspace in the `Failed` phase doesn’t restart, but the home Volume keeps your files. Delete the Workspace and create it again with the same name, and the notebooks are back.

### Which GPU should I pick for a notebook?

The cheapest one your model fits on, because interactive work spends most of its time idle between cells. An L4 is listed at $0.430/hr against $2.600/hr for an H100 SXM; move up when memory or a long run demands it.
