‹ BackHN Continuity

Thread

Nvidia announces native GPU programming in Rust

970 points · 404 comments · nonmaskable

  1. loup-vaillant · · focus · HN ↗
    Okay, so, GPUs are taking one more step towards being general purpose massively parallel machines. That's cool.

    What would be even cooler though would be for GPU vendors to start giving us the user manual. An I mean the real user manual, that explains how to use their piece of metal when all you have is that piece of metal. That means a precise description of the wire protocols, the data format of the buffers we send to & get from the GPU, the ISA of the cores we have access to, the relevant performance characteristics…

    In other words, enough information to write a state-of-the-art driver for any OS. That would be cool.

    1. surajrmal · · focus · HN ↗
      They don't need to do that to sell their hardware so why would they do that? On the other hand, they have strong incentives to not give you that level of access and information. The only way this will change is by having some disruption by way of a competitor who sells hardware with that feature as being a major reason why it takes off.
      1. loup-vaillant · · focus · HN ↗
        Or we could regulate. One hammer I'm tempted to use is to simply forbid sales and importation of hardware made by companies that also distribute software. That way the only way to sell you hardware is to make sure its interfaces are both simple and thoroughly documented.

        We could possibly make an exception for open source software, or only forbid the distribution of the relevant drivers, or limit the applicability of that law to specific hardware: hard drives, mice, printers, web cams... or GPUs.

        Anyway, that should be disruption enough.

    2. laughingcurve · · focus · HN ↗
      GPGPU <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;General-purpose_computing_on_graphics_processing_units" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;General-purpose_computing_on_g...
    3. floil · · focus · HN ↗
      They don&#x27;t release it because exposing a stable instruction set would kill their ability to quickly iterate, to release silicon with bugs that can be papered over with software fixes, as fixing bugs in chips is very expensive in terms of time to market, and undoubtedly to charge more for what looks like a hardware feature but actually is a software feature.

      It&#x27;s been this way for 25 years and I don&#x27;t see it changing.

      1. VikingCoder · · focus · HN ↗
        A stable instruction set would be nice.

        But hi, if I spent $10,000 on a piece of hardware, let me program the metal, thanks.

        1. corysama · · focus · HN ↗
          I&#x27;ve been programming GPUs since the PlayStation1. The way they work under the hood has changed fundamentally maybe 4 times in that span.

          I can&#x27;t compare it to changes I&#x27;ve seen in CPU architecture since then. Maybe like: Compare the NES with its 6502 and per-cartridge mappers vs. a IBM 386 PC. Now repeat that shift 2 or 3 more times.

          1. loup-vaillant · · focus · HN ↗
            &gt; The way they work under the hood has changed fundamentally maybe 4 times in that span.

            How many times since we got shaders? And when exactly? I bet each change takes longer to come than the last. I mean, GPUs are increasingly general purpose nowadays. Sure they&#x27;re optimised to specific kinds of embarrassingly parallel problems, but as more and more of their capabilities move out of the fixed pipeline to shaders, the need to change lessens.

            1. corysama · · focus · HN ↗
              When I started what you did was nothing but set up DMA streams to set registers. DMA sets registers, hardware reacts by rasterizing triangles.

              In the GeForce3 era, the registers got complicated enough they resembled tiny &quot;pixel shaders&quot;, but under the hood it was still a small struct held in registers. Vertex shaders were 1 to 128 asm instructions executed strictly linearly.

              In the G80 era we got &quot;general purpose shaders.&quot; But, they still depend heavily on the fix function pipeline for their dispatch&#x2F;scheduling and I&#x2F;O.

              These days, everything is basically a dressed-up compute shader. The shared-memory SRAM is front-and-center in your attention. Dispatch and scheduling are manual and complicated. GPUs are transitioning into tensor evaluators.

              So, maybe today we can start considering talking about planning committee meetings about stability. But, what I&#x27;ve observed is that this has been a request for a few decades now. And, in hindsight it would not have worked out in the past. Moving forward, maybe it would work out OK today for a while. But, I don&#x27;t see the rate of change in GPUs slowing down any time soon. Wouldn&#x27;t be surprised if we&#x27;re racing towards some Cerebras + Tensor Cores + FPGA near future.

      2. PhunkyPhil · · focus · HN ↗
        How is this different than CPUs? I suppose in the last 5 years the architecture and tape has changed a lot as they move to make more LLM capable?
      3. loup-vaillant · · focus · HN ↗
        &gt; exposing a stable instruction set would kill their ability to quickly iterate

        I believe the need to quickly iterate dropped significantly since we got shaders. I would bet in fact there was few such iterations in the last 10 years. Crazy increases in computing power of course, but big breaking changes in the actual ISA? I&#x27;d be surprised.

        &gt; to release silicon with bugs that can be papered over with software fixes

        Yeah that&#x27;s actually one of my goals. Only ship stuff that works on pain of embarrassment and prohibitive recall costs. It&#x27;s crazy hard. It&#x27;s how CPUs are shipped.

        &gt; and undoubtedly to charge more for what looks like a hardware feature but actually is a software feature.

        Again, that&#x27;s good. Such pricing tactics are scummy, I want to end them.

        ---

        Now of course, those reasons you cited are reasons for the vendor not to do what I&#x27;m pretty sure is very good for the consumer. I propose we force them. We could start small. Mice and keyboards first. Then printers. Then webcams, wifi modules... until we get to GPUs themselves.

    4. mathisfun123 · · focus · HN ↗
      &gt; GPUs are taking one more step towards being general purpose massively parallel machines

      this has nothing to do with becoming more general purpose (GPUs will never be general purpose - it&#x27;s literally physically impossible).

      1. loup-vaillant · · focus · HN ↗
        &gt; GPUs will never be general purpose

        Well in that sense, neither will CPUs. Just like GPUs, some workloads are better left to other kinds of hardware.

        1. mathisfun123 · · focus · HN ↗
          i really don&#x27;t think you know what you&#x27;re talking about. this isn&#x27;t about better or worse. there are many many many workloads a GPU cannot at all implement (hint: anything with branches).
          1. loup-vaillant · · focus · HN ↗
            Anything with branches cannot execute at all on a GPU? You sure about that?

            <a href="https:&#x2F;&#x2F;developer.nvidia.com&#x2F;gpugems&#x2F;gpugems2&#x2F;part-iv-general-purpose-computation-gpus-primer&#x2F;chapter-34-gpu-flow-control-idioms" rel="nofollow">https:&#x2F;&#x2F;developer.nvidia.com&#x2F;gpugems&#x2F;gpugems2&#x2F;part-iv-genera...

    5. apitman · · focus · HN ↗
      See also <a href="https:&#x2F;&#x2F;m.youtube.com&#x2F;watch?v=kZRE7HIO3vk" rel="nofollow">https:&#x2F;&#x2F;m.youtube.com&#x2F;watch?v=kZRE7HIO3vk

      And

      <a href="https:&#x2F;&#x2F;www.sebastianaaltonen.com&#x2F;blog&#x2F;no-graphics-api" rel="nofollow">https:&#x2F;&#x2F;www.sebastianaaltonen.com&#x2F;blog&#x2F;no-graphics-api

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.