Prerequisites: which GPU for notebook work
A notebook is interactive, so the GPU sits idle while you read output and write the next cell. That makes the hourly rate matter more than peak speed. Pick the smallest card whose memory holds your model, data batch and optimizer state, and move long training runs to a script once the code works.
As a rough guide, a 24 GB card such as the L4 or RTX 4090 handles exploration, small-model fine-tuning with adapters and most computer vision work. A 48 GB L40S fits larger models at 16-bit. An 80 GB H100 or A100 makes sense when a notebook loads a 30B-class model or you are prototyping code that will later run at scale. The how to choose a GPU for AI guide and the LLM VRAM budget go deeper on sizing.
You also need a Linux instance with the NVIDIA driver loaded, SSH key access, Python 3 and a persistent disk for notebooks and datasets.
| Notebook workload | Starting GPU memory | Example cards |
|---|---|---|
| Data exploration, classic ML, small CNNs | 16 to 24 GB | L4, RTX 4090 |
| LoRA on a 7B to 8B model, diffusion experiments | 24 to 48 GB | RTX 4090, L40S |
| Loading a 30B-class model at 16-bit | 80 GB | H100, A100 80 GB |
| Prototyping multi-GPU code | Several 80 GB cards | Multi-GPU H100 node |
References: NVIDIA GeForce RTX 4090 specifications · NVIDIA L4 specifications · NVIDIA L40S specifications · NVIDIA H100 specifications · NVIDIA A100 specifications
Step 1: check the GPU and create an environment
SSH in and run nvidia-smi. Confirm the product name, total memory and driver version match what you rented. The header also shows the highest CUDA version the driver supports, which limits which PyTorch build will run.
Create a virtual environment so notebook packages stay separate from the system: python3 -m venv ~/nb, then source ~/nb/bin/activate. Upgrade pip with pip install --upgrade pip. Keep the environment and your notebooks on the persistent disk so a restart does not wipe them.
References: NVIDIA System Management Interface · Jupyter documentation: installing Jupyter Notebook
Step 2: install JupyterLab, PyTorch and a kernel
Install JupyterLab with pip install jupyterlab. If you prefer the classic interface, the Jupyter docs give pip3 install jupyter. Then install PyTorch using the exact command the PyTorch Get Started selector produces for Linux, pip and your CUDA version; pick a CUDA version at or below the one nvidia-smi reports.
Register the environment as a named kernel so notebooks always run against it: pip install ipykernel, then python -m ipykernel install --user --name nb --display-name "Python (nb)". In JupyterLab, choose that kernel from the launcher. If you later add a second environment, for example one for TensorFlow or a different CUDA build, register it with its own name.
If you work in containers, run the same steps inside a CUDA image after setting up the NVIDIA Container Toolkit, as shown in Docker with NVIDIA GPUs.
References: JupyterLab documentation: installation · Jupyter documentation: installing Jupyter Notebook · PyTorch: get started locally · IPython documentation: installing kernels
Step 3: start JupyterLab bound to localhost
Start a terminal multiplexer first, such as tmux, so the server keeps running if your SSH session drops. Then run jupyter lab --no-browser --port 8888. Jupyter Server runs at 127.0.0.1:8888 by default and is reachable only from the machine itself, which is exactly what you want.
Jupyter Server uses token authentication by default. At startup it prints a URL containing ?token= followed by a long random string. Copy that URL; you will open it through the tunnel in the next step. Once you have used the token, the browser keeps a cookie so you do not need it again until you change browser or port.
For repeat use, run jupyter server --generate-config once and set your defaults in the config file. The table lists the settings that matter on a rented server, with defaults from the Jupyter Server configuration reference.
| Setting | Default | Recommendation on a cloud GPU |
|---|---|---|
| ServerApp.ip | localhost | Keep localhost; reach it by SSH tunnel |
| Port (--port) | 8888 | Fix a known port so the tunnel command stays the same |
| ServerApp.open_browser | False | Leave off; pass --no-browser on the command line too |
| ServerApp.root_dir | Current directory | Point at the persistent disk |
| ServerApp.allow_root | False | Run as a normal user rather than root |
| Token authentication | On | Never disable it; set a password if you want |
| --certfile / --keyfile | Unset | Only needed if you serve HTTPS directly |
References: Jupyter Server documentation: running a public server · Jupyter Server documentation: security · Jupyter Server documentation: configuration reference
Step 4: secure Jupyter on a cloud GPU with an SSH tunnel
A Jupyter server is a remote shell in a browser tab: anyone who reaches it can run any command as your user. Do not bind it to 0.0.0.0 on a machine with a public IP, and never clear the token and password. The Jupyter security docs call disabling authentication NOT RECOMMENDED unless access is controlled at another layer.
From your laptop run ssh -N -L 8888:localhost:8888 user@your-gpu-host, then paste the token URL into your browser. The OpenSSH manual describes -L as forwarding a local port to a host and port on the remote side and -N as not running a remote command. VS Code and other editors that connect over SSH use the same mechanism.
Close every inbound port in the provider firewall except SSH. If a team needs shared notebooks, a hub with per-user logins behind TLS is the safer design than one shared token.
References: Jupyter Server documentation: security · Jupyter Server documentation: running a public server · OpenSSH ssh(1) manual
Step 5: confirm the notebook sees the GPU
In the first cell, run import torch, then torch.cuda.is_available(), torch.cuda.device_count() and torch.cuda.get_device_name(0). The first should return True and the last should name the GPU you rented. You can also run !nvidia-smi in a cell to see memory use from inside the notebook.
Notebooks hold GPU memory until the kernel restarts. If a cell fails with out-of-memory after several experiments, restart the kernel before buying a bigger card; deleted variables are not always freed while references survive in the output history.
References: PyTorch documentation: torch.cuda.is_available · NVIDIA System Management Interface
Common errors and fixes
Most problems are a mismatched PyTorch build, a kernel pointing at the wrong environment, or a tunnel that is not running. The guide to torch.cuda.is_available() False goes deeper on the first one.
| Symptom | Likely cause | Fix |
|---|---|---|
| torch.cuda.is_available() returns False | CPU-only wheel or driver too old for the CUDA build | Reinstall from the PyTorch selector with a CUDA version the driver supports |
| ModuleNotFoundError for a package you installed | Notebook running a different kernel | Select the kernel registered with ipykernel install |
| Browser shows connection refused | Tunnel not running or port differs | Restart ssh -N -L and match the port Jupyter printed |
| Asked for a token or password | Normal token authentication | Copy the ?token= URL from the server log |
| Server stops when the laptop sleeps | Jupyter started in the SSH session | Run it inside tmux or as a service |
| CUDA out of memory after several runs | Memory held by old objects | Restart the kernel; reduce batch size |
| Running as root is not recommended | allow_root is False | Run as a normal user instead of forcing root |
References: PyTorch documentation: torch.cuda.is_available · IPython documentation: installing kernels · Jupyter Server documentation: security
Illustrative cost: the idle-notebook problem
These numbers are illustrative, using assumed rates. Suppose a 24 GB card costs $0.70 per GPU-hour and an 80 GB card $2.00. A focused four-hour notebook session costs $2.80 or $8.00. If the instance stays up for the rest of the day and overnight, another 20 idle hours add $14 or $40, several times the cost of the actual work.
Billing counts allocated hours, so the cheapest habit is stopping the instance when the session ends and keeping data on a persistent disk. GPU-hour cost explained covers the arithmetic, and storage and egress costs prices the disk you keep.
| Scenario (assumed rate) | Hours | Cost |
|---|---|---|
| 24 GB card at $0.70, focused session | 4 | $2.80 |
| 24 GB card at $0.70, left on 24 hours | 24 | $16.80 |
| 80 GB card at $2.00, focused session | 4 | $8.00 |
| 80 GB card at $2.00, left on 24 hours | 24 | $48.00 |
Checklist and next step
nvidia-smi shows the rented GPU. JupyterLab and a CUDA PyTorch build in a venv on persistent disk. Kernel registered with ipykernel. Server started in tmux with --no-browser on 127.0.0.1:8888. Token authentication left on. Access only through an SSH tunnel. torch.cuda.is_available() returns True. Instance stopped at the end of each session.
When you know the GPU your notebooks need, rent it. On NeuraMesh you choose the GPU, a plan, GPU count, hours and region on rent GPUs, and receive a confirmed quotation, typically within one business day, with nothing charged until you approve.
NeuraMesh prices for these GPUs
| GPU | Memory | Data center | Value |
|---|---|---|---|
| RTX 4090 | 24 GB | $0.46 | $0.40 |
| L40S | 48 GB | $1.26 | $0.54 |
| A100 | 80 GB | $1.56 | $0.98 |
| H100 | 80 GB | $2.88 | $2.00 |
Every order is confirmed in a quotation before you pay. See all GPU prices.
Questions readers ask
How do I connect to Jupyter on a cloud GPU securely?
Start JupyterLab on the default 127.0.0.1:8888, then run ssh -N -L 8888:localhost:8888 user@host on your laptop and open the token URL Jupyter printed. Nothing is exposed to the internet except SSH.
Is it safe to run jupyter lab --ip=0.0.0.0?
Not on a public IP. A Jupyter server lets anyone with access run commands as your user. Token authentication is on by default, but a tunnel or an authenticated, TLS-terminated proxy is the safer design.
Why does my notebook not see the GPU?
Usually the kernel runs a CPU-only PyTorch build, or a different environment from the one you installed into. Check the kernel name, reinstall PyTorch from the official selector with a CUDA version your driver supports, and test torch.cuda.is_available().
How do I use a virtual environment as a Jupyter kernel?
Activate the environment, install ipykernel, then run python -m ipykernel install --user --name nb --display-name "Python (nb)". Select that kernel in JupyterLab.
Where do I find the Jupyter token?
Jupyter Server prints a URL containing ?token= in the terminal at startup. Copy the whole URL, or run jupyter server password once to set a password instead.
Sources and editorial notes
- NVIDIA GeForce RTX 4090 specifications
- NVIDIA L4 specifications
- NVIDIA L40S specifications
- NVIDIA H100 specifications
- NVIDIA A100 specifications
- NVIDIA System Management Interface
- Jupyter documentation: installing Jupyter Notebook
- JupyterLab documentation: installation
- PyTorch: get started locally
- IPython documentation: installing kernels
- Jupyter Server documentation: running a public server
- Jupyter Server documentation: security
- Jupyter Server documentation: configuration reference
- OpenSSH ssh(1) manual
- PyTorch documentation: torch.cuda.is_available
Primary documentation reviewed November 24, 2026. Provider descriptions reflect published documentation. Recommendations are our analysis; worked figures are illustrative unless explicitly stated otherwise. No independent provider benchmark or uptime ranking is claimed.
Need this GPU? Rent it from NeuraMesh: choose a GPU and plan, get a confirmed quotation, and pay only when you approve. See pricing.

