Announcement

Collapse
No announcement yet.

AMD Smart Access Memory / Resizable BAR On Linux Still Ripe For Improvement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Here's the thing, SAM is more than just resizable BAR [rBAR] support, it's also the OS and driver support on both the CPU and GPU side to take advantage of the fast paths that rBAR support allows for. Although resizable BAR support itself doesn't have any real "special sauce", there is legitimate special sauce here: because AMD controls the CPU and GPU side of things, they can add the optimizations that rBAR support allows for to their driver and ensure/validate that it will work on ALL Ryzen 5000/RX 6000 setups. As seen here, any other setup is kinda a pig in a poke whether the mobo will support turning rBAR on, and even if you do, your OS and drivers may or may not support enabling the applicable fast paths allowed by rBAR support. So yes, SAM theoretically can be supported on many more systems than just Ryzen 5000/RX 6000 combos, but if you want SAM right now on Windows (majority of gamers), you do actually in all probability need the Ryzen 5000/RX 6000 combo. Us Linux nerds can take advantage of SAM on more setups, but we're the exception, not the norm.

    Comment


    • #22
      Originally posted by QwertyChouskie View Post
      Here's the thing, SAM is more than just resizable BAR [rBAR] support, it's also the OS and driver support on both the CPU and GPU side to take advantage of the fast paths that rBAR support allows for. Although resizable BAR support itself doesn't have any real "special sauce", there is legitimate special sauce here: because AMD controls the CPU and GPU side of things, they can add the optimizations that rBAR support allows for to their driver and ensure/validate that it will work on ALL Ryzen 5000/RX 6000 setups. As seen here, any other setup is kinda a pig in a poke whether the mobo will support turning rBAR on, and even if you do, your OS and drivers may or may not support enabling the applicable fast paths allowed by rBAR support. So yes, SAM theoretically can be supported on many more systems than just Ryzen 5000/RX 6000 combos, but if you want SAM right now on Windows (majority of gamers), you do actually in all probability need the Ryzen 5000/RX 6000 combo. Us Linux nerds can take advantage of SAM on more setups, but we're the exception, not the norm.
      Thank you, this is what I heard from marketing: -Support for~. AMD could never promise support for other people's platforms, so how was their presentation supposed to be anything but exclusive? Clearly they're doing a bit of work, and results are that it's worth it. Imagine making good things negative. I'm just more and more glad I went AMD every day.

      Comment


      • #23
        Originally posted by QwertyChouskie View Post
        Here's the thing, SAM is more than just resizable BAR [rBAR] support, it's also the OS and driver support on both the CPU and GPU side to take advantage of the fast paths that rBAR support allows for. Although resizable BAR support itself doesn't have any real "special sauce", there is legitimate special sauce here: because AMD controls the CPU and GPU side of things, they can add the optimizations that rBAR support allows for to their driver and ensure/validate that it will work on ALL Ryzen 5000/RX 6000 setups. As seen here, any other setup is kinda a pig in a poke whether the mobo will support turning rBAR on, and even if you do, your OS and drivers may or may not support enabling the applicable fast paths allowed by rBAR support. So yes, SAM theoretically can be supported on many more systems than just Ryzen 5000/RX 6000 combos, but if you want SAM right now on Windows (majority of gamers), you do actually in all probability need the Ryzen 5000/RX 6000 combo. Us Linux nerds can take advantage of SAM on more setups, but we're the exception, not the norm.
        Some clarification. On CPU side you require some instructions regarding rBAR to use it effectivly, and those AMD had only implemented by microcode (mostly PDEP/PEXT). So it is not even about particulary validation of some sort, it is simply that Zen 2 and older cannot take actual performance advantage of that. Intel had that since Haswell. In terms of GPUs there is no special hardware treatment, only that driver of GPU allows to take advantage of it. So some angry noises for AMD could come that they didn't apply it to their older GPUs as well. I wouldn't be suprised tho if Nvidia released driver update that supports SAM for all their GPUs still supported.

        honestly for Intel stuff is extremly easy, all they have to do is flip the switch on motherboards to say that those stuff are working and existing and if AMD doesn't block them, Intel should be seen as CPUs supporting exactly same things as AMD in terms of SAM. For Nvidia they do simply need to write on driver side stuff that takes advantage of those instructions when they are availiable.
        piotrj3
        Senior Member
        Last edited by piotrj3; 13 December 2020, 07:21 PM.

        Comment


        • #24
          Originally posted by szymon_g View Post
          Could anyone explain it to me as if I was 5 what's the resizable bar etc? Why is it important?
          Traditionally, PCIe allowed only a small window of the GPU's video memory to be accessed from the CPU. This limited how the driver can load data into the GPU. It had to prepare things in system memory first and then copy them in pieces.

          Now, that window can be resized. This means the driver can just make it as big as the whole video memory, so it can directly access all of it. This simplifies the driver and allows for performance improvements like writing data and commands directly to the GPU.

          Comment


          • #25
            Originally posted by piotrj3 View Post
            Some clarification. On CPU side you require some instructions regarding rBAR to use it effectivly, and those AMD had only implemented by microcode (mostly PDEP/PEXT)...
            This has already been debunked by Dr. Ian Cutress

            Comment


            • #26
              What does BAR stand for?

              Comment


              • #27
                Originally posted by shmerl View Post
                What does BAR stand for?
                Base Address Register - it's a register in PCIE config space that sets up an aperture into a PCIE device's on-board resources. On a GPU you typically have one for ROM, one for VRAM, one for GPU registers, and a couple of others I forget...
                Test signature

                Comment


                • #28
                  Originally posted by user1 View Post
                  Apparently, if you have "above 4g decoding" enabled in bios, that means you have resizable BAR support on Linux/AMDGPU. At least with ASUS, not all boards have this BIOS setting. I know that all or most ROG boards have this setting and some Prime boards have it as well, but my board (Prime Z390-P) doesn't have it.
                  Update: I actually found it in System Agent (SA) Configuration under "advanced" section. Because in other motherboards it is under "boot" section.

                  Comment


                  • #29
                    Originally posted by kripteks View Post
                    I have gigabyte b550 aorus pro with the lastest beta bios ("Add Re-size bar option for AMD Smart Access Memory support").
                    I dont see amd sam option in bios, i have ryzen 3800xt , the "above 4g decoding" is here.
                    I was disappointed by this at first as well, but turns out "above 4G decoding" is enough for BAR resizing to work in Linux (I had to disable CSM as well though). The SAM specific option is only needed for Windows.

                    You can check for it working like this:

                    Code:
                    > sudo dmesg|grep BAR=
                    [drm] Detected VRAM RAM=8176M, BAR=8192M
                    If it says "BAR=256M", it's not working.

                    Comment


                    • #30
                      Makes me wonder how much of a difference SAM would make for this:
                      Swap on video RAM - ArchWiki (archlinux.org)

                      Comment

                      Working...
                      X