<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>GPU on Brice's Blog</title><link>https://brice6.pages.dev/tags/gpu/</link><description>Recent content in GPU on Brice's Blog</description><image><title>Brice's Blog</title><url>https://brice6.pages.dev/images/avatar-320.webp</url><link>https://brice6.pages.dev/images/avatar-320.webp</link></image><generator>Hugo -- 0.161.1</generator><language>en</language><lastBuildDate>Thu, 26 Nov 2026 18:50:06 +1300</lastBuildDate><atom:link href="https://brice6.pages.dev/tags/gpu/index.xml" rel="self" type="application/rss+xml"/><item><title>UoA Cloud Server: Setup and Usage Guide</title><link>https://brice6.pages.dev/posts/mai/ra/usage/</link><pubDate>Sat, 28 Mar 2026 00:00:00 +0000</pubDate><guid>https://brice6.pages.dev/posts/mai/ra/usage/</guid><description>A step-by-step guide for doing research on UoA cloud servers.</description><content:encoded><![CDATA[<p>This guide walks through everything you need to start running deep learning workloads on the UoA compute cluster — from initial login to submitting GPU jobs and monitoring training.</p>
<h2 id="0-first-time-setup">0. First-Time Setup</h2>
<p>When you first get access to your machine, point your data and home directories at the large <code>/data/&lt;UPI&gt;/</code> partition so that datasets, checkpoints, and virtual environments don't fill up the small system disk.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">TMPDIR</span><span class="o">=</span>/data/&lt;UPI&gt;/
</span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">HOME</span><span class="o">=</span>/data/&lt;UPI&gt;/
</span></span></code></pre></div><blockquote>
<p>Tip: add these lines to your <code>~/.bashrc</code> or <code>~/.zshrc</code> so they persist across sessions.</p>
</blockquote>
<h2 id="1-ssh-login">1. SSH Login</h2>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ssh &lt;UPI&gt;0@foscsmlprd01.its.auckland.ac.nz
</span></span><span class="line"><span class="cl"><span class="c1"># foscsmlprd02 and foscsmlprd03 are also available</span>
</span></span></code></pre></div><p>Replace <code>&lt;UPI&gt;</code> with your University of Auckland UPI (e.g., <code>jdoe001</code>).</p>
<h2 id="2-python-environment-with-uv">2. Python Environment with <code>uv</code></h2>
<p>We use <a href="https://github.com/astral-sh/uv"><code>uv</code></a> for fast, reproducible Python environment management.</p>
<h3 id="install-uv">Install <code>uv</code></h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">wget -qO- https://astral.sh/uv/install.sh <span class="p">|</span> sh
</span></span></code></pre></div><h3 id="set-up-an-environment">Set Up an Environment</h3>
<p><strong>If the project has a <code>pyproject.toml</code>:</strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">uv sync
</span></span></code></pre></div><p><code>uv</code> creates the virtual environment and installs all dependencies in one step.</p>
<p><strong>If the project only has a <code>requirements.txt</code>:</strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">uv venv                              <span class="c1"># create the virtual environment</span>
</span></span><span class="line"><span class="cl">uv pip install -r requirements.txt   <span class="c1"># install dependencies</span>
</span></span></code></pre></div><h2 id="3-submitting-gpu-jobs-with-slurm">3. Submitting GPU Jobs with SLURM</h2>
<p>To run training on a GPU, submit a shell script to the SLURM scheduler — don't run heavy workloads directly on the login node.</p>
<h3 id="example-job-script">Example Job Script</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="cp">#!/bin/bash
</span></span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># ======== SLURM Job Configuration ========</span>
</span></span><span class="line"><span class="cl"><span class="c1">#SBATCH --job-name=&lt;job_name&gt;             # [REQUIRED] Name shown in the job queue (e.g., &#34;AAAI-training&#34;)</span>
</span></span><span class="line"><span class="cl"><span class="c1">#SBATCH --time=00:30:00                   # [REQUIRED] Wall-clock limit (HH:MM:SS)</span>
</span></span><span class="line"><span class="cl"><span class="c1">#SBATCH --open-mode=append                # Append to log files instead of overwriting</span>
</span></span><span class="line"><span class="cl"><span class="c1">#SBATCH --output=&lt;output_file&gt;.log        # [RECOMMENDED] Standard output log</span>
</span></span><span class="line"><span class="cl"><span class="c1">#SBATCH --error=&lt;error_file&gt;.log          # [RECOMMENDED] Standard error log</span>
</span></span><span class="line"><span class="cl"><span class="c1">#SBATCH --gres=gpu:1                      # [REQUIRED] Number of GPUs (&gt;1 needs Slack channel approval)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># ======== Job Execution ========</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Navigate to your project directory</span>
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> /data/&lt;UPI&gt;/&lt;project_path&gt;
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Activate the virtual environment (created by `uv venv` / `uv sync`)</span>
</span></span><span class="line"><span class="cl"><span class="nb">source</span> .venv/bin/activate
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Run the training script</span>
</span></span><span class="line"><span class="cl">python3 train.py
</span></span></code></pre></div><h3 id="common-slurm-commands">Common SLURM Commands</h3>
<table>
  <thead>
      <tr>
          <th>Action</th>
          <th>Command</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Submit a job</td>
          <td><code>sbatch job.sh</code></td>
      </tr>
      <tr>
          <td>Check your jobs</td>
          <td><code>squeue -u $USER</code></td>
      </tr>
      <tr>
          <td>Cancel a job</td>
          <td><code>scancel &lt;job_id&gt;</code></td>
      </tr>
  </tbody>
</table>
<h2 id="4-monitoring-your-workflow">4. Monitoring Your Workflow</h2>
<p><strong>Watch your job queue in real time:</strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">watch squeue -u <span class="nv">$USER</span>
</span></span></code></pre></div><p><strong>Tail a log file to follow output or errors live:</strong></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">tail -f &lt;output_file&gt;.log
</span></span></code></pre></div><p>This is the fastest way to debug a running job without waiting for it to finish.</p>
<h2 id="5-downloading-output-files">5. Downloading Output Files</h2>
<p>For terminal users who want to pull results back to a local machine:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">scp &lt;UPI&gt;0@foscsmlprd03.its.auckland.ac.nz:/data/&lt;UPI&gt;/&lt;project_path&gt;/outputs/sample.mp4 ./
</span></span></code></pre></div><p>The pattern is <code>scp &lt;user&gt;@&lt;host&gt;:&lt;remote_path&gt; &lt;local_path&gt;</code>; add <code>-r</code> to copy a whole directory.</p>
]]></content:encoded></item></channel></rss>