notebooks: guard nvidia-smi for CPU-only runtimes (G1.2) - #11
Open
mattdani21 wants to merge 1 commit into
Open
Conversation
…eNotFoundError crash (G1.2) colab+kaggle eval notebooks called subprocess.run(['nvidia-smi']) unguarded; a runtime with no NVIDIA driver (CPU-only Colab/Kaggle session) dies at cell 0 with FileNotFoundError. Wrap in a helper that returns '' when the binary is absent; smoke scope now proceeds on CPU with a clear warning, full scope still fails loudly via the existing >=20GB assert.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR_SUMMARY — nvidia-smi guard for CPU-only runtimes
What
notebooks/colab-phase1-eval.ipynbandnotebooks/phase1-pipeline-eval.ipynbcalledsubprocess.run(['nvidia-smi'], ...)unguarded. On a runtime with no NVIDIA driver (CPU-only Colab/Kaggle session), that raisesFileNotFoundErrorand the notebook dies at cell 0 — before any eval work.Why
Observed in a smoke run (
python 3.12.13 | scope: smoke | categories: bugfix,feature): tracebackFileNotFoundError: [Errno 2] No such file or directory: 'nvidia-smi'. GPU presence should be reported and handled, not assumed.Fix
nvidia_smi(*args)helper: returns''on missing binary / timeout instead of raising.nvidia-smi NOT FOUND+GPU count: 0 | total VRAM MiB: 0+ a warning directing to Runtime → Change runtime type → T4 GPU.smokescope proceeds on CPU (slow but functional — llama.cpp CPU fallback);fullscope still fails loudly via the existing>=20GB VRAMassert (vram=0 → assert fires with the clear message).How tested
nvidia-smi(exact repro of the failure): no crash; smoke path proceeds, full path asserts with the intended message.Numbers