KhronosGroup / EGL-Registry

EGL API and Extension Registry
118 stars 105 forks source link

Add an EGLDevice type attribute #206

Open emersion opened 2 weeks ago

emersion commented 2 weeks ago

Vulkan has VkPhysicalDeviceType which indicates what kind of device the VkPhysicalDevice is. It would be useful to add something similar to EGLDevice. (I personally need to figure out whether it's a software-based renderer, and check for EGL_MESA_device_software for now.)

stonesthrow commented 2 weeks ago

@cubanismo - add James for his interest in EGLDevice.

emersion commented 6 days ago

Gentle ping @cubanismo

cubanismo commented 5 days ago

I don't have much to add. There's some debate around the Vulkan equivalent over how much apps should be reading into device type, especially for the "virtual" one (E.g., is a "virtual" GPU necessarily slower? E.g., is a non-virtual iGPU faster than a virtual dGPU? Is a pass-through PCI device considered a "virtual" GPU?), but it's there and this probably isn't going to be any worse. If you want to make it an EXT, I'm happy to sign on from the NV side.

emersion commented 4 days ago

If you believe "virtual" should be omitted, I'd be happy to leave it out. Thanks for the feedback!

stonesthrow commented 4 days ago

Question: Is software vs hardware vs virtual the key? or are you trying to compare performance, to select the most performant option?

emersion commented 4 days ago

Personally I'm only interested in checking whether it's a software implementation. I'm writing Wayland compositors, so the whole desktop will be super sluggish if a software implementation is used (e.g. because the driver doesn't support new hardware, or because the user forgot to install the correct driver). I want users to opt-in to software rendering if they really want to use that, since that'll almost always indicate something wrong. I've received a number of bug reports about confused users not understanding why everything is so slow, or why their battery dry up so quickly.

stonesthrow commented 4 days ago

There could be a number of things useful - local host CPU, would impact CPU use - verses a discrete GPU, maybe GPU flops metric would indicate a certain level of performance - to compare more than one device option. Just looking for what is most informative/useful for the need. The VkPhysicalDeviceType covers a lot of this, but if you have 2 GPUs, could you select the more performant? (integrated vs discrete). Is this similar to VkPhysicalDeviceType - enough? Makes it easy if Vulkan is your backend. I don't think there is a clear and easy way to provide performance, so lets go for something compatible with VkPhysicalDeviceType

emersion commented 4 days ago

I already have a GPU selected before-hand. I'm creating one EGL context per DRM device node. I'm just interested to know whether the EGL device matching my DRM device is backed by a real hardware driver instead of a software renderer. I'm not interested in knowing which GPU is "most performant" for my use-case.