Disable AMD Smart Access Memory (BAR) completely in Linux?

pillagenburn

[H]ard|Gawd
Joined
Oct 3, 2006
Messages
1,274
Does anyone know how to completely disable AMD Smart Access Memory (BAR) support on linux? Ubuntu specifically; it seems to be hoarding 256MB of my video card's RAM and my GPU doesn't have much video memory to begin with (2GB). I've searched around on this and don't see any real indicators of how to do this or if it's even possible.

Or could this be done by using an older version of amdgpu/amdgpu-pro if there is no readily available way to disable it? This is on a RX460 2GB card.

Thanks!
 
I don't think you can, but otoh, I'm not sure it's hoarding your memory either (admit that I don't really understand what exactly the BAR is used for, but I think it's required). You may be able to set the size of the BAR in the bios, but I think the minimum nowadays is 256.

Are you trying to use the card for something not related to displaying graphics? I think any secondary cards would have the full pool available, but the primary card will always have some reserved.
 
^^ yup, should be in bios. my asus bios has a switch at the very top, iirc.
 
Screenshot_20211025-103455.jpg


Turning that off will disable "Re-Size BAR", but afaik the BAR is still there, just at the default size.
 
yeah I'm looking to either resize it to zero or turn it off completely. Windows does not do this so it appears to be a Linux thing. Or is there a way to open this allocation up between both the GPU and the CPU as a workaround? My CPU has plenty of RAM but my GPU is what's lacking.

edit: Also, I plugged in my friend's 2GB RX460 in addtion to mine to see what would happen and it appears to be reserving 256MB of that one as well.... which is strange?

Conversely, is there a way to tell the CPU to *PRIMARILY* use BAR instead of main system memory? I'm curious if you could get crazy fast RAM from an old GPU that has lots of memory and basically use that as blazingly fast system RAM (essentially use the card's memory as main memory and your system DDR4 as backup). i imagine you'd be limited by the PCI-E bus and latency or something but still would be interesting.
 
BARs (Base address registers) are used to access higher memory addresses, so probably what you want is not to disable resizing, but reduce the size of the BAR. Unfortunately, I don't know how to do that other than in the bios if the option is there .

https://wiki.osdev.org/PCI#Base_Address_Registers
 
Yeah I thought that too but it seems like this might be a hard-coded default/minimum amount when BAR access is enabled. The reason I think this is because it doesn't do this in Windows from what I can tell. This may be an overridden via some setting in Linux (via grub bootloader options maybe?) but it seems a very low-level option that isn't obvious. I'm still poking around and have even found some info on NVIDIA related forums.

I do appreciate everyones' interest and help btw!

BARs (Base address registers) are used to access higher memory addresses, so probably what you want is not to disable resizing, but reduce the size of the BAR. Unfortunately, I don't know how to do that other than in the bios if the option is there .

https://wiki.osdev.org/PCI#Base_Address_Registers
 
Conversely, is there a way to tell the CPU to *PRIMARILY* use BAR instead of main system memory? I'm curious if you could get crazy fast RAM from an old GPU that has lots of memory and basically use that as blazingly fast system RAM (essentially use the card's memory as main memory and your system DDR4 as backup). i imagine you'd be limited by the PCI-E bus and latency or something but still would be interesting.
I don't think older GPUs do resizable BARs, so you wouldn't be able to access the whole memory (unless it was old enough that it was directly mapped). That said, I expect PCI-E to have higher latency and lower bandwidth than system memory. There are actually some use cases of a GPU as PCI-E memory, but it would be pretty limited and may not make much sense in practical configurations anyway; and with today's GPU market, it's certainly not cost effective. Wikipedia puts PCI-E 4.0 x16 at 31.5 GB/s, but one channel of DDR4-3200 is 25 GB/s.

This would be something you'd need to tell your operating system to do, not your CPU btw. You'd probably need to do some GPU driver work to make it possible, but you could theoretically add the GPU memory to the overall memory pool. But you'd need a pretty good reason; it just doesn't seem useful for the most part.
 
Back
Top