Open TimvanScherpenzeel opened 4 years ago
This article is about GPU detection of iPhones using the floating point precision. It works for iPhone 7 vs iPhone 8 and +. Maybe we could investigate to get more precision?
@bastienrobert we are currently using an optimised version of that in https://github.com/TimvanScherpenzeel/detect-gpu/blob/9b2b19726499439b545c084a569a16300ab2de7f/src/internal/deobfuscateAppleGPU.ts#L19-L118.
Some earlier research for handling iOS 12.2+ iPhones / iPads specifically was done in https://github.com/TimvanScherpenzeel/detect-gpu/issues/7.
It could be worth testing to see if we can get different floating point numbers on different Mac GPU's.
I think it is safe to say Safari only runs on Mac devices. From https://gfxbench.com/result.jsp I was able to gather the following list of possible GPU's (I'll update this comment with more data related to the specific devices).
// https://support.apple.com/nl-nl/HT202471
// 16-inch MacBook Pro: 3072x1920 (226 pixels / inch)
// 15-inch Macbook Pro: 2880x1800 (220 pixels / inch)
// 13-inch Macbook Pro: 2560x1600 (227 pixels / inch)
// MacBook Air: 2560x1600 (227 pixels / inch)
// MacBook: 2304x1440 (226 pixels / inch)
// 27-inch iMac: 5120x2880
// 21.5-inch iMac: 4096x2304, 1920x1080
// iMac Pro: 5120x2880
Apple iMac (21.5-inch, Late 2012) - NVIDIA GeForce GT 640M Mac Edition - (1920x1080)
Apple iMac (21.5-inch, Late 2012) - NVIDIA GeForce GT 650M Mac Edition - (1920x1080)
Apple iMac (21.5-inch, Mid 2014) - IntelĀ® HD Graphics 5000 - (1920x1080)
Apple iMac (21.5-inch, Now) - Intel Iris Plus Graphics 640 - (1920x1080)
Apple iMac (27-inch, Late 2012) - NVIDIA GeForce GTX 675MX Mac Edition - (2560x1600)
Apple iMac (27-inch, Late 2012) - NVIDIA GeForce GTX 680MX - (2560x1600)
Apple iMac (27-inch, Late 2013) - NVIDIA GeForce GT 755M Mac Edition - (2560x1600)
Apple iMac (Retina 5K, 27-inch, Late 2014/Mid 2015) - AMD Radeon R9 M290 - (5120x2880)
Apple iMac (Retina 5K, 27-inch, Late 2015) - AMD Radeon R9 M395 - (5120x2880)
Apple iMac (Retina 4K, 21.5-inch, Now) - Radeon Pro 555X - (4096x2304)
Apple iMac (Retina 4K, 21.5-inch, Now) - Radeon Pro 560X - (4096x2304)
Apple iMac (Retina 4K, 21.5-inch, Now) - Radeon Pro Vega 20 - (4096x2304)
Apple iMac (Retina 5K, 27-inch, Now) - Radeon Pro 5300 - (5120x2880)
Apple iMac (Retina 5K, 27-inch, Now) - Radeon Pro 5500 XT - (5120x2880)
Apple iMac (Retina 5K, 27-inch, Now) - Radeon Pro 5700 - (5120x2880)
Apple iMac (Retina 5K, 27-inch, Now) - Radeon Pro 5700 XT - (5120x2880)
Apple iMac Pro (Retina 5K, 27-inch, Late 2017) - AMD Radeon Pro Vega 56 - (5120x2880)
Apple iMac Pro (Retina 5K, 27-inch, Late 2017) - AMD Radeon Pro Vega 64 - (5120x2880)
Apple iMac Pro (Retina 5K, 27-inch, Late 2017) - AMD Radeon Pro Vega 64X - (5120x2880)
Apple Mac mini (Late 2014) - IntelĀ® Iris - (?)
Apple Mac mini (Now) - Intel UHD Graphics 630 - (?)
Apple Mac Pro (Late 2013) - AMD FirePro D300 - (?)
Apple Mac Pro (Late 2013) - AMD FirePro D500 - (?)
Apple Mac Pro (Late 2013) - AMD FirePro D700 - (?)
Apple Mac Pro (Now) - AMD Radeon Pro 580X - (?)
Apple Mac Pro (Now) - AMD Radeon Pro W5500X - (?)
Apple Mac Pro (Now) - AMD Radeon Pro W5700X - (?)
Apple Mac Pro (Now) - AMD Radeon Pro Vega II - (?)
Apple Mac Pro (Now) - AMD Radeon Pro Vega II Duo - (?)
Apple MacBook (Retina, 12-inch, Early 2015) - IntelĀ® HD Graphics 5300 - (2304x1440)
Apple MacBook Air (11-inch, Early 2015) - IntelĀ® HD Graphics 6000 - (1366x768)
Apple MacBook Air (11-inch, Mid 2012) - IntelĀ® HD Graphics 4000 - (1366x768)
Apple MacBook Air (11-inch, Mid 2013/Early 2014) - IntelĀ® HD Graphics 5000 - (1366x768)
Apple MacBook Air (13-inch, Early 2015) - IntelĀ® HD Graphics 6000 - (1440x900)
Apple MacBook Air (13-inch, Mid 2012) - IntelĀ® HD Graphics 4000 - (1440x900)
Apple MacBook Air (13-inch, Mid 2013/Early 2014) - IntelĀ® HD Graphics 5000 - (1440x900)
Apple MacBook Air (13-inch, Now) - Intel Iris Plus Graphics - (2560x1600)
Apple MacBook Pro (Retina, 13-inch, Late 2013/Mid 2014) - IntelĀ® Iris - (2560x1600)
Apple MacBook Pro (Retina, 13-inch, Late 2013/Mid 2014) - IntelĀ® Iris Graphics 6100 - (2560x1600)
Apple MacBook Pro (Retina, 13-inch, Late 2016) - IntelĀ® Iris Graphics 540 - (2560x1600)
Apple MacBook Pro (Retina, 13-inch, Now) - Intel Iris Plus Graphics 645 - (2560x1600)
Apple MacBook Pro (Retina, 13-inch, Now) - Intel Iris Plus Graphics - (2560x1600)
Apple MacBook Pro (Retina, 15-inch, Late 2013/Mid 2014) - IntelĀ® Irisā¢ Pro Graphics 5200 - (2880x1800)
Apple MacBook Pro (Retina, 15-inch, Late 2013/Mid 2014) - NVIDIA GeForce GT 750M Mac Edition - (2880x1800)
Apple MacBook Pro (Retina, 15-inch, Mid 2012/Early 2013) - IntelĀ® HD Graphics 4000 - (2880x1800)
Apple MacBook Pro (Retina, 15-inch, Mid 2012/Early 2013) - NVIDIA GeForce GT 650M Mac Edition - (2880x1800)
Apple MacBook Pro (Retina, 15-inch, Mid 2015) - AMD Radeon R9 M370X - (2880x1800)
Apple MacBook Pro (Retina, 15-inch, Mid 2015) - IntelĀ® Irisā¢ Pro Graphics 5200 - (2880x1800)
Apple MacBook Pro (Retina, 16-inch, Now) - AMD Radeon Pro 5300M - (3072x1920)
Apple MacBook Pro (Retina, 16-inch, Now) - AMD Radeon Pro 5500M - (3072x1920)
Apple MacBook Pro (Retina, 16-inch, Now) - AMD Radeon Pro 5600M - (3072x1920)
Agree with that
Sadly it appears that the benchmark data we use from gfxbench is quite outdated and Apple has been using a plethora of different GPUs over the years.
I think we can do some preliminary boxing of categories based on the screen size but at this point in time I don't see a feasible way to reasonably accurately determine the GPU.
Another challenge is that even if we are able to narrow down the scope it will be very hard to evaluate our implementation because you will need access to physical devices (Browserstack does that with mobile devices and tablets but desktops are virtualised).
This is one of the reasons why I prefer using detect-gpu for setting defaults in the application so that a user can pick the rendering quality themselves.
I'll leave this ticket open for now, any ideas are welcome :)
iPhone 12 Pro Max gets recognized as iPhone 11 Pro Max (both have the same screen size - not much we can do there)
Is safari manipulating the screen dimensions? Iphone 11 pro max has a 6,5 inch screen(2688x1242) and the Iphone 12 pro max has a 6,7 inch screen(2778x1284). Otherwise you could reliably* detect those 2 apart.
Interesting, the benchmark data reports both as having 2688x1242
, could be something funky going on there.
[
"apple a13 gpu",
"13",
0,
[
[2688, 1242, 60, "apple iphone 11 pro max"]
]
],
[
"apple a14 gpu",
"14",
0,
[
[2688, 1242, 60, "apple iphone 12 pro max"],
]
],
Ah.. wait a second, this is because of recent change where we include internalBenchMarkResults.ts, the resolution has been reported wrongly there: https://github.com/pmndrs/detect-gpu/blob/6f21403778c21690b6b141ea7a83b34c74e80b86/scripts/internalBenchmarkResults.ts#L92-L99
the resolution has been reported wrongly there:
Aha, phew š Safari isn't faking screen dimensions.
And that issue should be fixed now in 3.1.2 nice job! š
And that issue should be fixed now in 3.1.2 nice job! š
Fixed in 3.1.3, I had mistakingly not ran yarn build
after bumping the version making it so that it was still pointing to the old benchmarks.
@TimvanScherpenzeel
I'm seeing a problem in Safari 15 (Technology Preview Release 127) on macOS 11.4 on an iMac with an AMD Radeon Pro 580 8GB GPU.
The demo page (which appears to be loading the latest 3.1.9 release) incorrectly identifies the tier of this GPU:
{
"gpu": "apple gpu (Apple GPU)",
"isMobile": false,
"tier": 1,
"type": "FALLBACK"
}
On Chrome and Firefox, however, it is identified correctly:
{
"fps": 50,
"gpu": "amd radeon pro 580 opengl engine",
"isMobile": false,
"tier": 2,
"type": "BENCHMARK"
}
Let me know if there's anything I can do to help or any tests I can run.
@TimvanScherpenzeel ā Apologies, I misread your last comment to indicate that you'd fixed this problem in Safari 14.
I see this is still an ongoing issue.
Happy to help by running any tests.
Hi @CaelanStewart, you are correct that this is an open problem due to the obfuscation that Apple does. If you are able to expand the list I posted above here with more recent devices (GPU, device resolution) that would be helpful. Any new ideas of how we could deobfscate the GPU are welcome because we are at a bit of a dead end due to the large target base with very similar resolutions.
we could probably get quite far by detecting different models of apple laptops based on screen resolutions.. unless they are connected to an external display that is
@TimvanScherpenzeel I noticed you mentioned Active Theory's solution in #7 and mentioned it's a hacky way (I agree), but I want to point to their solution is based on 51Degrees/Renderer in case it helps. They do exactly the same but have excluded the CPU Benchmarking from their code.
Currently Safari 14 obfuscates the renderer string as 'apple gpu' preventing an accurate match.
https://github.com/TimvanScherpenzeel/detect-gpu/blob/de0e8d4695a0a6d8f8dcc424af68714ada2e76f7/src/internal/deobfuscateAppleGPU.ts#L119
A possible solution could be to have a lookup table of possible GPUs iMacs and Macbooks can have and matching on that with extra metadata (devicePixelRatio, screenSize, user agent).
Open for any suggestions / PR's š