Run Server Preflight Checks with Ubuntu on GPU Cloud (2026 Guide) banner image

Run Server Preflight Checks with Ubuntu on GPU Cloud (2026 Guide)

Run 8 essential health checks on any server before starting GPU workloads. This one-minute diagnostic catches wrong hosts, disk space issues, clock skew, and foreign processes that waste hours of debugging time.

diagnostics
gpu
ubuntu
operations
l40
nvidia
MCP RECIPE

This guide exists as a tested, machine-readable recipe in the Massed Compute MCP. Connect an AI agent to run the full diagnostic automatically.

Before downloading models or starting training runs, run this preflight check to catch the eight most common issues that waste debugging time. The single bash function performs identity verification, resource checks, and network connectivity tests in under 60 seconds.

Required Stack
Component Version Purpose
Ubuntu Server 24.04 LTS Host operating system
NVIDIA Driver Latest GPU health verification
Standard Tools Built-in timedatectl, df, curl, nvidia-smi
System Requirements
Resource Minimum Notes
vCPUs 1 Any CPU configuration
RAM 1 GB Function uses minimal memory
Storage Any Checks will verify available space
GPU Optional GPU checks run if nvidia-smi available
Network HTTPS Tests HuggingFace connectivity
Massed Compute VM Pricing

Pricing fetched July 10, 2026. No matching SKUs found for basic requirements. Check live pricing for current availability and rates.

Step-by-Step Deployment

1

Connect to Target Server

SSH into the server you want to check. No VM provisioning required—this diagnostic runs on any existing Ubuntu host.

ssh YOUR_USERNAME@YOUR_VM_IP

Wait for the shell prompt. The preflight check requires no additional setup or sudo privileges.

2

Run Preflight Function

Paste the complete function definition and execute it. The function performs 8 checks and returns an exit code.

preflight() {
  local rc=0
  local hn ts diskroot diskhome memavail load nproc gpuok netok apps
  hn=$(hostname)
  ts=$(timedatectl show -p NTPSynchronized --value 2>/dev/null)
  diskroot=$(df --output=avail -BG / | tail -1 | tr -dc '0-9')
  diskhome=$(df --output=avail -BG "$HOME" | tail -1 | tr -dc '0-9')
  memavail=$(awk '/MemAvailable/ {printf "%d", $2/1024}' /proc/meminfo)
  load=$(awk '{print $1}' /proc/loadavg)
  nproc=$(nproc)
  echo "1. IDENTITY   PASS — host=$hn user=$(whoami) os=$(. /etc/os-release; echo $PRETTY_NAME)"
  if [ "$ts" = "yes" ]; then
    local skew
    skew=$(chronyc tracking 2>/dev/null | awk '/System time/ {print $4}' || echo "?")
    echo "2. TIME       PASS — NTP synced, skew=${skew}s tz=$(timedatectl show -p Timezone --value)"
  else
    echo "2. TIME       FAIL — NTP not synchronized"; rc=1
  fi
  if [ "$diskroot" -lt 20 ]; then echo "3. DISK /     FAIL — only ${diskroot}G free on / (need >=20G)"; rc=1
  else echo "3. DISK /     PASS — ${diskroot}G free on /"; fi
  if [ "$diskhome" -lt 50 ]; then echo "4. DISK \$HOME FAIL — only ${diskhome}G free on \$HOME (need >=50G)"; rc=1
  else echo "4. DISK \$HOME PASS — ${diskhome}G free on $HOME"; fi
  if [ "$memavail" -lt 2048 ]; then echo "5. MEM/CPU    FAIL — only ${memavail}M MemAvailable"; rc=1
  else echo "5. MEM/CPU    PASS — ${memavail}M MemAvailable, load=$load on ${nproc} CPUs"; fi
  if nvidia-smi --query-gpu=name,memory.free,utilization.gpu --format=csv,noheader >/dev/null 2>&1; then
    echo "6. GPU        PASS — $(nvidia-smi --query-gpu=name,memory.free --format=csv,noheader | head -1)"
  else
    echo "6. GPU        FAIL — nvidia-smi did not exit 0; see nvidia-smi-troubleshooting"; rc=1
  fi
  if curl -fsS --max-time 5 https://huggingface.co/ -o /dev/null 2>/dev/null; then
    echo "7. NETWORK    PASS — huggingface.co reachable"
  else
    echo "7. NETWORK    FAIL — cannot reach huggingface.co (5s timeout)"; rc=1
  fi
  apps=$(nvidia-smi --query-compute-apps=pid,process_name --format=csv,noheader 2>/dev/null)
  if [ -z "$apps" ]; then
    echo "8. WORKLOADS  PASS — no compute apps on GPU; load=$load"
  else
    foreign=$(echo "$apps" | grep -v "^$$," | head -3)
    echo "8. WORKLOADS  WARN — foreign GPU apps present: $foreign"
  fi
  return $rc
}
preflight; echo "preflight_exit=$?"
3

Verify Results

Check the output for preflight_exit=0 and no FAIL lines. A healthy server shows all PASS results.

1. IDENTITY   PASS — host=gpu-worker-01 user=ubuntu os=Ubuntu 24.04.4 LTS
2. TIME       PASS — NTP synced, skew=0.000123s tz=Etc/UTC
3. DISK /     PASS — 85G free on /
4. DISK $HOME PASS — 412G free on /home/ubuntu
5. MEM/CPU    PASS — 187432M MemAvailable, load=0.12 on 16 CPUs
6. GPU        PASS — NVIDIA L40, 48555 MiB
7. NETWORK    PASS — huggingface.co reachable
8. WORKLOADS  PASS — no compute apps on GPU; load=0.12
preflight_exit=0

If any check shows FAIL, address that issue before proceeding with model downloads or training runs.

Troubleshooting

Wrong Host Identity

If Check 1 shows an unexpected hostname, you’ve connected to the wrong server. Disconnect immediately and verify your SSH target.

Time Synchronization Failures

Check 2 fails when NTP is not synchronized. Run systemctl status systemd-timesyncd to diagnose. Many cloud providers block UDP port 123—configure chrony to use HTTPS-based time sources if needed.

Disk Space Issues

Checks 3 and 4 fail when root or home directories lack sufficient space. Run du -sh ~/* ~/.cache/huggingface 2>/dev/null | sort -h | tail to identify large files. Clear cache or expand storage before downloading models.

Memory and CPU Saturation

Check 5 fails when available memory is below 2GB. Use ps -eo pid,user,%mem,rss,comm --sort=-rss | head -10 to identify memory-heavy processes.

GPU Driver Problems

Check 6 fails when nvidia-smi cannot execute successfully. Verify driver installation and GPU visibility with lspci | grep NVIDIA.

Network Connectivity

Check 7 fails when HuggingFace is unreachable. Test with dig huggingface.co +short and verify HTTPS connectivity. Clock skew from Check 2 can cause TLS failures.

Foreign GPU Workloads

Check 8 warns when other processes are using the GPU. Identify owners with nvidia-smi --query-compute-apps=pid --format=csv,noheader | xargs -I{} ps -o pid,user,comm -p {}. Coordinate before terminating other users’ workloads.

Skip All of This: Deploy with an AI Agent

This guide exists as a tested, machine-readable recipe in the Massed Compute MCP. The recipe was verified on June 10, 2026. Configure your AI agent:

{
  "mcpServers": {
    "massed-compute": {
      "type": "http",
      "url": "https://vm.massedcompute.com/api/mcp",
      "headers": { "Authorization": "Bearer MC_TOKEN" }
    }
  }
}

Then say:

Run a server preflight check on my GPU host to verify it’s ready for ML workloads.

The agent matches your request against the recipe catalog, connects to your server, executes the 8-check diagnostic function, and reports any failures that need attention before proceeding with model deployment or training runs.

Ready to Deploy GPU Workloads?

Run preflight checks on production-ready GPU instances with global availability and transparent pricing.

Think it. Build it. Scale it.

Quick Setup Guide

For fastest deployment, paste the preflight function directly into your SSH session. No file creation or configuration required:

  1. Connect: ssh username@your-server
  2. Paste the complete function block from Step 2
  3. Verify all checks return PASS with exit code 0
  4. Address any FAIL results before starting GPU workloads
  5. Re-run after fixing issues to confirm resolution

Frequently Asked Questions

01Does this diagnostic require sudo privileges?

No, all checks use standard user-accessible commands like timedatectl, df, and nvidia-smi. The function reads system information without making any configuration changes.

02What happens if I don’t have a GPU installed?

Check 6 will show FAIL if nvidia-smi is not available, but this won’t prevent you from running CPU-only workloads. The function adapts to the available hardware configuration.

03Can I run this on cloud instances from other providers?

Yes, the preflight check works on any Ubuntu 24.04 server with standard tooling installed. It’s provider-agnostic and designed for general server health verification.

04How often should I run preflight checks?

Run it before each significant workload deployment, after system updates, or when troubleshooting performance issues. The one-minute runtime makes it practical for frequent verification.

05What does the WORKLOADS WARN status mean?

WARN indicates other processes are using the GPU but doesn’t fail the check. Identify the process owners and coordinate before starting your own GPU workloads to avoid conflicts.