Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mr_roboto

macrumors 6502a
Sep 30, 2020
856
1,867
It’s far from obvious whether current Intel-based Macs are in principle capable of supporting resizable BAR. And frankly, even if they were I don’t really see how one can blame Apple for not investing resources into implementatino these features for practically obsoleted machines, especially given the fact that resizeable BAR mostly benefits high-end games (and even then, marginally), which are simply not available on macOS.
It's obvious to me current Intel-based Macs can support resizable BAR. But it's also obvious to me that it just doesn't matter. To explain why these things are obvious and true takes a lot of words, unfortunately.

I'll start with two key questions, and their answers.

Q1: What's a BAR? A1: Stands for "Base Address Register". Each PCIe card (endpoint) has six of them. Each BAR supports mapping one contiguous block of card addresses (configuration/status registers, memory on the card, whatever) into one contiguous chunk of the PCI bus address space.

BARs are 32-bit, since PCIe tries real hard to look just like PCI to software, and PCI was originally a 32-bit bus. To move forward into the 64-bit era, at some point the PCI spec added a way to combine pairs of 32-bit BARs together to form 64-bit BARs. Obviously, you can only have up to three 64-bit BARs.

64-bit systems can use cards which only define 32-bit BARs, but can only map 32-bit BARs into the first 4 GiB of PCI address space. Since this becomes precious address real estate, nobody wants to have 32-bit BARs larger than about 256 MiB. That means GPUs which need to map several gigabytes of graphics memory through a 32-bit BAR use a simple but clumsy trick: expose a moving window of 128 or 256 MiB through one BAR, and provide the mechanism to move it in the form of configuration registers in a second smaller BAR. Instead of just dereferencing a pointer, you have to check if the upper bits of the pointer are different from the upper bits of the last access, and if they aren't the same, you have to poke the new upper bits into a hardware register.


Q2: Why do we need resizable BAR? A2: Well, that mechanism I just described is clumsy and slow. Sure would be nice if we could just dereference pointers. Unfortunately, as initially designed, 64-bit BARs don't have backwards compatibility. If you design a card which uses them, and one or more of three things (chipset, BIOS, and OS) lacks 64-bit support, your card won't work in that computer.

Because the PC industry is what it is, you don't have to go far to find PCs where one of those three things is 32-bit. (32-bit Windows 10 is a thing.) So it's been difficult for Nvidia and AMD to design consumer GPUs which move forward to 64-bit BARs.

Resizable BAR is a hack that got added to the PCIe spec at some point. Essentially, the card comes up out of reset with nothing but 32-bit BARs, but supports a method of ID'ing itself to the BIOS as supporting resizable BAR. If the BIOS also supports it, and is configured to take advantage, it can re-enumerate and remap the card with 64-bit BARs.


So now at last we get to my two assertions:


#1: It is obvious that Apple can do this. They have a 64-bit OS, they use modern 64-bit chipsets in modern Intel Macs, and their firmware is 64-bit too.

In fact, being Apple, if the GPU supplier offers a way to do it (firmware, strapping resistor, whatever), they could just have the GPU default to presenting 64-bit BARs. You don't need janky BAR resizing hacks if there's no legacy 32-bit hardware, firmware, or OS to support. I would not be shocked at all if recent Intel Mac dGPUs already work this way.


#2: It doesn't matter. The thing which resizable BAR buys you in PCs is that it makes it faster for the system's CPU to read and write arbitrary locations inside GPU memory. But is this important? Not usually! If you're writing a GPU driver, the primary fast path for copying data to and from GPUs is to program the GPU's DMA engines to do it for you. They're probably faster, and more importantly they don't burn tons of CPU cycles humping bytes around manually, which is why they exist in the first place.

These DMA engines don't care whether the GPU's BARs are 32- or 64-bit. They don't go through the GPU's BARs at all, so they're completely unaffected. This is why it's so hard to find benchmarks where resizable BAR moves the needle, especially pure graphics workloads like games.

(It's not impossible to find places where 64-bit BAR matters, of course. I myself work on such a system. It's an inferencing workload where we have to pump tons of data into a GPU using a PCIe DMA agent which isn't the GPU's DMA engine. It isn't something you'll ever do on your own PC or Mac.)
 

senttoschool

macrumors 68030
Nov 2, 2017
2,626
5,482
Well, CUDA? There was a perfectly fine GPGPU API around - OpenCL, developed by Apple, managed by Kronos and fully embraced by AMD. Instead of helping to nurture this vision of unified GPU compute API, Nvidia used their market leader position to sabotage its adoption, pushing their own CUDA instead and denying the HPC GPU market to their competitors. Of course, it was a move that made perfect sense from business perspective for them, but it did end up making things worse for everyone else - especially the users - because now tons of useful software is locked behind the parasitic CUDA.
But isn't CUDA far superior to whatever is the alternative? All I've heard is that CUDA just works and is better than anything else other companies have come up with. Isn't that just good competition? If someone else can come up with a better software and hardware implementation, why don't they?

Perhaps Nvidia didn't agree with the OpenCL vision? Maybe it hamstrung their innovation?

How could you be ok with everything Apple does, but hate on Nvidia for doing the exact same thing?

Nvidia has been very innovative in both software and hardware.
 
  • Like
Reactions: bobcomer

crazy dave

macrumors 65816
Sep 9, 2010
1,454
1,230
But isn't CUDA far superior to whatever is the alternative? All I've heard is that CUDA just works and is better than anything else other companies have come up with. Isn't that just good competition? If someone else can come up with a better software and hardware implementation, why don't they?

Perhaps Nvidia didn't agree with the OpenCL vision? Maybe it hamstrung their innovation?

How could you be ok with everything Apple does, but hate on Nvidia for doing the exact same thing?

Nvidia has been very innovative in both software and hardware.

 

leman

macrumors Core
Original poster
Oct 14, 2008
19,522
19,679
But isn't CUDA far superior to whatever is the alternative? All I've heard is that CUDA just works and is better than anything else other companies have come up with.

Probably the main reason why CUDA is superior is because Nvidia has been investing significant resources into improving it while actively sabotaging other initiatives they have been involved in. CUDA is not that different from OpenCL. It is just packaged differently — but the main feature of CUDA is that it is Nvidia-exclusive.

Isn't that just good competition? If someone else can come up with a better software and hardware implementation, why don't they?

Oh, I completely agree. Again, as I wrote before, I believe that the way to go for GPU programming is every vendor having their own proprietary interface and open "APIs" would be just libraries that leverage these interfaces. My gripe with Nvidia is not the fact that they roll their own thing but the active manipulation and suppression that they have been exercising using their position as a market leader.

Nvidia has been very innovative in both software and hardware.

I am not sure I agree. Nvidia has been very innovative in marketing and strategising. They also have been employing cut-throat techniques such as manipulation and ruthless suppression of competition. I don't find their hardware or software to be very remarkable to be honest. For example, most of the performance of the critically acclaimed 3000 series comes from the fact that Nvidia has significantly increased the power consumption of their GPUs.

I do admit of course that their business strategy is spot on. They invested into right things at the perfect time. For instance, their ML accelerators, RT units or tile-based rendering. None of these are particularly impressive technology, but they have been brought to the market exactly when it was needed.

How could you be ok with everything Apple does, but hate on Nvidia for doing the exact same thing?

Are they doing exactly the same thing though? Apple is rolling their own API because the mainstream stuff — dictated by majority market leaders who have different technology — did not work for them. Besides, Apple has its own separate software and hardware platform with different rules and programming model anyway. Nvidia on the other hand is relying on a wider mainstream software and hardware ecosystem. In regards to CUDA specifically, Nvidia used their leadership position to actively sabotage an open source effort they themselves were part of to lock out other hardware vendors. I don't recall Apple doing anything like that. To put it differently, Apple refusing to use Vulkan (whatever their motivation might be) does not threaten Vulkan as a viable GPU API. However, Nvidia refusing to properly support OpenCL did deny AMD access to GPGPU market and effectively made things worse for all the GPU users — because Nvidia has basically buried the vision of unified cross-platform GPU compute API.
 
  • Like
Reactions: tomO2013

Xiao_Xi

macrumors 68000
Oct 27, 2021
1,628
1,101
My gripe with Nvidia is not the fact that they roll their own thing but the active manipulation and suppression that they have been exercising using their position as a market leader.
CUDA is superior is because Nvidia has been investing significant resources into improving it while actively sabotaging other initiatives they have been involved in.
Can you explain how Nvidia hampered the development of OpenCL on non-Nvidia devices?

Nvidia has been very innovative in both software and hardware.
According to Wikipedia: https://en.wikipedia.org/wiki/Graphics_processing_unit
- Nvidia created the first consumer-level card released on the market with hardware-accelerated T&L
- Nvidia was first to produce a chip capable of programmable shading.
- Nvidia released CUDA before Khronos released OpenCL.
 

jeanlain

macrumors 68020
Mar 14, 2009
2,463
958
To put it differently, Apple refusing to use Vulkan (whatever their motivation might be) does not threaten Vulkan as a viable GPU API.
But that's only because Apple has a very small market share. What if MS or nVidia prevented the use of Vulkan like Apple does?

nVidia sabotaged openCL by simply not supporting it properly. Apple never supported Vulkan. And it is Apple itself that put the last nail in the openCL coffin when they adopted Metal.

As for Apple never "actively" sabotaging the competition (as it was suggested), it seems that's exactly what they're doing with Apple Arcade. They're giving money to developers so that their game isn't available on Android or other subscription platforms. How is that good for users?
 

crazy dave

macrumors 65816
Sep 9, 2010
1,454
1,230
Probably the main reason why CUDA is superior is because Nvidia has been investing significant resources into improving it while actively sabotaging other initiatives they have been involved in. CUDA is not that different from OpenCL. It is just packaged differently — but the main feature of CUDA is that it is Nvidia-exclusive.



Oh, I completely agree. Again, as I wrote before, I believe that the way to go for GPU programming is every vendor having their own proprietary interface and open "APIs" would be just libraries that leverage these interfaces. My gripe with Nvidia is not the fact that they roll their own thing but the active manipulation and suppression that they have been exercising using their position as a market leader.



I am not sure I agree. Nvidia has been very innovative in marketing and strategising. They also have been employing cut-throat techniques such as manipulation and ruthless suppression of competition. I don't find their hardware or software to be very remarkable to be honest. For example, most of the performance of the critically acclaimed 3000 series comes from the fact that Nvidia has significantly increased the power consumption of their GPUs.

I do admit of course that their business strategy is spot on. They invested into right things at the perfect time. For instance, their ML accelerators, RT units or tile-based rendering. None of these are particularly impressive technology, but they have been brought to the market exactly when it was needed.



Are they doing exactly the same thing though? Apple is rolling their own API because the mainstream stuff — dictated by majority market leaders who have different technology — did not work for them. Besides, Apple has its own separate software and hardware platform with different rules and programming model anyway. Nvidia on the other hand is relying on a wider mainstream software and hardware ecosystem. In regards to CUDA specifically, Nvidia used their leadership position to actively sabotage an open source effort they themselves were part of to lock out other hardware vendors. I don't recall Apple doing anything like that. To put it differently, Apple refusing to use Vulkan (whatever their motivation might be) does not threaten Vulkan as a viable GPU API. However, Nvidia refusing to properly support OpenCL did deny AMD access to GPGPU market and effectively made things worse for all the GPU users — because Nvidia has basically buried the vision of unified cross-platform GPU compute API.

Can you explain how Nvidia hampered the development of OpenCL on non-Nvidia devices?


According to Wikipedia: https://en.wikipedia.org/wiki/Graphics_processing_unit
- Nvidia created the first consumer-level card released on the market with hardware-accelerated T&L
- Nvidia was first to produce a chip capable of programmable shading.
- Nvidia released CUDA before Khronos released OpenCL.

But that's only because Apple has a very small market share. What if MS or nVidia prevented the use of Vulkan like Apple does?

nVidia sabotaged openCL by simply not supporting it properly. Apple never supported Vulkan. And it is Apple itself that put the last nail in the openCL coffin when they adopted Metal.

As for Apple never "actively" sabotaging the competition (as it was suggested), it seems that's exactly what they're doing with Apple Arcade. They're giving money to developers so that their game isn't available on Android or other subscription platforms. How is that good for users?


I’m going to go ahead and disagree with everyone! ? Nvidia has been innovative and they have engaged in anticompetitive actions that are worse than Apple’s in this space.

CUDA came about because scientists, mostly physicists, experimented with GPGPU programs using OpenGL. The results were encouraging even though the API made that clunky and inefficient. Nvidia recognized the opportunity and developed CUDA. One can argue for most companies, including Apple, the definition of innovation is indeed recognizing market opportunities at the right time and then executing the idea the right way. Similarly Nvidia was hardly the first to experiment with ray tracing or machine learning on the GPU but they were the first to bring a solution to market that could actually work. And they were the first to iterate on many other smaller GPU graphics and compute features that are now commonplace.

As an aside: Technically Apple released OpenCL and gave it to the Khronos group.

I won’t repeat @JMacHack ‘s list of things Nvidia has done but rather argue by metaphor to illustrate the difference between Apple and Nvidia. Apple by having its own ecosystem is off in the corner of the playground playing by itself. Nvidia is participating in the larger ecosystem of multiple kids playing together. Yes if Apple gets big enough, Apple hogging all the best toys and space for itself can become a problem … which is why government legislators and regulators are scrutinizing them closely in the iPhone space even though they effectively have the same model as game consoles that no one had a problem with. Meanwhile Nvidia effectively creates an ecosystem within the ecosystem and tries to ensure that the other kids that they’re playing with have fewer or worse toys.

Now I should stress that the situation is even more nuanced. For instance Nvidia does actively support a number of open technologies to accelerate computing on GPUs like openMP, openACC, and standard C++ - which going forwards will include an executor model for sending off work to the GPUs and other accelerators. Nvidia and its engineers are actively involved in each of those projects.
 

robco74

macrumors 6502a
Nov 22, 2020
509
944
Not all Apple Arcade games are exclusives. Lately, they've been reaching out to existing developers of top titles to make "+" versions that are the same games, but without the IAP/subscriptions. It's another avenue to compensate developers. Why is it acceptable for MS, Sony, or Nintendo to have exclusive titles, but not Apple?

Metal predates Vulkan. Apple doesn't actively try to sabotage projects like MoltenVK, and has even worked with developers to bring titles to the Mac using it.
 

crazy dave

macrumors 65816
Sep 9, 2010
1,454
1,230
Yes, but Mantle was AMD tech. Apple needed something that would work with Intel iGPUs in the Mac, in addition to iOS/iPadOS/tvOS devices.

Yeah though I’ll add that Apple took a horrifically long time to bring Metal (2) to the Mac which was left languishing with old OpenGL versions for waaay too long. Apple did a lot of self inflicted damage on that one.
 
  • Like
Reactions: robco74

mi7chy

macrumors G4
Oct 24, 2014
10,625
11,298

12900HK is not even close to M1 Max base on the real test. It consumed way more power so their marketing chart is totally fake. Intel Alder lake just consume too much of power so it's so stupid to even dare compare with M1 series.

Hold your horse. That's unrestricted but not impressive at 115W peak when 5950x peaks at ~124W but is about 52% faster on Cinebench R15. Power consumption increases exponentially with linear increase in frequency so I'd like to see performance at 45W before making up my mind. Intel 7 node is more like TSMC 10nm so with IPC improvement I'm guessing it'll be close to AMD at similar wattage.
 

crazy dave

macrumors 65816
Sep 9, 2010
1,454
1,230
Intel 7 node is more like TSMC 10nm so with IPC improvement I'm guessing it'll be close to AMD at similar wattage.

Intel 7 (née Intel 10nmESF) is close to TSMC 7nm+. Intel 10nm was close TSMC 7nm. Samsung 5nm is also close to TSMC 7nm.
 

Technerd108

macrumors 68040
Oct 24, 2021
3,062
4,313

Attachments

  • overclocked-my-pentium-4-by-1-mhz-burns-down-the-house.jpg
    overclocked-my-pentium-4-by-1-mhz-burns-down-the-house.jpg
    113.1 KB · Views: 54
  • Like
Reactions: JMacHack

mi7chy

macrumors G4
Oct 24, 2014
10,625
11,298

Adarna

Suspended
Jan 1, 2015
685
429
For most laptop use cases the end user wants more battery life. When you've hit the 100Whr airline limit then what else can you do but bring a 100Whr powerbank?

Kidding aside based on the graph and the published TDP the raw performance gains is not derived from performance per watt.

So for those wanting Intel Alder Lake on a Mac... why? Other than Virtualization and being able to Bootcamp?

I get there's a use case for users who move their laptop from electrical outlet to another electrical outlet.
 

mi7chy

macrumors G4
Oct 24, 2014
10,625
11,298
For most laptop use cases the end user wants more battery life. When you've hit the 100Whr airline limit then what else can you do but bring a 100Whr powerbank?

There are different performance profiles. You don't have to run it at unrestricted performance since there are balanced, 2.9GHz base clock @ 45W or even lower to favor longer battery.
 

jeanlain

macrumors 68020
Mar 14, 2009
2,463
958
12900k scores 27401 on Cinebench R23 at peak 251W
5950x scores 24071 on Cinebench R23 (I also get 23794 to 24371 on air cooling at peak 123W)
So, 12900k is ~15% faster at 2x the wattage.
The processor with fewer threads (12900k) has to be run at higher frequency to match or exceed the one with more threads (5950X), and we know that power does not increase linearly with frequency, while it increases roughly linearly with the number of cores.
This result doesn't mean that the intel CPU is based on a less efficient lithography.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.