Fitting Four 32 GB Resizable Bars Behind a PCIe Switch on Linux
doug.sh
doug.sh
Asking because I really want to see your kit.
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.
Also, insert obligatory "friends don't let friends use Ollama" speech here.
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.
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.
Cool!
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.
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.
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.
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.
I wonder if AI could RE the BIOS enough to fix that limit
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.
...and is fun to read issues from a decade ago about failing to get those working in desktop systems. Makes perfect sense why they never did that with no control over the Firmware ecosystem.
IIRC, there was at least one particular Tesla or Quadro model where nVidia was providing tools to flash its VBIOS because there were two versions, one with standard 256 MiB BAR and other with Large BAR, and you needed to reflash VBIOS with the version you wanted to use. This was of course pre ReBAR. ReBAR pretty much solved the issue because if it doesn't support ReBAR you get standard 256 MiB BAR compatibility mode, and if it does, then it is assumed it works. Large BAR GPUs tended to either made the system to not POST or failed to be initialized in anything not intended for it.
My first desktop with DDR3 had four DIMM slots supporting 8GB modules, but the total address space was limited to 32GB including all address space used by peripherals, and the peripherals were all mapped below 4GB. So it was effectively a 35-bit system, even though Intel never shipped an x86-64 CPU with less than 36-bit physical address space and AMD never shipped less than 40-bit. Significant parts of the PC ecosystem were being stingy with address lines.