Lavapipe performance

Jose Fonseca jose.fonseca at broadcom.com
Thu Jan 30 13:49:31 UTC 2025


That's a relatively large geometry count.

llvmpipe (and consequently lavapipe) was optimized for desktop compositors
and UIs: large textured quads with blending, where most of the time is
spent in the fragment shader, particular texture sampling.

Not much effort went into optimizing llvmpipe for high geometry count --
for example, VS is not overlapped with FS.  At one point there was another
SW renderer gallium driver by a team at Intel that was specifically
optimized for huge number of primitives with no texturing (like the sort
used by https://vtk.org/ ), but I can't remember its name or find it.

Tiny triangles are also inefficient, because llvmpipe always runs 2x2 pixel
stamps, no matter if the triangle only covers a single pixel, plus blending
is always done in 4x4 pixels stamps.

Can you share a screenshot of what's being rendered to get a notion?

To make the most of llmvpipe ensure that:
- llvmpipe is using 8 (or 16?) threads (I believe using the number of cores
is the default, you can control this via `LP_NUM_THREADS:`)
- disable things that increase computation for minor visual enhancements,
like MSAA or anisotropic filtering
- make sure texture mag/min mipmap filters are the same
- avoid transparency
- privilege 32-bits rendertarget and texture formats like B8G8R8A8 /
R8G8B8A8

Jose


On Thu, Jan 30, 2025 at 12:15 PM George Karpathios <gkarpa1 at gmail.com>
wrote:

> Hi,
>
> I'm using Lavapipe (24.2.2, Windows 10) and trying to evaluate its
> performance, but I don't know if I can get more performance out of it or if
> I'm hitting its expected limits.
>
> For example, rendering a scene with ~300k triangles and ~150k lines, I get
> 5 fps on an i7 11800H (8 cores).  Of course I'm not expecting miracles but
> I was wondering if this is an expected performance range or if it should
> perform better.
>
> I have profiled it using VS's builtin tools, I'm getting some hotspots
> inside Lavapipe's dll, but I can't make any meaningful results by myself,
> or associate them with our code, in case we're doing something wrong that
> hurts the performance. I can't figure out what's normal and what's not, so
> if anyone would be willing to take a look at those, maybe someone can spot
> something out of the ordinary or provide some hints for me to understand it
> better and be able to continue, I would be grateful. I have uploaded a few
> screenshots at https://imgur.com/a/UvqwBzR . Thanks in advance!
>

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20250130/b0c160cc/attachment.htm>


More information about the mesa-dev mailing list