0Pricing
CUDA Academy · Lesson

Hello GPU: Your First .cu File

Build and run a minimal CUDA program.

Your First .cu File

Time to build something real. A CUDA program lives in a .cu file, which can hold both CPU and GPU code side by side. 🎉

Include the Header

Most CUDA samples start by pulling in standard headers. The CUDA runtime header is included automatically by nvcc, so iostream is often enough.

#include <cstdio>

All lessons in this course

  1. Driver, Runtime, and Toolkit Versions
  2. Reading nvidia-smi Like a Pro
  3. Compiling with nvcc
  4. Hello GPU: Your First .cu File
← Back to CUDA Academy