Graphics

Same pixel count, different CUDA render time

A Mandelbrot zoom took 43% longer to compute on my RTX 3060 Ti. Every pixel matched the C++ reference.

I wrote a Mandelbrot renderer in CUDA C++ and pointed it at two views. Both had 921,600 pixels. Only the center and scale changed.

Overview of the Mandelbrot set with its central dark body and surrounding escape bands
The full view. One CUDA thread handles each pixel.

Each thread starts at zero and repeats z = z² + c, where c is its pixel’s position. It stops when the magnitude exceeds two or after 512 iterations. I ran the same calculation on a single CPU thread and compared the escape counts before turning them into colors. All 1,843,200 counts matched.

A closer look at the boundary

Mandelbrot boundary zoom showing fine spiral filaments
The zoom uses the same resolution, kernel and iteration limit.
Render times in milliseconds
ViewGPU kernelGPU with readbackCPU
Overview12.0112.40237.32
Boundary17.1917.60235.58

GPU figures are medians of seven timed runs after a warmup. The CPU column records one pass per view. These timings exclude compiling the kernel and writing the images.

The zoom cost about five extra milliseconds on the GPU. Neighboring pixels can escape on different iterations, so threads in the same warp can finish at different times. I’d need profiler measurements to tell how much that contributed to the difference.

Download the C++ source and reproduce the benchmark