NVIDIA/cuda-samples
Samples for CUDA Developers which demonstrates features in CUDA Toolkit
What it solves
This repository provides a comprehensive collection of reference implementations and examples for developers using the NVIDIA CUDA Toolkit. It helps developers learn how to use CUDA features, implement GPU-accelerated algorithms, and verify that their CUDA environment is correctly configured.
How it works
The project is organized into C++ and Python samples. The C++ samples are built using CMake and can be targeted to specific GPU architectures (SM versions). The Python samples use the cuda.core API via the CUDA Python library, integrating with NumPy and CuPy for memory and program launches.
Who it’s for
It is designed for CUDA developers who need practical examples of GPU programming, from beginners getting started with basic vector addition to advanced users implementing distributed computing or framework interop with PyTorch and TensorFlow.
Highlights
- Multi-Language Support: Includes both C++ and Python examples.
- Broad Platform Support: Supports Linux, Windows, and cross-compilation for Tegra and QNX platforms.
- Extensive Coverage: Covers core concepts like reductions, histograms, FFT, stream overlap, and multi-GPU peer-to-peer patterns.
- Automated Testing: Includes a
run_tests.pyscript to execute all samples as a sanity check for the environment. - Framework Interop: Provides specific examples for integrating CUDA with PyTorch and TensorFlow.
Related
- Project
- Project
- Project
- Project