mesamatrix icon indicating copy to clipboard operation
mesamatrix copied to clipboard

Generate the feature list using mesa C code

Open MightyCreak opened this issue 6 years ago • 9 comments

As said by @mirh in his https://github.com/MightyCreak/mesamatrix/pull/149#issuecomment-516082900, it might be possible to scrap the information directly from the mesa C code instead of features.txt.

If possible, it would be nice to generate a formatted text file by running a command with a binary compiled with mesa's code.

The idea would be to call the functions that set the extension flags, like this one for intel: intelInitExtensions.

Right now, I don't know if it's possible to get all the wanted information this way. It would need more investigation.

MightyCreak avatar Jul 29 '19 23:07 MightyCreak

That would also allow to have per-generation information about extensions.

mirh avatar Jul 30 '19 11:07 mirh

For the record: there is also gpuinfo

sehraf avatar Jul 30 '19 18:07 sehraf

And there's also glxinfo. They are all tools that run empirically on real hardware though, which is quite different than this.

mirh avatar Jul 30 '19 19:07 mirh

For the record (again): Here Rob Clark suggests to use a CI pipeline to run glxinfo to retrieve the driver's capabilities.

sehraf avatar Sep 10 '19 15:09 sehraf

AFAIK the hardware just reports what the driver tells him to. I'm not aware of any information other than the model number that you dynamically query.

It would certainly be easier because you just have to dump information that most of times is already easily pipelined (grep glxinfo, don't you?).. Still it kinda seems to miss the point here.

mirh avatar Sep 10 '19 22:09 mirh

@sehraf as @mirh said, glxinfo will only tell what the machine is currently running. A CI pipeline would work, but AFAIK you would need to have at least as many machines as you have drivers, and probably more if you want to test the GPU generations within these drivers.

Although it sounds like a pretty interesting project to set up, I don't have the resources (both time and money) to do it.

MightyCreak avatar Sep 11 '19 12:09 MightyCreak

I'm secretly hoping someone comes up w/ a way to generate features.txt (at least for drivers w/ drm_shim support) by running glxinfo in CI

I have no idea what drm_shim is but to me it sounds like this would be independent of hardware/machine. The advantage of CI is that you can have as many "machines" as you need. Also this would allow to automatically update features.txt with each commit.

sehraf avatar Sep 11 '19 15:09 sehraf

I've asked the question on the freedesktop thread about what is drm_shim and Rob answered this:

They are an $LD_PRELOAD'd thing to spoof enough of the kernel uabi to "run" the driver. Ie. you can't actually do drawing, but it is enough to run shader-db. And so I think it should be pretty much enough to run glxinfo.

So.. maybe it's doable, but apparently there are only 2 drivers supporting drm-shim for now: boradcom and freedreno. I've asked if there are more.

MightyCreak avatar Sep 11 '19 23:09 MightyCreak

Parsing source code still seems exponentially less wasteful (for as much as instead, there is more complexity in the code to write)

mirh avatar Sep 13 '19 08:09 mirh