GPGPU v2
Our RISC-V GPGPU, now with DDR and HDMI
- 32lanes running each kernel in lockstep
- 1280×720over HDMI, 60 frames a second
- 2framebuffers in DDR: one shown while the other is drawn
- 40 MHztoday; the goal is closer to 100
What it is
The next version of our RISC-V GPGPU, with the same team and the same repository. The first version computed in the FPGA’s on-chip memory. Version 2 reaches the board’s DDR memory and draws to a monitor.
A host controller over AXI starts each kernel and reads its results, and a command-line tool builds, tests and programs the board.
Reaching DDR memory
When a kernel’s lanes load or store, the memory controller groups their addresses into AXI bursts, so neighbouring lanes share one trip to DDR. On the way back, one beat serves every lane waiting on a word in it, so lanes reading the same value don’t each wait for their own copy.
Drawing to a screen
The GPU writes each frame into one of two framebuffers in DDR. The VDMA reads the other one out, a timing controller produces 1280×720 at 60 frames a second, and an encoder turns it into HDMI. The host switches buffers at the start of the next frame, so a half-drawn picture never shows.
Catching faults and counting cycles
The hardware checks every memory access a kernel makes. An address outside the memory map, a write to memory the kernel may only read, or a misaligned word stops the kernel before anything changes, and so does an error reported by DDR itself. The host learns which kind of fault it was, which lanes caused it and at which instruction.
If the link to DDR stops behaving, with a burst that ends early or never ends, a reply nobody asked for, or no progress for about a million cycles, the GPU marks the fault as fatal and waits for a reset instead of hanging.
Counters in the hardware track every run: its cycles, how busy, blocked or idle each memory channel was, how many bursts were in flight, and why each warp stalled on a load or a store. The host reads them after the run and prints a report.
What it runs
The full RV32I instruction set, including byte and half-word loads and stores, and a call that ends a kernel cleanly once its lanes have finished. Programs are written in C.
Demo kernels draw Julia and Mandelbrot sets, metaballs, a spinning cube, a terrain, a triangle and a ripple, and simulate an N-body system in 3D. The ripple and the triangle run in the Live FPGA Lab, where anyone can start them.
Checking it
Each test program also runs on a software model of the GPU, which predicts every register and memory word, and the simulated hardware must match it.
What’s next
Branch divergence, so lanes can take different sides of a branch, and warp scheduling, so the GPU can switch to another group of lanes while one waits on memory. Then a clock closer to 100 MHz: today’s build runs at 40 MHz.
Repository
- RepositoryGitHub, opens in a new tabOpen
Team
Tools
What this project was built with. Pick one to see where else I used it.


