gpuweb / gpuweb

Where the GPU for the Web work happens!
https://webgpu.io
Other
4.82k stars 318 forks source link

Consider raising `maxStorageBuffersPerShaderStage` #4235

Open jimblandy opened 1 year ago

jimblandy commented 1 year ago

We should check whether it's feasible to raise maxStorageBuffersPerShaderStage, since this is something people are running into in the wild:

limits

kainino0x commented 1 year ago

We could trivially raise it to 16 on Vulkan:

Requirement "maxPerStageDescriptorStorageBuffers >= 16" loses no further reports!
full report for values above 16 ``` Requirement "maxPerStageDescriptorStorageBuffers >= 16" loses no further reports! Requirement "maxPerStageDescriptorStorageBuffers >= 24" loses 3 (and partially loses 64) further deviceNames: In ALL reports (3 deviceNames): x GeForce GT 640M: 3 (1624 1685 1747) x Quadro M6000: 2 (1962 1963) x Virtio-GPU Venus (llvmpipe): 2 (14801 14867) In SOME reports (64 deviceNames): ~ GeForce 840M: 6 of 74 (1507 1510 1567 1652 1660 1814) ~ GeForce 920M: 2 of 12 (1908 6193) ~ GeForce 920MX: 1 of 6 (3972) ~ GeForce 940MX: 5 of 60 (1590 1643 1872 1981 3344) ~ GeForce GT 1030: 1 of 79 (5834) ~ GeForce GT 640: 3 of 18 (1473 1720 2692) ~ GeForce GT 640M LE: 1 of 4 (1434) ~ GeForce GT 650M: 2 of 15 (1593 1854) ~ GeForce GT 710: 2 of 25 (1730 3631) ~ GeForce GT 720: 1 of 6 (1769) ~ GeForce GT 730: 3 of 22 (1669 1692 2583) ~ GeForce GT 730M: 2 of 7 (1807 1808) ~ GeForce GT 740: 2 of 10 (1492 1924) ~ GeForce GT 740M: 2 of 27 (1633 1641) ~ GeForce GT 750M: 4 of 17 (1435 1594 1796 10358) ~ GeForce GT 755M: 1 of 3 (2118) ~ GeForce GTX 1050: 10 of 125 (1560 1688 1712 1715 1809 1877 1895 2003 2990 4264) ~ GeForce GTX 1050 Ti: 14 of 145 (1465 1508 1589 1697 1707 1717 1739 1741 1780 1873 1907 2250 2422 2917) ~ GeForce GTX 1060: 2 of 187 (3909 4013) ~ GeForce GTX 1060 3GB: 4 of 59 (1623 1626 1950 12501) ~ GeForce GTX 1060 6GB: 12 of 138 (1494 1532 1547 1585 1611 1681 1686 1694 1802 1836 1886 2183) ~ GeForce GTX 1070: 19 of 199 (1506 1566 1569 1600 1631 1640 1667 1714 1718 1761 1766 1861 1939 1957 2173 2751 2831 2970 5808) ~ GeForce GTX 1080: 16 of 188 (1437 1486 1524 1572 1632 1713 1748 1749 1758 1792 1801 1857 1903 1931 2041 2888) ~ GeForce GTX 1080 Ti: 7 of 152 (1485 1534 1574 1757 1831 2019 2396) ~ GeForce GTX 650: 3 of 29 (1436 1448 1453) ~ GeForce GTX 650 Ti: 2 of 22 (1521 1702) ~ GeForce GTX 650 Ti BOOST: 6 of 42 (1484 1657 1806 1881 1892 2487) ~ GeForce GTX 660: 4 of 36 (1639 1751 2645 4777) ~ GeForce GTX 660 Ti: 1 of 8 (1719) ~ GeForce GTX 660M: 3 of 10 (1598 1738 7954) ~ GeForce GTX 680: 1 of 23 (1765) ~ GeForce GTX 750: 3 of 21 (1539 1904 2384) ~ GeForce GTX 750 Ti: 2 of 72 (1542 1687) ~ GeForce GTX 760: 8 of 44 (1468 1509 1668 1706 1743 1770 2040 2369) ~ GeForce GTX 760 (192-bit): 1 of 3 (4152) ~ GeForce GTX 765M: 3 of 8 (1655 1759 2605) ~ GeForce GTX 770: 5 of 80 (1727 1729 1742 1794 2334) ~ GeForce GTX 770M: 1 of 4 (1581) ~ GeForce GTX 780: 1 of 11 (1475) ~ GeForce GTX 780M: 1 of 4 (1469) ~ GeForce GTX 850M: 5 of 22 (1563 1764 2023 2060 2425) ~ GeForce GTX 860M: 3 of 26 (1460 1514 1647) ~ GeForce GTX 950: 2 of 25 (1456 1648) ~ GeForce GTX 950M: 7 of 28 (1573 1898 1926 1989 2092 2938 3496) ~ GeForce GTX 960: 8 of 85 (1462 1496 1516 1553 1634 1679 1695 1837) ~ GeForce GTX 960M: 11 of 82 (1440 1451 1499 1546 1605 1620 1783 1843 1864 1876 2609) ~ GeForce GTX 965M: 2 of 4 (1708 2083) ~ GeForce GTX 970: 15 of 157 (1442 1525 1526 1529 1530 1577 1578 1675 1689 1762 1788 1858 1909 2097 2116) ~ GeForce GTX 970M: 1 of 25 (1760) ~ GeForce GTX 980: 9 of 50 (1432 1480 1493 1630 1678 1795 1797 1827 1890) ~ GeForce GTX 980 Ti: 3 of 37 (1588 1608 2042) ~ GeForce GTX 980M: 5 of 30 (1614 1635 1775 1883 3339) ~ GeForce GTX TITAN: 4 of 10 (1570 1571 1799 1800) ~ GeForce MX150: 1 of 39 (3599) ~ NVIDIA Tegra X1: 6 of 8 (1550 2115 5451 9235 10177 16802) ~ Quadro K1100M: 1 of 5 (1659) ~ Quadro K2000: 1 of 4 (4696) ~ Quadro K2000M: 2 of 4 (1599 3628) ~ Quadro K600: 1 of 3 (1616) ~ Quadro P1000: 1 of 10 (3399) ~ Quadro P5000: 1 of 4 (1481) ~ Quadro P6000: 1 of 2 (7106) ~ SwiftShader Device: 2 of 8 (14246 19306) ~ llvmpipe: 182 of 274 (13810 13838 13864 14050 14115 14236 14338 14348 14516 14538 14542 14556 14567 14570 14571 14633 14657 14683 14695 14707 14721 14727 14734 14737 14750 14785 14797 14810 14821 14843 14847 14870 14886 14889 14902 14909 14919 14951 14971 14975 15011 15014 15027 15046 15058 15071 15088 15092 15098 15121 15136 15195 15215 15227 15239 15249 15276 15279 15285 15309 15431 15488 15489 15568 15639 15695 15799 15809 15811 15847 15922 15974 15990 16022 16041 16044 16064 16068 16069 16103 16116 16119 16139 16149 16173 16180 16216 16240 16244 16250 16272 16299 16337 16340 16349 16370 16374 16384 16395 16420 16423 16467 16472 16481 16486 16495 16502 16519 16525 16534 16554 16561 16572 16598 16627 16643 16673 16678 16699 16702 16725 16780 16798 16816 16838 16852 16866 16878 16892 16909 16939 16964 17020 17041 17054 17059 17069 17103 17124 17162 17197 17215 17257 17269 17301 17353 17378 17394 17424 17445 17483 17503 17509 17541 17569 17601 17617 17672 17708 17727 17745 17763 17807 17822 17849 17871 17926 17961 17993 17996 18047 18089 18093 18117 18130 18151 18179 18535 18827 19100 19264 19684) Requirement "maxPerStageDescriptorStorageBuffers >= 31" loses 10 (and partially loses 0) further deviceNames: In ALL reports (10 deviceNames): x Adreno (TM) 504: 8 (8629 9137 10642 11160 11664 12378 15689 19477) x Adreno (TM) 505: 30 (4259 4457 4489 4824 6129 7394 7550 8516 8922 9025 9063 9355 9501 9798 10174 10776 11057 11789 12203 12269 12277 12342 13211 14230 14771 14913 16201 16983 18395 19093) x Adreno (TM) 506: 56 (3851 4541 4680 4724 4916 4956 5006 5250 5990 6044 6058 6151 6814 7023 7137 7612 8841 9054 9060 9935 10294 10314 10414 10431 10513 10542 10810 10941 10997 11017 11346 11423 11493 11526 11656 12201 12360 12454 12578 12618 12636 12785 12953 13423 13426 13508 13618 14282 15407 15552 15746 16302 16685 16691 17097 19471) x Adreno (TM) 508: 9 (4452 6680 8652 10383 10442 10589 12379 13414 14872) x Adreno (TM) 509: 17 (4924 6120 8358 9062 9064 11486 11487 11488 11673 11820 12108 12678 13230 14911 15616 15895 19621) x Adreno (TM) 510: 1 (6786) x Adreno (TM) 512: 50 (3724 4394 4400 4683 4768 5679 6063 6787 7385 8566 8697 10195 10204 10546 10608 10638 10656 10700 10775 11177 11237 11326 11399 11452 11475 11605 11663 11933 12813 13364 13421 13578 13616 13837 14233 14625 14716 14916 15742 16129 16187 16454 16516 16791 16933 16960 17204 17927 18544 19584) x Adreno (TM) 530: 56 (3183 3597 3603 3765 3907 4359 4363 4773 4999 5019 5103 5210 5314 5399 5402 6072 6100 6215 6285 6560 6841 6885 7313 7542 7601 8268 8483 8544 9061 9332 10486 10681 10827 10838 10958 11034 11724 11874 12263 13278 13802 13934 13964 14311 14312 14364 14491 15081 15956 16195 16871 16931 16986 18298 18965 19714) x Adreno (TM) 540: 82 (3422 3450 3532 3571 4071 4145 4433 4503 5102 5150 5215 5259 5383 5632 5811 5866 6046 6068 6083 6163 6208 6405 6796 7584 8603 8977 9008 9251 9354 9705 10284 10347 10597 10728 10752 10784 10786 10819 10844 10908 11101 11225 11338 11350 11485 11498 11665 11669 12292 12489 13097 13246 13294 13482 13577 13751 14142 14175 14369 14844 15188 15241 15257 15357 15391 15397 15526 15536 15628 15705 16055 16117 16223 16279 16285 16468 16977 17051 17304 17983 18096 18285) x SwiftShader Device: 6 (16262 16766 18449 18451 18694 18695) In SOME reports (0 deviceNames): Requirement "maxPerStageDescriptorStorageBuffers >= 32" loses 42 (and partially loses 10) further deviceNames: In ALL reports (42 deviceNames): x AMD Radeon HD - FirePro D300: 2 (7598 10450) x AMD Radeon Pro 455: 1 (19237) x AMD Radeon Pro 5500 XT: 1 (19703) x AMD Radeon Pro 5500M: 6 (12173 17321 18370 18402 18876 19496) x AMD Radeon Pro 555: 2 (19182 19721) x AMD Radeon Pro 555X: 5 (12248 12834 13632 18849 18851) x AMD Radeon Pro 560: 3 (16847 17783 18667) x AMD Radeon Pro 560X: 4 (16782 16995 17003 18525) x AMD Radeon Pro 570: 1 (18186) x AMD Radeon Pro Vega 20: 2 (16905 17497) x AMD Radeon Pro Vega 48: 1 (18502) x AMD Radeon Pro Vega 56: 1 (16451) x AMD Radeon Pro W5700X: 1 (18292) x AMD Radeon RX 570: 1 (17293) x AMD Radeon RX 580: 2 (11047 18921) x AMD Radeon RX Vega 64: 18 (5659 6898 9626 9630 9646 10079 10245 11293 11294 12289 13161 14191 14837 15034 15539 15540 16135 18263) x Apple M1: 45 (11048 11395 11396 11632 11689 11884 12086 13000 13410 13597 14080 14169 14584 14630 14927 15137 15250 15281 15337 15338 15517 15518 15671 15750 15791 15937 16158 16446 16632 16832 16913 17007 17148 17150 18000 18072 18656 18733 18784 18934 19110 19135 19198 19503 19606) ```

Things are more complicated on Metal and D3D12. This is documented on maxStorageBuffersPerShaderStage on https://gpuweb.github.io/gpuweb/correspondence/ (I think this is correct though some of the newer limit changes are missing; that doc needs maintenance). Raising the guaranteed value for these means a bit less flexibility on how we allocate.

But it does seem like we might have some wiggle room to do this, if not now then later.

brendan-duncan commented 1 year ago

We are hitting this limit quite a lot with Unity compute shaders. Increasing the limit would enable a lot more projects that are currently failing.

cshenton-work commented 4 months ago

We are constantly hitting this limit, and it's making browser WebGPU implementations very hard to use for anything meaningful. A default of 8 makes sense only in the context of read_write buffers (UAVs) with a D3D11 implementation backend. However, this limit includes read only buffers (SRVs).

`GPU Info reports strongly imply that the default in the spec could be raised to 24 with no consequence.

I am hitting practical limits of 10 on the Chrome implementation which are causing me to have to implement weird workarounds when I know the underlying vulkan driver has no meaningful limit on the number of bindings.

maierfelix commented 3 months ago

Looking forward to a lift of this limitation too

kainino0x commented 2 months ago

Just to clarify: this discussion is about raising the default limit. As with other default limits, implementations can support better limits without a spec change. If there's a browser that doesn't support higher limits on a system where you think it should, please file a bug with that browser.

magcius commented 1 month ago

I filed https://issues.chromium.org/issues/366151398 about raising the limits in Dawn.