Mesa - glCopyPixels is much slower on iris compared to i965

101 Views Asked by At

I'm working on a 3D application based on Blender 2.79 (which includes the old game engine), running on linux. Some more details about the system:

$ lsb_release -a | grep Description
Description:    Ubuntu 22.04.1 LTS
$ uname -r
5.15.0-46-lowlatency
$ lscpu | grep Intel
Model name:                    Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz

The application doesn't have much special about it except that it needs to copy every frame into memory. For this bge.texture.ImageTexture::refresh is used with its buffer parameter (see blender docs).

The problem I've been seeing is that the time spent in the refresh call is highly varied depending on whether I use i965 or iris as the driver. On the newer one, iris, I'm not capable of maintaining 60fps. I use the MESA_LOADER_DRIVER_OVERRIDE={i965,iris} environment variable.

This is not an issue on my current hardware, but I know that i965 does not work on newer hardware, in particular 12th gen intel CPUs.

I've produced some flame graphs when running each of those drivers. Here are the important (in my opinion) bits:

i965 (fast)

i965

iris (slow)

iris

It looks like with i965, after _mesa_ReadPixelsARB, the code jumps into the intel-specific part of mesa, while with iris it uses something called the state-tracker. I suppose this is a module that bridges mesa and Gallium3D, but I'm not confident that this information is helpful.

I also attached a debugger to the blender process to find that the _st_ReadPixels seems to enter the "slow" path, according to the author (see source)

At this point I would greatly appreciate someone more proficient at mesa and opengl to have a look at the information I have and help make sense of it.

0

There are 0 best solutions below