RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /Local AI on Linux
  6. /Ch. 8
Local AI on Linux

08. Headless Server Setup

Chapter 8 of 15 · 20 min
KEY INSIGHT

Headless servers require explicit GPU persistence mode, SSH key authentication, and thermal management—none of these are configured by default.

A headless AI server runs without a monitor, keyboard, or display server. SSH access, GPU persistence mode, and thermal management are the critical configuration areas.

SSH configuration for remote access:

sudo nano /etc/ssh/sshd_config
Port 22
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
ClientAliveInterval 60
ClientAliveCountMax 3

Enforce key-based authentication:

ssh-copy-id user@your-server-ip
sudo systemctl restart sshd

GPU persistence mode keeps GPU power state active so subsequent inferences do not suffer a cold-start delay:

sudo nvidia-smi -pm ENABLED
# Enabled persistence mode for GPU 0
# Enabled persistence mode for GPU 1

Add this to /etc/rc.local or a systemd oneshot service so it survives reboots:

sudo nano /etc/systemd/system/gpu-persistence.service
[Unit]
Description=GPU Persistence Mode

[Service]
Type=oneshot
ExecStart=/usr/bin/nvidia-smi -pm ENABLED
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Thermal management: AI workloads generate sustained heat. Set power limits and fan curves:

# Set max power to 300W instead of default (RTX 3090 default is 350W)
nvidia-smi -i 0 -pl 300
# Check current temperature and power draw
nvidia-smi -q -d TEMPERATURE,POWER

Failure mode: SSH works but nvidia-smi returns No devices found when logged in over SSH. The display session variable DISPLAY is not set and some nvidia-smi invocations fail when the X server is not accessible. Always use DISPLAY= nvidia-smi (empty value before the command) or invoke from a script that unsets DISPLAY.

Failure mode: GPU persistence mode silently fails on multi-GPU systems where one GPU has a different driver version. Check nvidia-smi -q | grep 'Persistence Mode' for each GPU individually with -i 0, -i 1.

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

EXERCISE

Configure SSH key-only access, enable GPU persistence mode as a systemd service, set a power limit 20% below default, and verify both configurations persist across a reboot.

← Chapter 7
Systemd Service for AI
Chapter 9 →
Docker on Linux for AI