@pmndrs/detect-gpu 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -3
- package/dist/benchmarks/d-adreno.json +252 -1
- package/dist/benchmarks/d-amd.json +13347 -1
- package/dist/benchmarks/d-apple.json +237 -1
- package/dist/benchmarks/d-geforce.json +7490 -1
- package/dist/benchmarks/d-intel.json +3702 -1
- package/dist/benchmarks/d-nvidia.json +12072 -1
- package/dist/benchmarks/d-radeon.json +11988 -1
- package/dist/benchmarks/m-adreno.json +2503 -1
- package/dist/benchmarks/m-apple-ipad.json +397 -1
- package/dist/benchmarks/m-apple.json +363 -1
- package/dist/benchmarks/m-intel.json +517 -1
- package/dist/benchmarks/m-mali-t.json +1295 -1
- package/dist/benchmarks/m-mali.json +2017 -1
- package/dist/benchmarks/m-nvidia.json +81 -1
- package/dist/benchmarks/m-powervr.json +499 -1
- package/dist/benchmarks/m-samsung.json +43 -1
- package/dist/index.d.mts +65 -58
- package/dist/index.mjs +3 -3
- package/package.json +79 -107
- package/dist/index.d.ts +0 -72
package/README.md
CHANGED
|
@@ -4,20 +4,50 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@pmndrs/detect-gpu)
|
|
5
5
|
[](https://unpkg.com/@pmndrs/detect-gpu)
|
|
6
6
|
|
|
7
|
+
> **Migrating from `detect-gpu`?** This package has moved to `@pmndrs/detect-gpu`. Update your imports:
|
|
8
|
+
>
|
|
9
|
+
> ```diff
|
|
10
|
+
> - import { getGPUTier } from 'detect-gpu';
|
|
11
|
+
> + import { getGPUTier } from '@pmndrs/detect-gpu';
|
|
12
|
+
> ```
|
|
13
|
+
|
|
7
14
|
Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications. Think of it like a user-agent detection for the GPU but more powerful.
|
|
8
15
|
|
|
16
|
+
> **Note:** Our benchmark data source ([gfxbench.com](https://gfxbench.com)) stopped updating in December 2025. The current data remains accurate for existing GPUs, but we are exploring alternative data sources for future updates. See [#132](https://github.com/pmndrs/detect-gpu/issues/132) for progress.
|
|
17
|
+
|
|
9
18
|
## Demo
|
|
10
19
|
|
|
11
20
|
[Live demo](https://pmndrs.github.io/detect-gpu/)
|
|
12
21
|
|
|
13
22
|
## Installation
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
```sh
|
|
25
|
+
pnpm add @pmndrs/detect-gpu
|
|
26
|
+
```
|
|
16
27
|
|
|
17
28
|
```sh
|
|
18
29
|
npm install @pmndrs/detect-gpu
|
|
19
30
|
```
|
|
20
31
|
|
|
32
|
+
```sh
|
|
33
|
+
yarn add @pmndrs/detect-gpu
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Self-hosting benchmark data
|
|
37
|
+
|
|
38
|
+
By default benchmark data is loaded from the [UNPKG](https://unpkg.com) CDN (`https://unpkg.com/@pmndrs/detect-gpu@{version}/dist/benchmarks`). To serve it yourself (e.g. for offline environments, strict CSP, or to avoid a third-party CDN):
|
|
39
|
+
|
|
40
|
+
1. Download [benchmarks.tar.gz](https://github.com/pmndrs/detect-gpu/raw/master/benchmarks.tar.gz) and extract it into a publicly served directory — for example `public/benchmarks/` in your app.
|
|
41
|
+
2. Point `getGPUTier` at that URL via the `benchmarksURL` option:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
const gpuTier = await getGPUTier({
|
|
45
|
+
benchmarksURL: '/benchmarks',
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The directory must be served at the exact URL passed in — `detect-gpu` appends filenames like `/benchmarks-d-*.json` to it when fetching.
|
|
50
|
+
|
|
21
51
|
## Usage
|
|
22
52
|
|
|
23
53
|
```ts
|
|
@@ -39,6 +69,21 @@ const gpuTier = await getGPUTier();
|
|
|
39
69
|
|
|
40
70
|
Based on the reported `fps` the GPU is then classified into either `tier: 1 (>= 15 fps)`, `tier: 2 (>= 30 fps)` or `tier: 3 (>= 60 fps)`. The higher the tier the more graphically intensive workload you can offer to the user.
|
|
41
71
|
|
|
72
|
+
## Result types
|
|
73
|
+
|
|
74
|
+
`getGPUTier()` returns a `type` field indicating how the result was produced:
|
|
75
|
+
|
|
76
|
+
| `type` | Meaning |
|
|
77
|
+
| ------------------------ | ----------------------------------------------------------------------------------- |
|
|
78
|
+
| `BENCHMARK` | Matched a benchmark entry; `fps` reflects the measured framerate for that GPU. |
|
|
79
|
+
| `FALLBACK` | Renderer recognised but no benchmark match found. `tier` is a conservative default. |
|
|
80
|
+
| `BENCHMARK_FETCH_FAILED` | Benchmark fetch failed (CDN outage, strict CSP, offline, etc.). Safe to retry. |
|
|
81
|
+
| `BLOCKLISTED` | Renderer is on a known-bad list (drivers with severe issues). `tier` is always 0. |
|
|
82
|
+
| `WEBGL_UNSUPPORTED` | No WebGL context could be created. `tier` is always 0. |
|
|
83
|
+
| `SSR` | Running server-side — no `window`, detection skipped. |
|
|
84
|
+
|
|
85
|
+
The `fps` field is populated only for `BENCHMARK` results. All other `type` values leave `fps` as `undefined`.
|
|
86
|
+
|
|
42
87
|
## API
|
|
43
88
|
|
|
44
89
|
```ts
|
|
@@ -46,7 +91,7 @@ getGPUTier({
|
|
|
46
91
|
/**
|
|
47
92
|
* URL of directory where benchmark data is hosted.
|
|
48
93
|
*
|
|
49
|
-
* @default https://unpkg.com/detect-gpu@{version}/dist/benchmarks
|
|
94
|
+
* @default https://unpkg.com/@pmndrs/detect-gpu@{version}/dist/benchmarks
|
|
50
95
|
*/
|
|
51
96
|
benchmarksURL?: string;
|
|
52
97
|
/**
|
|
@@ -100,7 +145,7 @@ getGPUTier({
|
|
|
100
145
|
|
|
101
146
|
## Requirements
|
|
102
147
|
|
|
103
|
-
- Node.js
|
|
148
|
+
- Node.js 24+
|
|
104
149
|
- ESM only (CommonJS is not supported)
|
|
105
150
|
|
|
106
151
|
## Support
|
|
@@ -1 +1,252 @@
|
|
|
1
|
-
[
|
|
1
|
+
[
|
|
2
|
+
"6",
|
|
3
|
+
[
|
|
4
|
+
"qualcomm adreno 540",
|
|
5
|
+
"540",
|
|
6
|
+
"540 adreno qualcomm",
|
|
7
|
+
0,
|
|
8
|
+
[
|
|
9
|
+
[
|
|
10
|
+
1919,
|
|
11
|
+
1279,
|
|
12
|
+
18
|
|
13
|
+
]
|
|
14
|
+
]
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"qualcomm adreno 540 gpu",
|
|
18
|
+
"540",
|
|
19
|
+
"540 adreno gpu qualcomm",
|
|
20
|
+
0,
|
|
21
|
+
[
|
|
22
|
+
[
|
|
23
|
+
1919,
|
|
24
|
+
1279,
|
|
25
|
+
24
|
|
26
|
+
]
|
|
27
|
+
]
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"qualcomm adreno 618 gpu",
|
|
31
|
+
"618",
|
|
32
|
+
"618 adreno gpu qualcomm",
|
|
33
|
+
0,
|
|
34
|
+
[
|
|
35
|
+
[
|
|
36
|
+
1920,
|
|
37
|
+
1080,
|
|
38
|
+
19
|
|
39
|
+
]
|
|
40
|
+
]
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"qualcomm adreno 630 gpu",
|
|
44
|
+
"630",
|
|
45
|
+
"630 adreno gpu qualcomm",
|
|
46
|
+
0,
|
|
47
|
+
[
|
|
48
|
+
[
|
|
49
|
+
1920,
|
|
50
|
+
1080,
|
|
51
|
+
20
|
|
52
|
+
]
|
|
53
|
+
]
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"qualcomm adreno 675 gpu",
|
|
57
|
+
"675",
|
|
58
|
+
"675 adreno gpu qualcomm",
|
|
59
|
+
0,
|
|
60
|
+
[
|
|
61
|
+
[
|
|
62
|
+
1920,
|
|
63
|
+
1080,
|
|
64
|
+
58
|
|
65
|
+
]
|
|
66
|
+
]
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
"qualcomm adreno 680 gpu",
|
|
70
|
+
"680",
|
|
71
|
+
"680 adreno gpu qualcomm",
|
|
72
|
+
0,
|
|
73
|
+
[
|
|
74
|
+
[
|
|
75
|
+
2880,
|
|
76
|
+
1920,
|
|
77
|
+
24
|
|
78
|
+
]
|
|
79
|
+
]
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"qualcomm adreno 685 gpu",
|
|
83
|
+
"685",
|
|
84
|
+
"685 adreno gpu qualcomm",
|
|
85
|
+
0,
|
|
86
|
+
[
|
|
87
|
+
[
|
|
88
|
+
1920,
|
|
89
|
+
1080,
|
|
90
|
+
23
|
|
91
|
+
],
|
|
92
|
+
[
|
|
93
|
+
2560,
|
|
94
|
+
1600,
|
|
95
|
+
57
|
|
96
|
+
]
|
|
97
|
+
]
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"qualcomm adreno 690 gpu",
|
|
101
|
+
"690",
|
|
102
|
+
"690 adreno gpu qualcomm",
|
|
103
|
+
0,
|
|
104
|
+
[
|
|
105
|
+
[
|
|
106
|
+
1920,
|
|
107
|
+
1080,
|
|
108
|
+
59
|
|
109
|
+
],
|
|
110
|
+
[
|
|
111
|
+
1920,
|
|
112
|
+
1280,
|
|
113
|
+
28
|
|
114
|
+
]
|
|
115
|
+
]
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
"qualcomm adreno 7c gen 3 gpu",
|
|
119
|
+
"7",
|
|
120
|
+
"3 7c adreno gen gpu qualcomm",
|
|
121
|
+
0,
|
|
122
|
+
[
|
|
123
|
+
[
|
|
124
|
+
1920,
|
|
125
|
+
1080,
|
|
126
|
+
48
|
|
127
|
+
]
|
|
128
|
+
]
|
|
129
|
+
],
|
|
130
|
+
[
|
|
131
|
+
"qualcomm adreno 7c+ gen 3",
|
|
132
|
+
"7",
|
|
133
|
+
"3 7c+ adreno gen qualcomm",
|
|
134
|
+
0,
|
|
135
|
+
[
|
|
136
|
+
[
|
|
137
|
+
1920,
|
|
138
|
+
1080,
|
|
139
|
+
40
|
|
140
|
+
]
|
|
141
|
+
]
|
|
142
|
+
],
|
|
143
|
+
[
|
|
144
|
+
"qualcomm adreno 8cx gen 3",
|
|
145
|
+
"8",
|
|
146
|
+
"3 8cx adreno gen qualcomm",
|
|
147
|
+
0,
|
|
148
|
+
[
|
|
149
|
+
[
|
|
150
|
+
1920,
|
|
151
|
+
1080,
|
|
152
|
+
21
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
1920,
|
|
156
|
+
1200,
|
|
157
|
+
59
|
|
158
|
+
]
|
|
159
|
+
]
|
|
160
|
+
],
|
|
161
|
+
[
|
|
162
|
+
"qualcomm adreno 8cx gen 4",
|
|
163
|
+
"8",
|
|
164
|
+
"4 8cx adreno gen qualcomm",
|
|
165
|
+
0,
|
|
166
|
+
[
|
|
167
|
+
[
|
|
168
|
+
2880,
|
|
169
|
+
1800,
|
|
170
|
+
60
|
|
171
|
+
]
|
|
172
|
+
]
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
"qualcomm adreno x1-45 gpu",
|
|
176
|
+
"1",
|
|
177
|
+
"adreno gpu qualcomm x1-45",
|
|
178
|
+
0,
|
|
179
|
+
[
|
|
180
|
+
[
|
|
181
|
+
2880,
|
|
182
|
+
1800,
|
|
183
|
+
80
|
|
184
|
+
]
|
|
185
|
+
]
|
|
186
|
+
],
|
|
187
|
+
[
|
|
188
|
+
"qualcomm adreno x1-85 gpu",
|
|
189
|
+
"1",
|
|
190
|
+
"adreno gpu qualcomm x1-85",
|
|
191
|
+
0,
|
|
192
|
+
[
|
|
193
|
+
[
|
|
194
|
+
1920,
|
|
195
|
+
1080,
|
|
196
|
+
60
|
|
197
|
+
]
|
|
198
|
+
]
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
"qualcomm mi pad 5 adreno 640 gpu",
|
|
202
|
+
"5",
|
|
203
|
+
"5 640 adreno gpu mi pad qualcomm",
|
|
204
|
+
0,
|
|
205
|
+
[
|
|
206
|
+
[
|
|
207
|
+
2560,
|
|
208
|
+
1600,
|
|
209
|
+
34
|
|
210
|
+
]
|
|
211
|
+
]
|
|
212
|
+
],
|
|
213
|
+
[
|
|
214
|
+
"qualcomm snapdragon x elite - x1e78100 - qualcomm adreno gpu",
|
|
215
|
+
"1",
|
|
216
|
+
"- adreno elite gpu qualcomm snapdragon x x1e78100",
|
|
217
|
+
0,
|
|
218
|
+
[
|
|
219
|
+
[
|
|
220
|
+
2880,
|
|
221
|
+
1620,
|
|
222
|
+
115
|
|
223
|
+
]
|
|
224
|
+
]
|
|
225
|
+
],
|
|
226
|
+
[
|
|
227
|
+
"qualcomm snapdragon x elite - x1e80100 - qualcomm adreno gpu",
|
|
228
|
+
"1",
|
|
229
|
+
"- adreno elite gpu qualcomm snapdragon x x1e80100",
|
|
230
|
+
0,
|
|
231
|
+
[
|
|
232
|
+
[
|
|
233
|
+
2496,
|
|
234
|
+
1664,
|
|
235
|
+
60
|
|
236
|
+
]
|
|
237
|
+
]
|
|
238
|
+
],
|
|
239
|
+
[
|
|
240
|
+
"qualcomm snapdragon x elite - x1e84100 - qualcomm adreno gpu",
|
|
241
|
+
"1",
|
|
242
|
+
"- adreno elite gpu qualcomm snapdragon x x1e84100",
|
|
243
|
+
0,
|
|
244
|
+
[
|
|
245
|
+
[
|
|
246
|
+
2880,
|
|
247
|
+
1800,
|
|
248
|
+
60
|
|
249
|
+
]
|
|
250
|
+
]
|
|
251
|
+
]
|
|
252
|
+
]
|