This is my post. Basically, I needed P2P between four R9700s for tensor parallel serving, which means a 32 GB BAR on each card. With all six GPUs in, the BIOS couldn't map them, and Linux sized the switch's window too small, so only two cards got their BARs. The module in the post works around that. With P2P off, prefill was about half as fast.
>> I think a lot of folks use open air aluminum extrusion frames that were once meant for mining.
That is what i am using. It works well enough, and is much much quieter than the server rackmount case I started with, but mining rigs do not fit AI very well. The full PCI risers need more space than the USB-PCI things used in mining rigs. So, anyone reading this, make sure to buy a frame that is a couple inches taller than the standard squat mining rigs.
Before anyone asks, my rig is 3x5060ti(16gb) for 48GB VRAM, then 64GB DDR4 and a 1000w power supply.
I alternate between Ollama for LLMs and ComfyUI for image/video creation.
The gpu_unlock is a bit hacky (but I have many GPUs that the unlock won't work on and that will cause issues), and there are two BIOS settings that matter: above 4GB decode enabled and resizeable bar enabled. That's it.
Odd. I'm using 7 GPUs (8 if you include the onboard AST2500) and haven't had this issue, but these are directly connected to the mainboard
I did disable CSM which used base memory resources needed by REBAR, but aside from that I've 6x Tesla P4s, 1x 750TI, and the AST2500 all happily working together.
My board is a Cloud Star C612 (6x DDR4 variant), 2 PCIE ports bifurcated (so 4 GPUs in total, the others sit on dedicated ports), with a Xeon E5 2696v3 and TBU.
That is because you are using a server Xeon E5 Motherboard at a time when Teslas and Large BARs were becoming a thing whereas he is using a consumer ASUS TUF GAMING X570-PLUS with a PCIe Switch hooked in that makes the MMIO resources from a single PCIe Port suddently becoming gigantic. Unlikely to have ever been tweaked, much less tested, by vendor for that use case.
I am literally also using an X570 ASUS TUF motherboard and run into resize BAR issues with Linux able to deal with and the bios -- which seems RGB fan optimised rather than memory bandwidth optimised -- unable to directly help.
The bottleneck with AI and hardware is really pushing things.
Even with six capable GPUs that have plenty of VRAM with enough PCIe bandwidth, you then discover that memory address allocation is preventing the hardware from doing what it's physically capable of.
It feels ridiculous that a person has to go to these kind of lengths to do what is in the end a trivial thing: assigning little pieces of a gigantic virtual address space to specific peripherals.
The only thing that's complex here is having to influence a bunch of hidden software through three layers of indirection. The software is all standing in the way of a person just writing some values to registers.
Another important benefit is that transfers between cards flow across the switch and bypass the CPU, that ain't nothing. At least for the AMD cards. Nvidia firmware refuses nach
Most CPUs can address 48 bits of physical memory (hundreds of terabytes), why is that even a problem ? Is it just some hardware limitation somewhere else or badly written firmware ?
Yeah, it's the firmware. It's an AM4 board, and the BIOS only gives PCI devices the space from the top of RAM up to 512 GB. Each 32 GB BAR has to start on a 32 GB boundary, and its small doorbell BAR spills into the next slot, so each card needs 64 GB. Six won't fit. So I turn Resizable BAR off in the BIOS and resize the four R9700s from Linux, where I hit the kernel bug.
The problem is that with P2P every card will map every other card into its address space. So you're not mapping 128G but likely 512! It depends a bit on what software you use, some software is smart about this and uses a smaller sliding window if it can't use all of it at once and some software is really rigid.
There was never a concerted effort in the PC ecosystem to force all peripherals and firmware to drop 32-bit compatibility. At some point after a decade or two of x86-64 CPUs, we should have started making GPUs that simply exposed all of their VRAM to be mapped by the host by default, instead of retaining compatibility hacks like only mapping 256MB by default. Resizable BARs should have happened at least a decade earlier, and should have been phased out by now in favor of just always mapping all the VRAM.
These kind of things should be fun to test in Coreboot. When Dasharo was released for the MSI PRO Z690-A DDR4 more than four years ago, I had issues with two Radeon 5600XT installed that was fixed after developer tuned some MMIO related parameters: https://github.com/Dasharo/dasharo-issues/issues/245
How many PCIe Switches you could chain and how many cards with absurd MMIO requeriments you can get working would be an interesing experiment.
In the last decade or so I have seen plenty of Firmware MMIO related issues. I remember certain SR-IOV supporting NICs (Usually Intel ones like i350 and other enterprise parts) not being able to reserve enough MMIO to create all the supported SR-IOV Virtual Functions in consumer Motherboards, in many cases you could get SR-IOV working but were limited to create like 4 VFs even if hardware supported 16 because that is what you could fit. This was essentially all a Firmware issue, not Hardware, but few people has the required skills to do any BIOS modding to fix rather convoluted things like MMIO allocation. Basically, you're trying to workaround Firmware issues elsewhere.
[OP] dougcalobrisi | 8 hours ago
WarOnPrivacy | 6 hours ago
Asking because I really want to see your kit.
iririririr | 6 hours ago
[OP] dougcalobrisi | 6 hours ago
I think a lot of folks use open air aluminum extrusion frames that were once meant for mining.
tucnak | 6 hours ago
sandworm101 | 4 hours ago
That is what i am using. It works well enough, and is much much quieter than the server rackmount case I started with, but mining rigs do not fit AI very well. The full PCI risers need more space than the USB-PCI things used in mining rigs. So, anyone reading this, make sure to buy a frame that is a couple inches taller than the standard squat mining rigs.
Before anyone asks, my rig is 3x5060ti(16gb) for 48GB VRAM, then 64GB DDR4 and a 1000w power supply.
I alternate between Ollama for LLMs and ComfyUI for image/video creation.
jacquesm | 6 hours ago
GRUB_CMDLINE_LINUX_DEFAULT="pcie_aspm=off amd_iommu=on iommu=pt pci=realloc,firmware noapic nomodeset pci=nommconf gpu_unlock.targets=0000:66:00.0,0000:69:00.0,0000:6d:00.0,0000:6e:00.0"
The gpu_unlock is a bit hacky (but I have many GPUs that the unlock won't work on and that will cause issues), and there are two BIOS settings that matter: above 4GB decode enabled and resizeable bar enabled. That's it.
SillyUsername | 5 hours ago
I did disable CSM which used base memory resources needed by REBAR, but aside from that I've 6x Tesla P4s, 1x 750TI, and the AST2500 all happily working together.
My board is a Cloud Star C612 (6x DDR4 variant), 2 PCIE ports bifurcated (so 4 GPUs in total, the others sit on dedicated ports), with a Xeon E5 2696v3 and TBU.
zir_blazer | 4 hours ago
azalemeth | 4 hours ago
Cool!
bombela | 7 hours ago
[OP] dougcalobrisi | 7 hours ago
kkaske | 7 hours ago
Even with six capable GPUs that have plenty of VRAM with enough PCIe bandwidth, you then discover that memory address allocation is preventing the hardware from doing what it's physically capable of.
jeffbee | 7 hours ago
The only thing that's complex here is having to influence a bunch of hidden software through three layers of indirection. The software is all standing in the way of a person just writing some values to registers.
ethersteeds | 6 hours ago
luckystarr | 5 hours ago
InsidiousWombat | 6 hours ago
[OP] dougcalobrisi | 6 hours ago
InsidiousWombat | 6 hours ago
I wonder if AI could RE the BIOS enough to fix that limit
jacquesm | 6 hours ago
wtallis | 6 hours ago
ChocolateGod | 2 hours ago
Believe this is what Intel GPUs already do.
> Resizable BARs should have happened at least a decade earlier
We have had "Above 4G Decoding" for years.
zir_blazer | 6 hours ago
In the last decade or so I have seen plenty of Firmware MMIO related issues. I remember certain SR-IOV supporting NICs (Usually Intel ones like i350 and other enterprise parts) not being able to reserve enough MMIO to create all the supported SR-IOV Virtual Functions in consumer Motherboards, in many cases you could get SR-IOV working but were limited to create like 4 VFs even if hardware supported 16 because that is what you could fit. This was essentially all a Firmware issue, not Hardware, but few people has the required skills to do any BIOS modding to fix rather convoluted things like MMIO allocation. Basically, you're trying to workaround Firmware issues elsewhere.
kodoman | 5 hours ago
All jokes aside I would love to know more about your set up and what you do with it and what speeds you get token wise.