Leanpub Header

Skip to main content

Programming Concurrency on GPUs with Rust

Examine, Run, and Measure GPU Workloads Using CUDA, Streams, and Async Pipelines

Programming Concurrency on GPUs with Rust
This book is 100% completeLast updated on 2026-10-09

We will work in pure Rust, with no C++ shim or Python wrapper. We will build one small program that grows to cover the whole book. It begins as a loop that any of us could have written on a bad day. After gaining a kernel, it learns to stop waiting, grows streams and pinned memory, and ends as a pipeline fed by parallel producers through bounded channels. The device is busy almost every millisecond.

Minimum price

$29.99

$29.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

EPUB
About

About

About the Book

The bottleneck is not your kernel. In fact, it almost never is.

After spending enough time in Nsight, the way you read a timeline becomes as intuitive as a mechanic listening to an engine. The same faults keep cropping up, such as a GPU with thousands of cores sitting idle behind a blocking copy, a single default stream or a host thread frozen at a synchronisation point that was never necessary. This book is about identifying that fault early and eliminating it.

Designed for programming professionals, this book is written for GPU developers, Rust engineers and AI practitioners who want their devices to be busy, not just correct. Our approach is to stay in pure Rust throughout, using cuda-oxide for SIMT kernels and cutile-rs for the tile model. We also rely heavily on the type system to ensure that data races fail at compile time rather than at 3 AM during production. We will overlap transfers with compute using streams and pinned memory, build a staging ring that pipelines every stage and feed the GPU through Tokio producers with bounded-channel backpressure. Each technique is profiled, verified against a CPU reference and measured.

Key Learnings
  • Profile before you optimise, and let Nsight Systems show you who is actually waiting.
  • Write SIMT kernels in pure Rust where data races fail at compile time.
  • Treat default stream as the enemy of overlap, and fork your own.
  • Overlap copies with compute using pinned memory and a staging ring.
  • Reach for reduction ladder instead of atomics when summing on the device.
  • Express element-wise work as tile kernels, and let compiler map the hardware.
  • Keep the GPU fed with Tokio producers and bounded-channel backpressure.
  • Verify every kernel against CPU reference before you trust its timing.
  • Weigh throughput against latency, since tuning for one quietly taxes the other.
  • Know when to stop, because past a point concurrency only adds bookkeeping.

Table of Content
  1. Rust’s Threads, Timing and Ownership
  2. CPU versus GPU Execution
  3. SIMT Kernels, Blocks and Grids
  4. Race-Free Parallel Kernels
  5. Asynchronous GPU Execution
  6. Overlapping Transfers with Streams
  7. Tile Programming with cutile-rs
  8. Async GPU Pipelines with Tokio
  9. Throughput, Latency and Bottlenecks

Target Audience

If you're a programmer looking for a hands-on guide to GPU programming, Rust techniques and AI principles, this book is for you. It's designed to help you make the most of your device's processing power.

Author

About the Author

GitforGits | Asian Publishing House

We are the engineer’s publisher, the coder’s mentor, and the content alchemist—meticulously turning dense tech into practical gold. With a growing library of 100+ titles, we don’t just develop technical books, rather we build roadmaps for professionals across Python, MySQL, DevOps, Rust, AI, Kotlin, Arduino, Golang and everything around the massive IT ecosystem. Every chapter, every script, every project is a tool in the hands of developers who want to get things done.

Where others summarize, we construct step-by-step learning blueprints, cutting through clutter, banning the fluff, and ensuring every paragraph delivers hands-on value. Our audience isn’t learning from scratch—they’re leveling up with purpose, and we stand by them with code-first content, consistent project workflows, and a zero-redundancy approach.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub