Skip to content

fix: use --index-url for NVIDIA torch install, pass --cuda-version to fast-deps path#380

Merged
bigcat88 merged 1 commit intomainfrom
fix-nvidia-cuda-version-install
Mar 14, 2026
Merged

fix: use --index-url for NVIDIA torch install, pass --cuda-version to fast-deps path#380
bigcat88 merged 1 commit intomainfrom
fix-nvidia-cuda-version-install

Conversation

@bigcat88
Copy link
Contributor

Same class of bug as #379 (AMD ROCm fix), but for NVIDIA on Windows and Linux.

The NVIDIA pip path used --extra-index-url for all CUDA versions on Windows. When the CUDA index has an older torch than PyPI (cu118 tops at 2.7.1, cu121 at 2.5.1, cu124 at 2.6.0), pip picks PyPI's 2.10.0 which is CPU-only on Windows. Users selecting --nvidia --cuda-version 12.4 on Windows silently get a CPU torch.

On Linux, the NVIDIA path had no index flag at all — it just used plain PyPI. This meant --cuda-version was completely ignored.

The fix changes --extra-index-url to --index-url and makes the NVIDIA block platform-agnostic (same approach as the AMD fix in #379). The 5 repetitive elif blocks are collapsed into a single block that computes the CUDA tag dynamically from the --cuda-version enum value.

Additionally, the --fast-deps / uv path (DependencyCompiler) had hardcoded cu126 and rocm6.3 — it ignored both --cuda-version and --rocm-version. This PR adds cuda_version and rocm_version optional parameters to DependencyCompiler.init and passes them through from execute().

Verified with real pip --dry-run and real uv pip compile against all 10 index URLs (5 CUDA + 5 ROCm). All resolve to the correct GPU-specific torch. Confirmed the old --extra-index-url behavior was broken for cu118, cu121, cu124, rocm6.1, rocm6.2, rocm6.3 (PyPI's CPU torch won in all cases).

Relates to #289.

@bigcat88 bigcat88 force-pushed the fix-nvidia-cuda-version-install branch from 252d8cd to e9e7c45 Compare March 14, 2026 14:22
@bigcat88 bigcat88 force-pushed the fix-nvidia-cuda-version-install branch from e9e7c45 to 6090345 Compare March 14, 2026 14:24
@bigcat88 bigcat88 marked this pull request as ready for review March 14, 2026 14:33
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Mar 14, 2026
@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #380      +/-   ##
==========================================
+ Coverage   63.10%   63.44%   +0.34%     
==========================================
  Files          33       33              
  Lines        3697     3699       +2     
==========================================
+ Hits         2333     2347      +14     
+ Misses       1364     1352      -12     
Files with missing lines Coverage Δ
comfy_cli/command/install.py 72.74% <100.00%> (+1.87%) ⬆️
comfy_cli/uv.py 57.66% <100.00%> (+1.77%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bigcat88 bigcat88 merged commit 71c8ea0 into main Mar 14, 2026
16 of 17 checks passed
@bigcat88 bigcat88 deleted the fix-nvidia-cuda-version-install branch March 14, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant