Skip to content

Add real CuPy - CUDA in Python QuickByte#260

Closed
Graviton28 wants to merge 2 commits into
masterfrom
add-cupy-doc
Closed

Add real CuPy - CUDA in Python QuickByte#260
Graviton28 wants to merge 2 commits into
masterfrom
add-cupy-doc

Conversation

@Graviton28

Copy link
Copy Markdown
Contributor

Summary

Related to #151. The README's "CuPy - Cuda in Python" link pointed to CuPy_on_CARC.ipynb, which was never actually added to the repo (checked full history/all branches, no trace of it) — a 404 since it was written. This adds real content instead of just removing the dead link (see companion PR #258 for the minimal link-removal fix to the same issue, which no longer touches this README line so the two don't conflict).

New cupy_intro.md covers:

  • Installing CuPy on Easley (with two real gotchas found along the way — see below)
  • Basic array usage (cupy.ndarray, cupy.asnumpy)
  • A real CPU-vs-GPU matmul benchmark
  • A clearly-labeled conceptual (not fully tested) section on multi-GPU CuPy with NCCL/MPI, based on the CS491/591 HPC course's Lecture 20 slides

Test plan

  • conda install -c conda-forge cupy fails on Easley with cudaErrorInsufficientDriver (pulls CUDA 13.x, driver is R570 which only supports up to CUDA 12.x) — documented the fix (pip install cupy-cuda12x[ctk]).
  • Basic array creation/ops/asnumpy verified in a live Python session on an l40s GPU.
  • CPU-vs-GPU matmul benchmark run for real on an l40s GPU (N=1000/2000/4000/8000) — real numbers included in the doc, including the N=1000 case where GPU is actually slower (documented as a real, expected pattern).

Replaces the previously dead CuPy_on_CARC.ipynb link (issue #151,
which was never actually added to the repo) with an actual tested
tutorial: installing CuPy on Easley, basic array usage, and a real
CPU-vs-GPU matmul benchmark run on an l40s GPU.

Found and documented two real install gotchas along the way:
- conda-forge's default cupy package pulls CUDA 13.x, which needs a
  newer driver than Easley's GPU nodes have (cudaErrorInsufficientDriver)
  - use the cupy-cuda12x pip wheel instead.
- That wheel alone can't JIT-compile kernels (e.g. cupy.random) without
  the [ctk] extra, which bundles CUDA toolkit headers.

Also includes a "Going Further" section on multi-GPU CuPy with NCCL
and MPI, based on the CS491/591 HPC course's Lecture 20 slides -
explicitly marked as conceptual/untested since a full working
multi-GPU script wasn't verified for this QuickByte.
The two REPL snippets showed >>> commands and their printed output
in the same code block. Split each into a command block and a
separate "Expected output" block, matching this session's convention.
@Graviton28

Copy link
Copy Markdown
Contributor Author

Combining with #258 into #261 — closing this one in favor of the combined PR.

@Graviton28 Graviton28 closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant