News for hackers. Stuff that matters.
Re:An Update on Apple M1/M2 GPU Drivers by gigatexal on Thursday October 31, 2024 @06:04PM (#42012036)
Is anyone else astonished at how much is missing in the hardware and how much is emulated?
Re:An Update on Apple M1/M2 GPU Drivers by dtquad on Thursday October 31, 2024 @06:25PM (#42012190)
The graphics pipeline in modern GPUs are mostly a thin low-level Vulkan/Metal-like layer on top of a massively parallel CUDA-like compute architecture.

It's basically all emulated. One of the reasons GPU manufacturers are unwilling to open source their drivers is because a lot of their secret sauce actually happens in software in the drivers on top of the massively parallel CUDA-like compute architecture.

Re:An Update on Apple M1/M2 GPU Drivers by almostgotcaught on Thursday October 31, 2024 @08:55PM (#42013058)
I didn't read the article and don't know about Apple but that's definitely not true for everyone. Source: see amdgpu built on top of HSA.

EDIT: to be precise yes ofc every chip is a massively parallel array of compute units but CUDA has absolutely nothing to do with it and no not every company buries the functionality in the driver.

Re:An Update on Apple M1/M2 GPU Drivers by hilti on Friday November 01, 2024 @01:31AM (#42014320)
You better should read before commenting - that's respect and courtesy, not a request
Re:An Update on Apple M1/M2 GPU Drivers by david-gpu on Friday November 01, 2024 @05:07AM (#42015199)
As a former insider, this is NOT remotely how I would describe reality.

I have signed NDAs and don't feel comfortable going into any detail, other than saying that there is a TON going on inside GPUs that is not "basically all emulated".

Re:An Update on Apple M1/M2 GPU Drivers by user_7832 on Friday November 01, 2024 @07:56AM (#42016059)
Maybe a tall ask, but have you considered writing down all your experiences into a book, and release it after all NDAs expire? I’d love to read more about low level hardware and the behind the scenes stuff involved. I’m sure you’ve got a lot of good stories.
Re:An Update on Apple M1/M2 GPU Drivers by almostgotcaught on Friday November 01, 2024 @09:18AM (#42016663)
> I’d love to read more about low level hardware and the behind the scenes stuff involved. I’m sure you’ve got a lot of good stories.

I don't know why you think there's anything resembling "good stories" (I don't even know what would constitute a good story - swash buckling adventures?). It's just grimy-ass runtime/driver/firmware code interfacing with hardware features/flaws.

Re:An Update on Apple M1/M2 GPU Drivers by david-gpu on Friday November 01, 2024 @10:01PM (#42023503)
Exactly right.

95% difficult, stressful and surprisingly tedious work

4% panic, despair, insecurities

1% friendly banter with very smart people

If I had to do it all over again, I wouldn't, even though it allowed me to retire early.

Re:An Update on Apple M1/M2 GPU Drivers by almostgotcaught on Saturday November 02, 2024 @03:10AM (#42024588)
My experience to a T, down to the 1% friendly banter (because while there are lots of smart people working on hardware, almost none of them know how to banter lol).
Re:An Update on Apple M1/M2 GPU Drivers by snewman on Friday November 01, 2024 @10:12AM (#42017067)
NDAs don't generally have an expiration date. (As opposed to non-competes and non-solicitation agreements, which generally do.) An NDA typically ends only if the information in question becomes public, and then only for that particular information.
Re:An Update on Apple M1/M2 GPU Drivers by david-gpu on Friday November 01, 2024 @09:56PM (#42023471)
Nope in all accounts, I'm afraid.

But, in summary, it was grinding, grinding, and more grinding, with large dollops of impostor syndrome on top of it.

Met lots of nice smart people, but none were as impressive as the folks at NVidia. I was not worthy of being there.

Re:An Update on Apple M1/M2 GPU Drivers by exDM69 on Friday November 01, 2024 @08:37AM (#42016355)
This statement isn't true at all. There are tons of fixed function hardware units for graphics in GPUs in addition to compute cores: triangle rasterizers, texture units, raytracing units, blitters, copy engines, video codecs, etc. They interact with the shader/compute cores and it's getting more common that the shader core is driving the rasterizer etc than vice versa (mesh shaders and ray tracing for example).

Calling it "all emulated" is very very far from the truth.

You can independently verify this by digging into open source graphics drivers.

Re:An Update on Apple M1/M2 GPU Drivers by samtheprogram on Friday November 01, 2024 @01:21PM (#42019303)
How is verifying against a worse performing, open source GPU driver any sort of verification that proprietary drivers do not do special things you wouldn’t expect?
Re:An Update on Apple M1/M2 GPU Drivers by anonymous_user9 on Saturday November 02, 2024 @01:11PM (#42027666)
Because it would reveal the lack of emulation in the open-source driver, demonstrating that there are specialized hardware blocks performing those functions.
Re:An Update on Apple M1/M2 GPU Drivers by samus on Friday November 01, 2024 @10:35AM (#42017308)
A lot of it is software, but not necessarily in the driver. Nouveau folks pretty much gave up and use NVidia's firmware blob going forward. While that's mostly due to NVidia not cooperating in making crucial capabilities of the GPU available to non-signed firmware blobs, the upside is that it will hopefully significantly reduce the effort connected with wiring up new hardware components on the GPU.
Re:An Update on Apple M1/M2 GPU Drivers by gigatexal on Friday November 01, 2024 @03:14PM (#42020506)
You know it’s not like Apple has a lot to lose in terms of market share if they opened even the specs of their hardware up to make folks like the Asahi team’s lives’ easier. What does Apple have in terms of the desktop market? 5%?

If anything working, fully baked desktop Linux working on ARM Mac hardware would drive sales and Apple would still get the profits. Besides their services are still mostly available too. Tux loving folks can subscribe to AppleTV, and music etc.

Re:An Update on Apple M1/M2 GPU Drivers by jsheard on Thursday October 31, 2024 @06:06PM (#42012056)
The things being emulated are mostly legacy features that are barely used in modern software, if at all, so the overhead of emulating them for backward compatibility isn't the end of the world. I can't blame Apple for not supporting geometry shaders in hardware, when they're widely considered to be a mistake that never should have been standardized in the first place, and Metal never supported them at all so they could only ever come up in old OpenGL code on macOS.

https://x.com/pointinpolygon/status/1270695113967181827

Re:An Update on Apple M1/M2 GPU Drivers by parl_match on Thursday October 31, 2024 @06:10PM (#42012083)
I wouldn't go so far as to say "mistake that should never have been standardized". Their intended use was always pretty limited, though. There's zero reason for anything built in recent memory to use them.
Re:An Update on Apple M1/M2 GPU Drivers by jsheard on Thursday October 31, 2024 @06:16PM (#42012133)
They had limited uses and turned out to be incredibly hard to implement efficiently in hardware, so in practice it was nearly always faster to just keep using the proven techniques that GS was supposed to replace.

http://www.joshbarczak.com/blog/?p=667

Re:An Update on Apple M1/M2 GPU Drivers by RantyDave on Thursday October 31, 2024 @07:28PM (#42012590)
So why does instancing suck? I would have thought it would be heavily optimised in the driver...
Re:An Update on Apple M1/M2 GPU Drivers by p_l on Friday November 01, 2024 @05:50AM (#42015389)
It seems Device Generated Commands might be better case for instancing these days?
Re:An Update on Apple M1/M2 GPU Drivers by comex on Thursday October 31, 2024 @08:40PM (#42012980)
And yet one of the fancy new features being advertised in recent years (in multiple APIs including Metal) is support for mesh shaders – which seem to have a lot in common with geometry shaders, including the output ordering property that that post blames for geometry shaders’ bad performance. I’m not a graphics programmer myself, but this makes me suspect there’s more to the story.
Re:An Update on Apple M1/M2 GPU Drivers by dgfitz on Friday November 01, 2024 @12:09AM (#42013985)
If you’re not a graphics programmer, how did you learn of this? I’d love to read about it.
Re:An Update on Apple M1/M2 GPU Drivers by HeuristicsCG on Friday November 01, 2024 @01:18AM (#42014259)
if your hardware supports mesh shaders properly, it won't be very hard for it to also support these other features emulated in software (geometry shaders, tessellation, lines etc).

But mesh shaders are fairly new, will take a few years for the hardware and software to adapt.

Re:An Update on Apple M1/M2 GPU Drivers by adrian_b on Friday November 01, 2024 @09:30AM (#42016757)
They are fairly new at the other GPU makers, but the NVIDIA GPUs have them starting with Turing, 6 years ago.

AMD GPUs have them starting with RDNA 2.

Re:An Update on Apple M1/M2 GPU Drivers by winterismute on Friday November 01, 2024 @08:32AM (#42016311)
I am not an expert on geometry processing pipelines, however Mesh Shaders are specced differently from GS, essentially one of the big problems with GS is that it's basically impossible for the HW, even after all the render state is set and a shader is bound and compiled (and "searched"), to understand how much memory and compute the execution will take, which breaks a lot of the assumptions that allow SIMD machines to work well. In fact, the main advertised feature of GS was to create geometry out of nothing (unbounded particle effects), while the main advertised feature of Mesh Shaders is GPU-driven and efficient culling of geometry (see for example the recent mesh shader pipeline talk from Remedy on Alan Wake 2). It is true that Mesh Shaders are designed also for amplification, and that word has been chosen specifically to hint that you will be able to "multiply" your primitives but not generating random sequences out of thin air.

It is also true however that advances in APIs and HW desgins allowed for some parts that were troublesome at the time of GS not to be so troublesome anymore.

Re:An Update on Apple M1/M2 GPU Drivers by raverbashing on Thursday October 31, 2024 @11:04PM (#42013686)
Tessellation does not seem to fit this description though
Re:An Update on Apple M1/M2 GPU Drivers by tedunangst on Thursday October 31, 2024 @06:25PM (#42012201)
Is this really so different from any other mobile derived GPU?
Re:An Update on Apple M1/M2 GPU Drivers by ferbivore on Thursday October 31, 2024 @06:56PM (#42012381)
Yes. Apple have their own graphics API. They were able to decide that, say, geometry shaders aren't worth the chip area or engineering effort to support. Other IHVs don't get that choice; for geometry shaders, for instance, they're part of both Vulkan and OpenGLES, there are games and benchmarks that use them, and customers (end-users, gamedevs, review/benchmark sites, SoC vendors) will evaluate GPUs based, in some small part, on how good their geometry shader support is. Same story for tessellation, transform feedback, and whatever else Apple dropped.
Re:An Update on Apple M1/M2 GPU Drivers by dagmx on Thursday October 31, 2024 @07:28PM (#42012589)
Other hardware vendors absolutely do the same. Geometry shaders are poor performers on several other vendors for precisely the same reason
Re:An Update on Apple M1/M2 GPU Drivers by ferbivore on Thursday October 31, 2024 @07:48PM (#42012702)
At least some Qualcomm, Imagination and Broadcom GPUs support geometry shaders in hardware. Not entirely sure about Arm. To be fair, it could be the support isn't very good.
Re:An Update on Apple M1/M2 GPU Drivers by dagmx on Thursday October 31, 2024 @09:57PM (#42013365)
Some do, but a lot will have their firmware actually do the translation into other compute types that align better with the hardware.
Re:An Update on Apple M1/M2 GPU Drivers by fingerlocks on Thursday October 31, 2024 @07:12PM (#42012486)
I don’t think it’s accurate to say Apple “dropped” these features. Tessellation is done with general purpose compute shaders. You can do the same with “geometry shaders” if the need arises as well
Re:An Update on Apple M1/M2 GPU Drivers by rstat1 on Thursday October 31, 2024 @11:11PM (#42013717)
>>(end-users, gamedevs, review/benchmark sites, SoC vendors) will evaluate GPUs based, in some small part, on how good their geometry shader support is

Do they? I can't remember ever seeing any mention of Geometry Shader performance in a GPU review I've read/watched. The thing I've ever heard about it was about how bad they were.

Re:An Update on Apple M1/M2 GPU Drivers by lewispollard on Friday November 01, 2024 @05:00AM (#42015168)
Yeah, geometry shaders aren't even widely used, they weren't great in the first place and devs have moved on.
Re:An Update on Apple M1/M2 GPU Drivers by refulgentis on Thursday October 31, 2024 @06:34PM (#42012254)
Idk, TIL, had a career in mobile for 15 years running and I didn't know this was a distinctive quality of mobile GPUs. (makes sense! but all that to say, I'm very interested to hear more, and I'll trade you an answer to that question: "maybe not! sounds like you got some smart stuff to share :)")