What is ILGPU

ILGPU provides an interface for programming GPUs that uses a sane programming language, C#. ILGPU takes your normal C# code (perhaps with a few small changes) and transforms it into either OpenCL or PTX (think CUDA assembly). This combines all the power, flexibility, and performance of CUDA / OpenCL with the ease of use of C#.

Setting up ILGPU.

This tutorial is a little different now because we are going to be looking at the ILGPU 1.0.0.

ILGPU should work on any 64-bit platform that .Net supports. I have even used it on the inexpensive nvidia jetson nano with pretty decent cuda performance.

Technically ILGPU supports F# but I don’t use F# enough to really tutorialize it. I will be sticking to C# in these tutorials.

High level setup steps.

If enough people care I can record a short video of this process, but I expect this will be enough for most programmers.

  1. Install the most recent .Net SDK for your chosen platform.
  2. Create a new C# project. dotnet new console
  3. Add the ILGPU package dotnet add package ILGPU
  4. ??????
  5. Profit

More Info

If you would like more info about GPGPU I would recommend the following resources.

Help us make these docs great!

All ILGPU docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.