agentleFS
AlphaSaleAidanAlphaSaleAidan/pierce-skill-kit/skills/remote-gpu-render/SKILL.md

remote-gpu-render

Skill0 starsChanged 28 days agoMITView on GitHub

Use when a GPU job (FaceFusion face swap/face editor/face enhancer, Real-ESRGAN upscale to 4K, Seed-VC voice conversion, any CUDA onnxruntime/torch job) is too slow on a CPU server and a Windows PC with an NVIDIA card is available over SSH, or when that PC's tunnel drops, CUDA libraries fail to load, or its output doesn't match what was requested.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Consent: only swap, edit or convert the faces and voices of people who agreed to it in writing, never to impersonate anyone or to make …

    line 14
  2. Very specific:

    Real-ESRGAN ncnn: never run realesrgan-x4plus with -s 2 — the output comes back scrambled into mismatched tiles with seams.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Remote GPU render (a Windows NVIDIA PC you own, over SSH)

Overview

The CPU server orchestrates; the Windows PC does the CUDA work. The PC dials OUT to the server with a reverse SSH tunnel (no port-forwarding on the home router), a keep-awake supervisor keeps it up, and the PC's own Claude session watches the PC side. Nothing the PC reports counts until the server has ffprobed the output file itself.

Consent: only swap, edit or convert the faces and voices of people who agreed to it in writing, never to impersonate anyone or to make content that could pass as real footage of them.

Routing rule: FaceFusion swap/gaze/restore, ESRGAN 4K, Seed-VC → GPU. Light assembly, mixing, captions → the server. On CPU the same FaceFusion face_editor pass ran ~11 s/frame (30 min / 169 frames).

Link setup

  1. PC: enable OpenSSH Server; admin users' keys go in C:\ProgramData\ssh\administrators_authorized_keys (not ~\.ssh\authorized_keys), ACL admin+SYSTEM only.
  2. Server: the PC's tunnel key in authorized_keys restricted with permitlisten="localhost:<port>" — the port must match what the PC requests, or the forward silently fails.
  3. PC: scripts/tunnel_keepawake.ps1 -Server user@server -Port <port> -Key ... (SetThreadExecutionState
    • restart loop with ExitOnForwardFailure, ServerAliveInterval 30). Run as a logon task.
  4. Server: reach the PC with ssh -p <port> -i ~/.ssh/<key> <pcuser>@localhost; watchdog scripts/link_watch.sh <port> <pcuser> <key> <log> under setsid nohup … < /dev/null & (logs changes only).
  5. A tunnel that "just died" after weeks: check whether something else on the server took the port (an sshd port change killed ours once) before debugging the PC.

FaceFusion on CUDA — gotchas we hit

SymptomFix
onnxruntime_providers_cuda.dll … depends on cublasLt64_12.dll which is missing (falls back to CPU silently)pip install nvidia-cublas-cu12 nvidia-cudnn-cu12 nvidia-cuda-runtime-cu12 and prepend each package's bin dir to PATH in the launcher .bat (site-packages\nvidia\*\bin)
ModuleNotFoundError: onnxruntime after installinginstall onnxruntime-gpu into the SAME venv FaceFusion runs from (install.py --onnxruntime cuda), not the user site
protobuf version clash on import (another package upgraded it)reinstall the protobuf version FaceFusion's requirements pin
torchvision … requires torch==2.5.1+cu121 after upgrading torchinstall the matching torchvision from the same CUDA index (--index-url …/cu124)
4K upscaleuse --output-video-scale 2.0, not a resolution flag. ALWAYS ffprobe width/height/frames of the output
Card is power-capped (≈370 W)keep --execution-thread-count 2
Proof that CUDA is live: log line execution_providers=['cuda'] AND an onnxruntime session listing
CUDAExecutionProvider first; GPU utilisation in nvidia-smi during the run.

Job pattern

scp -P <port> in.mp4 user@localhost:C:/jobs/in.mp4
ssh -p <port> user@localhost "C:\\jobs\\ffgpu.bat headless-run -t C:\\jobs\\in.mp4 -o C:\\jobs\\out.mp4 \
  --processors frame_enhancer --frame-enhancer-model real_esrgan_x2 --output-video-scale 2.0 \
  --execution-providers cuda --execution-thread-count 2"
scp -P <port> user@localhost:C:/jobs/out.mp4 .
ffprobe -v error -select_streams v:0 -count_frames \
  -show_entries stream=width,height,nb_read_frames,r_frame_rate -of csv=p=0 out.mp4   # verify, then use

ffgpu.bat = activate the venv, set the CUDA DLL PATH, python facefusion.py %*.

Pairing with the PC's own Claude session

  • The PC session owns PC-side setup (installs, drivers, keep-awake, tunnel) and guards the machine; the server session owns jobs and verification. Message it concrete asks; never ask it to change its own permissions.
  • Its "done" is a claim. Verify from output only: file exists, ffprobe dims/frames/fps match the ask, a frame grab looks right at client zoom.

What FAILED

  • Assuming FaceFusion used the GPU because --execution-providers cuda was passed: it fell back to CPU on the missing cuBLAS DLL. Check the providers line.
  • An output-resolution flag instead of --output-video-scale 2.0 for the 4K upscale: don't; and never report "4K done" without ffprobe numbers.
  • A sleeping PC drops the tunnel (and any job with it) — the keep-awake supervisor is not optional.
  • pgrep -f/pkill -f patterns that also match your own shell: kill by PID found from the port/log.

Status

link_watch.sh is the job's watchdog, generalized. tunnel_keepawake.ps1 is an untested template written from the setup used on the job.

More lessons from real jobs

  • Real-ESRGAN ncnn: never run realesrgan-x4plus with -s 2 — the output comes back scrambled into mismatched tiles with seams. Run -s 4 -t 200, then downscale with ffmpeg lanczos on the PC. Rough speed on an RTX 3080: 32 stills x4 in ~72 s; a 5 s / 24 fps clip (121 frames) x4 → h264_nvenc ~4 min. Run long jobs detached (keep any single ssh session short), spot-check crops for seams before use.
  • The PC can power-trip under full GPU load. Voice-model training at the card's stock power limit hard-powered-off a PC twice (looks exactly like "the tunnel crashed"; a blinking GPU LED = PSU transient trip). Fix: cap power before any long job (nvidia-smi -pl 200, re-applied at boot by a scheduled task), one GPU process at a time, checkpoint often, one SSH/scp connection at a time.
  • Server-side watchdog: if the probe fails twice, check for a stale sshd still holding the forwarded port and clear it, so the PC's reconnect loop can bind again.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.