Build C++ and CUDA programs with the NVIDIA CUDA development toolkit.
962
Build C++ and CUDA programs with the NVIDIA CUDA development toolkit.
You learn to use cpp-cuda in a Docker container.
This image uses the NVIDIA CUDA development image for Ubuntu.
It includes nvcc, C++ build tools, CMake, Ninja, ccache, Git, and OpenSSL headers.
You can compile and link CUDA programs without a GPU.
The image has no Nsight Compute profiler. The course does not use it.
The default working directory is /workspace. The default command is Bash.
| Tag | Meaning | Platform |
|---|---|---|
latest | Latest successful build from main | linux/amd64 |
The latest tag changes after a new build passes its tests.
See all tags and digests.
See the Dockerfile
for the CUDA version of the current build.
Compile main.cu in your current directory:
docker pull stden/cpp-cuda:latest
docker run --rm -v "$PWD":/workspace stden/cpp-cuda:latest nvcc main.cu -o app
To run the program on a GPU, install a compatible NVIDIA driver and the NVIDIA Container Toolkit on the Docker host. Then run this command:
docker run --rm --gpus all -v "$PWD":/workspace stden/cpp-cuda:latest ./app
Install extra project dependencies in a child image. Build output stays in the mounted project directory. Files that the container creates belong to root. Before you run GPU code, check that the host driver supports the CUDA version.
The smoke test compiles and links a real CUDA kernel. It also runs a host C++ program. It does not run a GPU kernel. The standard CI runner does not test physical GPU operation.
Content type
Image
Digest
sha256:08aa794fe…
Size
4.7 GB
Last updated
1 day ago
docker pull stden/cpp-cuda