dsh-gpu
GPU-aware execution layer for DeepSeek Harness: gpu_status / gpu_exec / gpu_run_bg tools, per-step GPU context injection, automatic CUDA_VISIBLE_DEVICES card selection
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zytsyj/dsh-gpu说明文档
阅读完整 README ↗dsh-gpu
GPU-aware execution layer for DeepSeek Harness (dsh). Out-of-tree plugin; no harness patches required.
Agents get three tools — gpu_status, gpu_exec, gpu_run_bg — plus an optional per-step GPU context line. Cards are selected automatically (freest first) with CUDA_VISIBLE_DEVICES set in the command environment; pin a card explicitly when you care.
8 GPU(s), free: [0,1,2,3,4,5,6,7]
GPU0 Tesla V100-SXM2-32GB: 4264/32768MiB 0%util 40C
...
[gpus 1 — GPU 1 (auto: freest 1)] exit 0
How it works
gpu_status— one query, every device: memory used/total, SM utilization, temperature, and a free/busy verdict. A device is busy at or above 80% memory used or 50% utilization (both configurable).gpu_exec— one-shot command with a selected card:CUDA_VISIBLE_DEVICES=is passed through the mountedctx.shellexecutor's environment. Auto-select or pingpuIndex; selectcountcards for multi-GPU commands.gpu_run_bg— long-running GPU jobs (training, inference servers, benchmarks) register as agpujob inctx.jobs: returns a job id immediately, read withjob_output, stop withjob_kill.- Per-step context (optional, on by default) — injects a one-line GPU snapshot into eligible steps (the
time-contextpattern), rate-limited to one sample per minute.
All execution rides the mounted shell executor. Local host, or any remote execution world (e.g. an SSH provider plugin) — dsh-gpu doesn't know or care where the GPUs are; it queries and launches through the same seam the bash tool uses.
Install
dsh-gpu is an out-of-tree bundle plugin. Install and activate it in a profile with the official plugin command:
dsh plugin --profile add dsh-gpu
The package's bundled cordis.patch.yml registers the plugin automatically. To override its configuration, add an entry with the same id to the profile's cordis.patch.yml:
- insert:
- id: gpu
name: dsh-gpu
config:
stepContext: true
Load order note: place it after your execution-world plugins (e.g. an SSH provider) so the shell seam it queries is the one you intend.