# Interactive session with a GPU

[Download the files](/gallery/int-gpu.tar.gz) · [Source on GitHub](https://github.com/Pioneer-Centre-for-AI/p1-compute-documentation/tree/main/pkgs/gallery/int-gpu)

A marimo notebook on one GPU on the P1 DTU HPC. It shows the GPU it got, times a matrix
multiply on CPU and GPU, and trains a small classifier. `gpu.py` runs the same check as a
script, and `pyproject.toml` and `uv.lock` pin the packages. It suits installing packages, test
runs and debugging on `p1i`, the P1 queue for interactive GPU work.

## With aicentre

```bash
aicentre gallery get int-gpu                           # the example, onto the cluster
aicentre marimo examples/int-gpu/notebook.py --gpu    # the notebook on a GPU, in your browser
aicentre shell examples/int-gpu --gpu                  # or a shell on the GPU node
```

- `gallery get` has the login node download the example into your project directory, so there
  is nothing to clone or copy.
- `--gpu` asks `p1i` for a GPU, starts marimo with the example's own packages, and opens it in
  your browser through the login node. Ctrl-C ends the job; `--time 2h` asks for longer.
