Announcement

Collapse
No announcement yet.

Configuring detected videoRam in fglrx

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

  • Configuring detected videoRam in fglrx

    fglrx has some issues regarding video ram detection that seems to be triggered by half ass support in fglrx itself.

    So after hours of googling and experimentation, I figured out how to control the amount of video ram fglrx can use.

    Lets cut to the chase, here's my Radeon 9600 XT 256mb agp 8x card entries:
    Code:
    02:00.0 VGA compatible controller: ATI Technologies Inc RV350 AR [Radeon 9600] (prog-if 00 [VGA controller])
            Subsystem: PC Partner Limited Unknown device 0020
            Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
            Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
            Latency: 255 (2000ns min), Cache Line Size: 32 bytes
            Interrupt: pin A routed to IRQ 19
            Region 0: Memory at c0000000 (32-bit, prefetchable) [size=256M]
            Region 1: I/O ports at d000 [size=256]
            Region 2: Memory at e9000000 (32-bit, non-prefetchable) [size=64K]
            [virtual] Expansion ROM at e8000000 [disabled] [size=128K]
            Capabilities: [58] AGP version 3.0
                    Status: RQ=256 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3+ Rate=x4,x8
                    Command: RQ=32 ArqSz=2 Cal=0 SBA+ AGP+ GART64- 64bit- FW- Rate=x8
            Capabilities: [50] Power Management version 2
                    Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                    Status: D0 PME-Enable- DSel=0 DScale=0 PME-
    
    02:00.1 Display controller: ATI Technologies Inc RV350 AR [Radeon 9600] (Secondary)
            Subsystem: PC Partner Limited Unknown device 0021
            Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
            Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
            Region 0: Memory at d0000000 (32-bit, prefetchable) [disabled] [size=256M]
            Region 1: Memory at e9010000 (32-bit, non-prefetchable) [disabled] [size=64K]
            Capabilities: [50] Power Management version 2
                    Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                    Status: D0 PME-Enable- DSel=0 DScale=0 PME-

    As you can see, I have 256mb of memory for both cards. However, fglrx decides to be a total bitch and gives me 128mb to play with:
    Code:
    (II) Module fglrxdrm: vendor="FireGL - ATI Technologies Inc."
    	compiled for 7.1.0, module version = 8.43.2
    	ABI class: X.Org Server Extension, version 0.3
    (--) fglrx(0): VideoRAM: 131072 kByte, Type: DDR SGRAM / SDRAM
    (II) fglrx(0): AGP card detected
    (WW) fglrx(0): board is an unknown third party board, chipset is supported

    Neat.

    The first time I saw this output in xorg I practically bled anger into little cups of ice, especially after the anticipated performance boost from the releases after 8.41

    So, fglrx uses a standard interface (wow!) for applications and drivers to get information of allocated memory. "Memory Type Range Registers (MTRRs) are control registers that are used as a control mechanism which provides system software with control of how accesses to memory ranges by the CPU are cached. It uses a set of programmable model-specific registers (MSRs) which are special registers provided by most modern CPUs." (http://en.wikipedia.org/wiki/Mtrr)

    Linux stores this information in /proc/mtrr

    Heres my output before messing with it:
    Code:
    root@damentz-box:/home/damentz# cat /proc/mtrr
    reg00: base=0x00000000 (   0MB), size=1024MB: write-back, count=1
    reg01: base=0xe0000000 (3584MB), size= 128MB: write-combining, count=1

    Here my agp aperture has allocated 128mb (which is set in the bios) for something at 0xe0000000. Great, lets add our own entry for my radeon card

    If you double check the lspci -vv output of my radeon card, the first card begins storing memory at 0xc0000000, so we'll use that information.

    You can add new entries to /proc/mtrr using echo commands from bash. For instance, to add 256mb at 0xc0000000 I would use this:
    Code:
    echo "base=0xc0000000 size=0x10000000 type=write-combining" >| /proc/mtrr

    Although I am not an expert, it's quite obvious that write-combining should be used as the type of entry in /proc/mtrr

    So here's the new output:
    Code:
    root@damentz-box:/home/damentz# cat /proc/mtrr
    reg00: base=0x00000000 (   0MB), size=1024MB: write-back, count=1
    reg01: base=0xe0000000 (3584MB), size= 128MB: write-combining, count=1
    reg02: base=0xc0000000 (3072MB), size= 256MB: write-combining, count=1

    If you did this right, applications that seemed to chug will gain a dramatic speed boost, especialy on videoram intensive games (enemy territory quake wars)

    Note: I know this is an uncommon issue, but I thought I should shed some light on how to do this for some people lost in the dark and completely pissed off at ati/amd.
    Last edited by damentz; 11-25-2007, 08:13 PM.

  • #2
    It's been known on Rage 3D for awhile..hubick posted a fix for 4 gig of ram and a link to a much larger thread that he used as a base which contained a lot of talk about mtrr issues with the fglrx drivers.
    http://www.rage3d.com/board/showthread.php?t=33821469

    Since it was posted in 2005 I didn't know how relevant it is now(meaning outdated)..or if it was distro related..

    my own output is
    [larry@Tardis-1 ~]$ cat /proc/mtrr
    reg00: base=0x00000000 ( 0MB), size=2048MB: write-back, count=1

    I don't see any mtrr being used... yet with my x800pro I can run compiz-fusion & the 8.42's just fine games run well under it. vid playback is ok with mplayer...

    While I want to wring every bit of performance I can..
    I'm not sure if this doesn't fall under the if it ain't broke don't fix it in my case..I'm wondering if Mandriva disabled it in their rpm's
    Last edited by DarkFoss; 11-25-2007, 08:54 PM.
    Those who would give up Essential Liberty to purchase a little Temporary Safety,deserve neither Liberty nor Safety.
    Ben Franklin 1755

    Comment


    • #3
      Bug #247887

      Readers might be interested to know that a bug related to this was filed in the Ubuntu issue tracker:

      https://bugs.launchpad.net/ubuntu/+s...rg/+bug/247887

      Comment


      • #4
        Originally posted by damentz View Post
        fglrx has some issues regarding video ram detection that seems to be triggered by half ass support in fglrx itself.

        So after hours of googling and experimentation, I figured out how to control the amount of video ram fglrx can use.
        It's been said before that this is the amount of video ram that can be accessed by the CPU - but that doesn't mean the GPU can't use it all.

        etqw has an option for you to tell it how much vram you have +set sys_videoRam IIRC sdl fails to detect and it uses 64 as a default.

        Comment


        • #5
          Originally posted by legume View Post
          It's been said before ...
          Where can I read about this?

          Comment


          • #6
            Originally posted by Cruxic View Post
            Where can I read about this?
            I can't give direct links, but I think Bridgman has said it on here and I've seen it said WRT OSS drivers on #radeon on freenode.net, which is archived on radeonhd.org.

            Perhaps someone on #radeon would explain if you asked on there.

            Comment


            • #7
              Thanks for the pointer, legume. Here's a couple places that user agd5f mentions this PCI BAR limitation (base address register?):

              http://www.phoronix.com/forums/showp...0&postcount=17

              http://www.radeonhd.org/?page=archiv...08&d=2008-5-28

              Comment


              • #8
                Hi everyone! I have a similar (yet not quite the same) issue: I'm using just one AMD A4 APU with fglrx. I would like to be able to use more video memory for opencl computing. I have 512MB and would like to set it e.g. to 1024MB. My BIOS does not allow for this, but for a max of 512MB.

                I've tried to use your method, Cruxic, but I don't even know how to apply the mtrr method, because my mtrr looks a bit different:
                Code:
                reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
                reg01: base=0x080000000 ( 2048MB), size=  512MB, count=1: write-back
                reg02: base=0x09f800000 ( 2552MB), size=    8MB, count=1: uncachable
                and e.g.
                Code:
                su -c 'echo "base=0x11000000 size=0x10000000 type=write-combining" >| /proc/mtrr'
                did not work for me. Also I've tried the "VideoRAM" setting in the xorg.conf, but so far without success.

                Any help would be appreciated.

                Happy holidays!

                Comment


                • #9
                  Originally posted by djtm View Post
                  Hi everyone! I have a similar (yet not quite the same) issue: I'm using just one AMD A4 APU with fglrx. I would like to be able to use more video memory for opencl computing. I have 512MB and would like to set it e.g. to 1024MB. My BIOS does not allow for this, but for a max of 512MB.

                  I've tried to use your method, Cruxic, but I don't even know how to apply the mtrr method, because my mtrr looks a bit different:
                  Code:
                  reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back
                  reg01: base=0x080000000 ( 2048MB), size=  512MB, count=1: write-back
                  reg02: base=0x09f800000 ( 2552MB), size=    8MB, count=1: uncachable
                  and e.g.
                  Code:
                  su -c 'echo "base=0x11000000 size=0x10000000 type=write-combining" >| /proc/mtrr'
                  did not work for me. Also I've tried the "VideoRAM" setting in the xorg.conf, but so far without success.

                  Any help would be appreciated.

                  Happy holidays!
                  OpenCL is limited to 512MB by default but you can raise the limit by running the following:

                  Code:
                  export GPU_MAX_ALLOC_PERCENT=100

                  Comment

                  Working...
                  X