npx skills add ...
npx skills add nvidia/skills --skill cupynumeric-install
Install and verify cuPyNumeric for Python — requirements, commands, verification. Source builds are out of scope.
npx skills add nvidia/skills --skill cupynumeric-install
Use this skill to install cuPyNumeric for use from Python and to verify the install actually works (including GPU usage). Apply it whenever a user wants cuPyNumeric running via conda or pip. Do not use it to build from source (to modify or contribute) — that is out of scope.
pip install, conda install, or any installer. Print the command; let the user run it.--version checks are fine.Confirm these system requirements before recommending any install:
Follow these steps in order: confirm the prerequisites, ask the scoping questions, install via the chosen path, then verify.
conda --version and pip --version. Prefer conda (upstream-recommended); fall back to pip.nvidia-smi / nvcc --version.If neither conda nor pip is available, install one. Provide the command and the docs link; do not run it.
Docs: https://github.com/conda-forge/miniforge
Install Python from your OS package manager (apt/dnf/brew) or https://www.python.org/downloads/. If pip is missing on an existing Python: python -m ensurepip --upgrade.
After installing, open a new shell so the binary is on PATH.
Into an existing env: conda install -c conda-forge -c legate cupynumeric.
conda auto-selects the GPU vs CPU variant from whether nvidia-smi works at install time. To override that, see below.
Set CONDA_OVERRIDE_CUDA only when no GPU is visible at install time (e.g. building a container for a GPU host). Use the runtime host's CUDA version:
Run a self-contained script through the legate launcher — no repo checkout needed.
Expect sum: 45 and matmul: 64.0. If legate is missing, the env is not activated — see Troubleshooting.
A passing smoke test does not prove GPU usage — a CPU-variant install on a GPU box produces correct results too. Run both steps.
1. Force a GPU launch. legate --gpus N requests N GPUs; fails fast if no GPU is visible or the CPU variant is installed.
Expect 16777216.0. If you see CUDA driver, libcudart, or no GPUs available, the CPU variant is installed; reinstall with CONDA_OVERRIDE_CUDA.
2. Confirm the GPU was touched. Run a deadline-bounded matmul loop alongside nvidia-smi, all from one shell — no second-terminal race:
Expect memory.used in the GiB range across most samples and non-trivial
utilization.gpu in several. If both stay at baseline across every sample, the
GPU variant is not installed — check conda list cupynumeric for *_gpu (not
*_cpu).
See verification_examples.md for multi-GPU checks, CPU fallback, container, and troubleshooting.
pip uninstall nvidia-cupynumeric or conda remove cupynumeric first.legate launcher for multi-GPU / multi-rank runs. Plain python runs single-process: legate --gpus 2 script.py.CONDA_OVERRIDE_CUDA. conda otherwise auto-selects the CPU or GPU variant from nvidia-smi at install time.conda --version ≥ 24.1. Older releases silently break variant selection.ModuleNotFoundError: No module named 'cupynumeric' → Run which python and pip list | grep cupynumeric (or conda list | grep cupynumeric) from the same shell to find the env mismatch.ImportError mentioning CUDA / libcudart → Reinstall with CONDA_OVERRIDE_CUDA="<your-cuda-version>"; the CPU variant is on a GPU box, or CUDA versions are mismatched.legate: command not found → Activate the env, then run which legate to confirm.