mirror of
https://github.com/Comfy-Org/comfyui-benchmark.git
synced 2026-11-04 23:47:33 +00:00
[PR #4] Fix nvidia-smi calls when --cuda-device is not set #3
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfyui-benchmark#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfyui-benchmark/pull/4
Author: @gerket
Created: 9/3/2026
Status: 🔄 Open
Base:
main← Head:fix-empty-smi-id-argument📝 Commits (1)
776a83eFix nvidia-smi calls when --cuda-device is not set📊 Changes
1 file changed (+5 additions, -3 deletions)
View changed files
📝
__init__.py(+5 -3)📄 Description
Problem
smi_idis built as a string and appended to a list-form argv:With no
--cuda-device,smi_idis""— and sincesubprocesspasses a list through verbatim, the child receives a real, empty argument rather than nothing:(Note the double space — the option name is the empty string.) Exit code 2 raises
CalledProcessError, socall_nvidia_smireturnsNonefor both probes inBenchmarkExtension.get_node_list, andENABLE_NVIDIA_SMI_DATAis never set.The habit comes from shells, where an empty unquoted variable does vanish through word splitting — but
"$var"quoted is an empty argument, the identical failure. A list has no word-splitting step at all, which is the point of the list form, so the conditional has to produce the list rather than a member of it.Impact
--cuda-devicedefaults toNone, so this affects every run that doesn't explicitly pass it. Those benchmarks record:info_nvidia_smi_query: null— no GPU name, driver version or vBIOSinitial_nvidia_smi_query: null— no starting VRAM/util/power/PCIe readingnvidia_smi_data: []— the sampling thread never starts, since it's gated onENABLE_NVIDIA_SMI_DATAIt fails silently. A failed probe is indistinguishable from the feature being switched off deliberately, so the benchmark JSON looks normal apart from the null fields. The error is captured in
nvidia_smi_error, which is what made it findable — that field held the message above on every run.Fix
Make
smi_ida list and splat it, so "absent" is genuinely absent.Verification
nvidia-smi 616.56, RTX 4090, Windows, ComfyUI 0.33.4 — both branches, before and after:
cuda_deviceNone0None0The working branch is unchanged; only the broken one moves.
Confirmed end to end on a live instance: after passing
--cuda-device 0as a workaround,nvidia_smi_errorcleared and both query fields populated (NVIDIA GeForce RTX 4090, 1, 616.56, Enabled, 95.02.3c.40.d1, …). This patch removes the need for that workaround.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.