NVIDIA Developer Zone

DirectCompute SDK Code Samples

The GPU Computing SDK includes 100+ code samples, utilities, whitepapers, and additional documentation to help you get started developing, porting, and optimizing your applications for the CUDA architecture. You can get quick access to many of the SDK resources on this page, SDK documentation, or download the complete SDK.

Please note that you may need to install the latest NVIDIA drivers and the DirectX SDK to compile and run the code samples. Refer to the SDK release notes for more information.

There are several sets of code samples included in the GPU Computing SDK download packages, please follow the links to browse other examples:


For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon. SimpleParticlesCS
This sample uses DirectCompute to simulate and visualize a large set of particles and their physical interaction. It implements a uniform grid data structure using either a fast radix sort or atomic operations.
  Minimum Required GPU
Minimum Required GPUor later
Minimum Required GPU

Download - Windows (x86)
Download - Windows (x64)


For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon. Ocean Simulation
This sample simulates an Ocean height field using DirectCompute FFT and renders the result using Direct3D10.
  Minimum Required GPU
Minimum Required GPUor later
Minimum Required GPU

Download - Windows (x86)
Download - Windows (x64)


For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon. N-Body Simulation
This sample demonstrates efficient all-pairs simulation of a gravitational n-body simulation in DirectCompute. This sample accompanies the GPU Gems 3 chapter "Fast N-Body Simulation with CUDA".
  Minimum Required GPU
Minimum Required GPUor later
Minimum Required GPU

Download - Windows (x86)
Download - Windows (x64)


For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon. ImageProcessingCS
This sample uses DirectCompute to render a 3D model and perform post processing on the rendered image.
  Minimum Required GPU
Minimum Required GPUor later
Minimum Required GPU

Download - Windows (x86)
Download - Windows (x64)