Skip to content

fix: Don't inject device nodes when NVIDIA_VISIBLE_DEVICES=none#1562

Merged
elezar merged 3 commits intoNVIDIA:mainfrom
elezar:fix-visible-devices-none
Jan 12, 2026
Merged

fix: Don't inject device nodes when NVIDIA_VISIBLE_DEVICES=none#1562
elezar merged 3 commits intoNVIDIA:mainfrom
elezar:fix-visible-devices-none

Conversation

@elezar
Copy link
Member

@elezar elezar commented Jan 8, 2026

There is a bug in the jit-cdi mode where NVIDIA_VISIBLE_DEVICES=none behaves the same way as NVIDIA_VISIBLE_DEVICES=all. These changes add a (initially failing) integration test for this case as well as fixing the behaviour.

Support is also added for generating a CDI spec for an nvidia.com/gpu=none device when running:

nvidia-ctk cdi generate --device=none

Fixes #1555

See failing test case added here https://github.com/NVIDIA/nvidia-container-toolkit/actions/runs/20808503321/job/59767855888?pr=1562

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar added this to the v1.18.2 milestone Jan 8, 2026
@elezar
Copy link
Member Author

elezar commented Jan 8, 2026

/cherry-pick release-1.18

@coveralls
Copy link

coveralls commented Jan 8, 2026

Pull Request Test Coverage Report for Build 20911691037

Details

  • 5 of 21 (23.81%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 36.816%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/nvidia-ctk/cdi/generate/generate.go 1 4 25.0%
pkg/nvcdi/lib-nvml.go 1 14 7.14%
Totals Coverage Status
Change from base Build 20856280461: -0.02%
Covered Lines: 5211
Relevant Lines: 14154

💛 - Coveralls

@elezar elezar changed the title test: Add failing test for NVIDIA_VISIBLE_DEVICES=none fix: Don't inject device nodes when NVIDIA_VISIBLE_DEVICES=none Jan 8, 2026
@elezar elezar force-pushed the fix-visible-devices-none branch from 1aadeb7 to af9e7c6 Compare January 8, 2026 10:32
@elezar elezar marked this pull request as ready for review January 8, 2026 11:57
@elezar elezar requested review from cdesiniotis and klueska January 8, 2026 11:57
@elezar elezar added the bug Issue/PR to expose/discuss/fix a bug label Jan 8, 2026
Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar force-pushed the fix-visible-devices-none branch from af9e7c6 to 84f3314 Compare January 8, 2026 13:01
This change adds support for generating a CDI spec for a
nvidia.com/gpu=none device.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar force-pushed the fix-visible-devices-none branch from 84f3314 to cab62ee Compare January 12, 2026 07:47
@elezar elezar merged commit e3ef4bf into NVIDIA:main Jan 12, 2026
13 checks passed
@elezar elezar deleted the fix-visible-devices-none branch January 12, 2026 07:55
@github-actions
Copy link

🤖 Backport PR created for release-1.18: #1569

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

Labels

bug Issue/PR to expose/discuss/fix a bug cherry-pick/release-1.18

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After upgrading to the following version, when I configured NVIDIA_VISIBLE_DEVICES=none, nvidia-smi was able to detect all the devices.

3 participants