What problem does it solve?
GPU-accelerated Python code often breaks on machines without NVIDIA GPUs or with mismatched CUDA driver/toolkit/library versions, forcing developers to add brittle imports and scattered conditionals.
Core Features & Use Cases
- Optional-dependency routing (core artifact): detects CUDA at runtime, exposes an
xp namespace (CuPy if usable, NumPy otherwise), and guarantees CPU-safe imports so the same package works in CI and production.
- CUDA-capable tooling map: helps you choose between CuPy, Numba @cuda.jit, PyCUDA (legacy), and cuda-python (official low-level bindings) based on task level and debugging needs.
- High-stakes operational guidance: provides a symptom-indexed troubleshooting playbook for common CUDA failures like driver/toolkit mismatch and illegal memory access, plus memory-management and interop patterns.
Quick Start
Ask: "Plan and implement a CPU/GPU optional module using cuda-python optional dependency detection, then show how to write one function that uses xp on GPU when available and falls back to CPU when not."