> For the complete documentation index, see [llms.txt](https://docs.aisl.science/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aisl.science/external-tools-and-services/cscs-clariden.md).

# CSCS Clariden

[Clariden](https://docs.cscs.ch/clusters/clariden/) is the CSCS machine-learning cluster on Alps. It provides NVIDIA Grace Hopper (GH200) compute for machine-learning workloads. FHNW/AISL users can use Clariden when access has been explicitly allocated through a course, research project, workshop, event, or other approved activity.

## Before you start

You need:

* a CSCS account with MFA enabled;
* access to a CSCS project or course allocation that includes Clariden;
* your CSCS username and the Slurm project/account code provided by CSCS or your instructor/project lead;
* a local terminal with OpenSSH. The examples below use macOS/Linux syntax; Windows users can use WSL or another OpenSSH environment.

{% hint style="warning" %}
**Never share secrets.** Do not commit or paste your private SSH key, CSCS API credentials, passwords, access tokens, or other secrets into notebooks, Git repositories, screenshots, or chat messages. The examples below intentionally use placeholders such as `<CSCS_USERNAME>` and `<PROJECT>`.
{% endhint %}

## Quick start

{% stepper %}
{% step %}

## Confirm your allocation

Open [portal.cscs.ch](https://portal.cscs.ch/) and verify that you can see the project or course allocation provided to you and that it includes **Clariden**.

If the expected project is missing, contact your instructor, project lead, or the relevant CSCS contact before continuing.
{% endstep %}

{% step %}

## Create an SSH key locally

Create a dedicated key pair on your own computer. This is normally needed only once:

```bash
ssh-keygen -t ed25519 -f ~/.ssh/cscs-key
```

The private key is `~/.ssh/cscs-key`. Keep it on your computer. The public key is `~/.ssh/cscs-key.pub`.
{% endstep %}

{% step %}

## Sign the public key in the CSCS web dashboard

Open [user-account.cscs.ch](https://user-account.cscs.ch/), sign in, then go to **SSH Keys → Sign Key**.

Paste the content of your public key. On macOS you can copy it with:

```bash
pbcopy < ~/.ssh/cscs-key.pub
```

On Linux, display and copy it with:

```bash
cat ~/.ssh/cscs-key.pub
```

Download the signed certificate and place it next to your private key as:

```
~/.ssh/cscs-key-cert.pub
```

A signed CSCS SSH certificate is normally valid for **one day**. When it expires, sign the same public key again; you do not need to create a new private key.
{% endstep %}

{% step %}

## Configure SSH

The **CSCS User Account** web tool provides an SSH configuration for the signed key. Add it to `~/.ssh/config` and replace `<CSCS_USERNAME>` with your own CSCS username:

```
Host cscs-*
    IdentityFile ~/.ssh/cscs-key
    CertificateFile ~/.ssh/cscs-key-cert.pub
    User <CSCS_USERNAME>
    IdentitiesOnly yes

Host cscs-ela
    HostName ela.cscs.ch
    ProxyJump none

Host cscs-clariden
    HostName clariden
    ProxyJump cscs-ela
```

This structure keeps the identity settings in one wildcard block and routes `cscs-clariden` through the **Ela** jump host.

Restrict permissions on the private key and SSH configuration:

```bash
chmod 600 ~/.ssh/cscs-key
chmod 600 ~/.ssh/config
```

{% hint style="info" %}
If the CSCS User Account web tool displays an SSH configuration for your account, prefer the configuration shown there. CSCS may adapt recommended aliases or host settings over time.
{% endhint %}
{% endstep %}

{% step %}

## Connect to Clariden

From your local terminal:

```bash
ssh cscs-clariden
```

A successful login ends at a Clariden login-node prompt. Do not run compute workloads directly on the login node; use Slurm.
{% endstep %}

{% step %}

## Verify Slurm project access

Run the smallest possible scheduled job, replacing `<PROJECT>` with the Slurm account code assigned to you:

```bash
srun --account=<PROJECT> hostname
```

A successful run allocates a compute node and prints a hostname such as `nid...`. This confirms that your SSH access, project allocation, and Slurm scheduling work end to end.
{% endstep %}
{% endstepper %}

## Optional: verify a Python GPU job

For a first GPU test, use CSCS' PyTorch uenv rather than installing your own PyTorch stack. First find and pull an available image:

```bash
uenv image find pytorch
uenv image pull <PYTORCH_UENV>
```

Replace `<PYTORCH_UENV>` with one of the images returned by the first command. Images are versioned and change over time, so do not hard-code an old version from this page.

<details>

<summary>Minimal end-to-end GPU smoke test</summary>

Create `train.py`:

```python
import socket
import torch

print("Host:", socket.gethostname())
print("PyTorch:", torch.__version__)
print("CUDA available:", torch.cuda.is_available())

if not torch.cuda.is_available():
    raise RuntimeError("No CUDA GPU available")

print("GPU:", torch.cuda.get_device_name(0))

x = torch.randn((1024, 1024), device="cuda")
y = x @ x
print("Result mean:", y.mean().item())
print("SUCCESS")
```

Create `submit.sh` and replace both placeholders:

```bash
#!/bin/bash
#SBATCH --account=<PROJECT>
#SBATCH --job-name=gpu-smoke
#SBATCH --partition=debug
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time=00:02:00
#SBATCH --uenv=<PYTORCH_UENV>
#SBATCH --view=default
#SBATCH --output=slurm-%x-%j.out

set -e
srun python train.py
```

Submit and inspect the job:

```bash
sbatch submit.sh
squeue --me
cat slurm-gpu-smoke-*.out
```

The `debug` partition is intended for short validation runs. Use the partition and resource settings specified for your course or project when you scale up.

</details>

## ML Console

The [CSCS ML Console](https://console.mlp.cscs.ch/) provides a browser-based view of Clariden. It can be useful for:

* monitoring submitted jobs and their status;
* viewing StdOut/StdErr;
* browsing accessible filesystems;
* submitting simple jobs from the browser.

It is a convenient companion to SSH and Slurm rather than a different compute system: jobs shown in the console are still Slurm jobs on Clariden. See the [CSCS HPC Console documentation](https://docs.cscs.ch/access/hpc-console/).

## Related resources

* [CSCS SSH documentation](https://docs.cscs.ch/access/ssh/)
* [Clariden documentation](https://docs.cscs.ch/clusters/clariden/)
* [CSCS uenv documentation](https://docs.cscs.ch/software/uenv/)
* [CSCS HPC Console documentation](https://docs.cscs.ch/access/hpc-console/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aisl.science/external-tools-and-services/cscs-clariden.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
