[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Use powerPreference to request high or low power GPUs



Cross-adapter sharing is possible on Windows, but only via
DirectComposite, which no one leverages yet, to my knowledge.

On Mon, Jul 2, 2018 at 7:32 PM, Dean Jackson <dino@apple.com> wrote:
> Hi Rachid,
>
>> On 3 Jul 2018, at 10:37, Rachid El Guerrab <rachid.el.guerrab@gmail.com> wrote:
>>
>> 1) Do you have statistics on how many people run WebGL on laptops with dual cards? Just curious why you think it's a small set..
>
> As far as I'm aware, the MacBook Pro 15" is the only laptop that has dual GPUs and can dynamically swap between the two (and not all configurations of MacBook Pro 15" have dual GPUs). I'm not familiar with Windows, but when we discussed this in the group I remember hearing that dual-GPU Windows devices can only use one GPU at a time (i.e. it doesn't matter what the content requests because the browser doesn't have a choice). This might change in future versions of Windows. I don't know if Linux handles this configuration at all.
>
> For the MacBook Pro case, Apple doesn't release sales data by model, so I'm not sure how popular it is in comparison to MacBooks and MacBook Airs.
>
> But I think it is ok to guess that it is a fairly small set, firstly in comparison to the total number of laptop users, then the total number of desktop OS users, then to the total number of users on mobile and desktop.
>
>>
>> 2) I get that I can query the vendor string.
>> But the webgl committee creates this neat API, and vendors spend time implementing it, to give us some useful abstraction to GPU power, in realtime, which is awesome.
>> And now you're telling me I should ignore all that work and query the string myself? What's the point then??
>
> Would being able to check the actual value we used when creating be enough? In Safari, you do actually end up getting what you want most of the time. However, it can change as the user hides the tab or application. You can detect this by listening for a "webglcontextchanged" event (although I just noticed this never made it into the specification, so it's non-standard :( )
>
>>
>> My content can adapt in many ways if I know I've switched to a lower profile, at the beginning or dynamically.
>>
>> But if i don't know, then what's the point? A message to the user that wouldn't know what to do about it?
>
> Let's consider the case of two MacBook Pros - one with a second GPU, one without. The "low-power" GPU on the first is both the "low-power" and "high-performance" GPU on the second. If you decide that your app *really* needs to run on the best GPU, you'd ask for "high-performance". But on that second device, you're not getting a more powerful GPU. So your content has to either:
>   - be designed to run on a wide range of hardware
>   - query the GPU vendor string and hopefully know what that means for your app
>
> And this still applies even if there was no way to even request a high or low power GPU, or to older dual-GPU hardware where the high-performance GPU is slower than today's low-power GPU, or actually to any other hardware.
>
> I'm not arguing with you btw - just pointing out that it doesn't really matter whether you get one GPU or another. You have to assume the worst unless you're willing to check the vendor string and know what it means to your app. The powerPreference parameter gives the author the ability to indicate that their content is (hopefully) "simple" enough to not need the fastest GPU (e.g. it isn't a full-page game or a cryptocurrency miner).
>
> Dean
>
>
>>
>> - Rachid
>>
>>> On Jul 2, 2018, at 5:13 PM, Dean Jackson <dino@apple.com> wrote:
>>>
>>>
>>>
>>>> On 3 Jul 2018, at 01:59, Rachid El Guerrab <rachid.el.guerrab@gmail.com> wrote:
>>>>
>>>> I second Gregg Tavares's question about what's reported back.
>>>>
>>>> How can we tell if we're running with the high-performance option or not?
>>>
>>> Why should it matter? A relatively small set of people have dual GPU systems - and most people don't have powerful GPUs. And that's before you consider mobile devices.
>>>
>>> Also, in Safari on macOS, you don't necessarily get what you ask for anyway. You might ask for low-power but get high-performance because another app (or page) on the system has fired up that GPU. In other words, you have to write your content to work on the average GPU.
>>>
>>> But if you really have a good reason to know, you can query the GPU vendor string. It would be up to you to decide whether you think that's a high-performance GPU.
>>>
>>> Dean
>>>
>>>
>>>
>>>
>

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------