[FEATURE] Add GPU/CUDA environment diagnostics before suggesting PyTorch builds

Resolved 💬 3 comments Opened Oct 30, 2025 by Spacehunterz Closed Jan 9, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When troubleshooting PyTorch/CUDA compatibility issues, Claude Code doesn't check basic environment diagnostics before recommending solutions. This
leads to unnecessarily complex fixes.

Real example: User had RTX 5090 showing PyTorch compatibility warning. Claude immediately created multiple build scripts to compile PyTorch from
source (1-2 hour process). The actual problem was simple: the venv had old PyTorch 2.4.1+cu121 while system Python had working PyTorch
2.10.0.dev+cu128. Solution was just upgrading the venv's PyTorch.

For GPU/LLM workflows, users need quick accurate diagnostics that check:

  • Which GPU they have and its compute capability
  • PyTorch versions in ALL Python environments (system, venv, conda)
  • Whether installed PyTorch supports their GPU

Without this, Claude wastes time and tokens on complex solutions when simple package upgrades would work.

Proposed Solution

When Claude detects PyTorch/CUDA/GPU errors or warnings, it should automatically run diagnostics:

  1. Check GPU: Run nvidia-smi or torch.cuda.get_device_name() and torch.cuda.get_device_capability()
  2. Check ALL Python environments:
  • System Python (which python, version check)
  • Active venv (if exists)
  • Conda environments
  1. Check PyTorch in each environment: Version and CUDA version
  2. Verify compatibility: Does PyTorch support the GPU's compute capability?

Display results in a summary table, then suggest appropriate fix:

  • Usually: upgrade PyTorch in the relevant environment
  • Rarely: build from source (only if no prebuilt wheels exist)

This should be automatic for any CUDA/GPU-related error messages.

Alternative Solutions

Current workaround: Users must manually:

  • Specify which Python environment is having issues
  • Check PyTorch versions themselves
  • Research GPU compatibility
  • Correct Claude's approach mid-session

Alternative: Add a diagnostic command like /check-gpu that users can run, but automatic detection would be better for UX.

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗