fix: detect NVIDIA Jetson Orin boards instead of reporting CPU-only - #165
Closed
donghee-ai wants to merge 1 commit into
Closed
fix: detect NVIDIA Jetson Orin boards instead of reporting CPU-only#165donghee-ai wants to merge 1 commit into
donghee-ai wants to merge 1 commit into
Conversation
Tegra answers NVML_ERROR_NOT_SUPPORTED for nvmlDeviceGetMemoryInfo and prints [N/A] for nvidia-smi memory.total, and "Orin (nvgpu)" matches no unified-memory marker, so both detection paths dropped the GPU and every candidate was ranked cpu_only. Resolve the module from the kernel device tree, since every Orin module reports the same driver name and Tegra supports neither the memory query nor clocks.max.memory. Bandwidth for Jetson Orin NX 16GB is verified against measured llama.cpp throughput; the other Orin entries are data-sheet values.
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.
What
hardware/jetson.pyresolves the Jetson module from the kernel device tree.hardware/nvidia.pytreats the Tegra integrated GPU as unified memory andsubstitutes the resolved module name.
data/gpu.pygains bandwidth and compute-capability entries for Orin modules.docs/hardware.mdsection.Why
whichllm reports "No GPU detected — CPU-only mode" on every Jetson. On my
board it printed that while llama.cpp was serving Qwen3-8B on the same GPU.
Tegra is a unified-memory SoC with no dedicated VRAM, so the driver answers
NVML_ERROR_NOT_SUPPORTEDfornvmlDeviceGetMemoryInfo, andnvidia-smiprints
[N/A]formemory.total— the same shape as DGX Spark / GB10, whichis already handled. But
"Orin (nvgpu)"matches no unified-memory marker, soboth paths drop the GPU: the NVML branch re-raises, and the
nvidia-smifallback finds no digits in
[N/A]andcontinues.That is not cosmetic — with no GPU every candidate is ranked
cpu_only(quality x0.50, sort -6.0, CPU speed heuristic), so the recommendations change
completely.
A marker alone is not enough:
estimate_tok_per_secreturns0.0without abandwidth, and every Orin module reports the same name — a 4 GB Orin Nano
(34 GB/s) and a 64 GB AGX Orin (204.8 GB/s) are both
"Orin (nvgpu)". Same"one name, several configurations" problem as the GTX 1650 GDDR5/GDDR6 split,
except
clocks.max.memoryis alsoNOT_SUPPORTEDhere. The device tree is theremaining discriminator, and needs no root:
Only listed part numbers are claimed. An unrecognised module keeps its generic
name and resolves no bandwidth, rather than a product being guessed from an SoC
generation (
tegra210covers both Jetson Nano and TX1). Detection stillrequires the driver to enumerate the GPU, so a board with a broken CUDA stack
keeps reporting none.
Testing
Jetson Orin NX 16GB (
p3767-0000), JetPack 6.2.3 / L4T R36.5.0, nvpmodel MAXN,llama.cpp CUDA
a94d563,llama-bench -ngl 99 -p 512 -n 128 -fa 1 -r 3.The bandwidth entry is what the measurements pin down. Sweeping candidate values
through
estimate_tok_per_secover four Q4_K_M models from 4.44 to 8.38 GiB(one quantization, so the fit isolates bandwidth):
Per model at 102.4: EXAONE-3.5-7.8B 11.65 measured / 11.82 predicted,
Llama-3.1-8B 11.42 / 11.46, Qwen3-8B 11.14 / 11.22, Qwen3-14B 6.36 / 6.26 —
three unrelated families within 1.6%. Qwen3-8B reproduced at 11.14 tok/s in a
second session four days later. Runs were not thermally limited (tj peaked
77.5 C against a 99 C throttle) and did not swap.
pytest) — 527 passed (484 existing + 43 new), on 3.11/3.12/3.13ruff check ./ruff format --check .cleanNotes
Scope is Orin only. Xavier and earlier stop at a JetPack that ships neither
a Tegra NVML nor a Tegra
nvidia-smi, so no GPU name reaches this code thereand nothing I could add to a name-keyed table would fire. I left them out rather
than ship entries that cannot be reached.
That also means this does not overlap with #146, which is about Xavier. It
touches the same file but not
_NVIDIA_UNIFIED_MEMORY_MARKERS, and the twomerge cleanly in either order — I checked.
Limits. One board. Only the Orin NX 16GB bandwidth is verified against
measured throughput; the other Orin entries are data-sheet values, annotated as
such in the code. I have no AGX Orin or Orin Nano to test on — they run the same
code path as the board I do have, with a different lookup key.
Left out deliberately. Below ~3 GiB of weights the estimate runs 34-42%
high, because achieved bandwidth on this board climbs with model size (39.8 GB/s
at 1.1 GB to 57.2 at 9.0 GB) while the formula treats it as constant. And MoE is
overestimated 2.4x for Qwen3-30B-A3B. Both are pre-existing, neither is
Jetson-specific, one board is not a basis for changing global constants, and
folding either into a detection fix would make this unreviewable. Happy to open
issues with the data if that is useful.