Repository navigation
Python 3.9 floor and a libcuda fallback for GPU identity - #13
Merged
Merged
Conversation
Merged
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.
Trust claim before and after
Before:
environment.gpu_infoand thegpu_requiredprobe know two sources,nvidia-smiand PyTorch. A board with neither (a Jetson before JetPack 7, where a plain pytest venv has no torch) recordsgpu_info: null, so arequire_gpupolicy fails for the wrong reason, andgpu_requiredtests skip on a machine that has a GPU. The package also requires Python 3.10, which excludes JetPack 5 boards (Python 3.8 and 3.9).After: a third source, the CUDA driver library through
ctypes(cuInit,cuDeviceGetName, compute-capability attributes,cuDeviceTotalMem_v2,cuDeviceGetUuid), used only when the first two are absent or fail.gpu_info.sourcenames the source used (nvidia-smi,torch, orlibcuda). The claim is unchanged: GPU metadata stays self-reported, not evidence of execution (docs/security_model.mdrow unchanged). The Python floor is 3.9; the code already avoided 3.10-only syntax, so only metadata and the CI matrix moved.Fail-closed behaviour
The probe returns
Nonewhenlibcuda.so.1cannot be loaded, when any driver call returns a nonzeroCUresult, when a symbol is missing, or when the driver reports no device. Tests cover each branch with a fake library object; the existing nvidia-smi and torch tests now stub the probe so they stay hermetic on a box that has a GPU.Migration
None. Receipts gain no field;
source: "libcuda"is a new value of an existing field. Existing receipts verify unchanged.Checks run
python -m pytest tests -q: 271 passed (Python 3.12 here; 271 passed under Python 3.9.5 on a Jetson AGX Xavier, aarch64, from this wheel)coverage run -m pytest tests -q && coverage report --fail-under=100: 100% line and branchmkdocs build --strict,python -m build,twine check --strict dist/*nvidia-smi; Jetson AGX Xavier (JetPack 5.1, CUDA 11.4) reportsXavier, compute capability 7.2, driver 11.4 throughlibcuda, with the same UUIDnvidia-smiprints where it exists.The version is
0.5.1.dev0so receipts recorded from this tree name a development build; the release commit sets0.5.1.🤖 Generated with Claude Code