Skip to content

Lambda: register Docker's nvidia runtime, retry dropped ssh, show Docker's error - #68

Open
AryansajalGoyal wants to merge 1 commit into
becloudready:mainfrom
AryansajalGoyal:fix/lambda-nvidia-runtime
Open

AryansajalGoyal wants to merge 1 commit into
becloudready:mainfrom
AryansajalGoyal:fix/lambda-nvidia-runtime

Conversation

@AryansajalGoyal

Copy link
Copy Markdown

Fixes three problems found while launching gpu-notebooks on a Lambda Cloud A100 (mode: mig).

Changes

  • setup.sh: partition now checks Docker's runtimes for exactly nvidia (the old check grepped docker info for the word, which passed on Lambda Stack although --runtime=nvidia failed with unknown or invalid runtime name: nvidia). If it is missing, it runs nvidia-ctk runtime configure --runtime=docker and restarts Docker; if nvidia-ctk is absent or the runtime still is not there, it fails with a plain message. When the runtime is already registered (Shadeform, Nebius), nothing changes.
  • pack.py _remote: retries a remote step when ssh exits 255 with a dropped-connection error (Connection closed by ... port 22 right after the first login on a fresh VM), every 10 s for about 3 minutes. Real command failures still fail at once. The VM scripts are idempotent, so a retry is safe.
  • pack.py _failure: keeps up to two stderr lines just before the script's ERROR: line (after it, so the 400-char cap never cuts the ERROR: line), so Docker's own reason reaches the user. Still scrubbed.

Tests

  • tests/test_gpu_mig_script.py: runtime present → untouched; missing → registered, Docker restarted once, rerun is a no-op; missing with no nvidia-ctk → plain error.
  • tests/test_gpu_notebooks.py: dropped ssh is retried; ssh that keeps dropping still fails with the ssh error; Docker's reason appears in the failure.
  • pytest tests/test_gpu_*.py -q: 318 passed. scripts/check_no_pii.py passes. launch --dry-run of the Shadeform example unchanged.

Not verified

No real launch after the fix. Still open on Lambda: that nvidia-ctk is present on the Lambda Stack image, and A100 MIG past this point. A plain-language explanation is in the first comment.

🤖 Generated with Claude Code

…ker's error

- setup.sh: check Docker's runtimes for exactly `nvidia`; if missing (Lambda
  Stack ships the toolkit but does not register it), run
  `nvidia-ctk runtime configure --runtime=docker` and restart Docker, else fail plainly.
- pack.py: retry a remote step when ssh drops the connection (exit 255) on a
  fresh VM, about 3 minutes; failure messages keep the lines just before
  `ERROR:` so Docker's own reason is shown.
- tests for all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AryansajalGoyal

Copy link
Copy Markdown
Author

GPU labs on Lambda Cloud: what went wrong and how we fixed it

What we were trying to do
We rent one powerful GPU computer on Lambda Cloud and split it into 7 smaller pieces, so 7 students each get their own lab.

The problems, in order

  1. The connection dropped right after logging in.
    A new computer is still finishing its own setup for the first minute or two. During that time it briefly closed our connection, and our tool gave up straight away.
    Fix: the tool now waits 10 seconds and tries again, for up to about 3 minutes, before giving up.

  2. The error message was too vague.
    All we saw was "cannot start lab-01". The real reason was there, but the tool was hiding it.
    Fix: the tool now shows the real reason. That's how we found problem 3.

  3. The real cause: a missing setting on Lambda's computers.
    Each student's lab runs inside a box, called a container, and that box needs permission to use the GPU. On Lambda's computers, the GPU software was installed but never switched on for these boxes. So the labs couldn't start.
    Fix: before starting the labs, the tool now checks whether this is switched on. If it isn't, the tool switches it on automatically. If it can't, it says so in plain words.

Does this affect Shadeform (H100), which already worked?
No. On Shadeform the setting is already on, so the tool sees that and changes nothing. It runs exactly as before.

Money
Whenever a launch fails, the tool deletes the rented computer automatically, so we aren't billed for it.

Still to confirm
The fix passes all our automated tests, but nobody has tried it on a real Lambda computer yet. The next real launch will show whether the labs start. If something else goes wrong, the tool will now tell us exactly what.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant