# AMD hybrid GPU + fglrx quirks

## Mrhnhrm

So, I have this Dell Inspiron m5110 with a hybrid GPU (AMD A6 APU: Radeon HD 6520G integrated chip, Radeon HD 64-something-M as the discrete one). I'm running fglrx 12.6 with xorg-server 1.12.2, and at a first glance everything just works. When inspected in more detail, everything seems like a horrible mess.

First and foremost, the system seems to lack some RAM. BIOS happily reports 4 gigs of memory installed, the running system only sees 3.3 gigs no matter what I do with the Catalyst Control Center. Yes, I'm running a 64 bit kernel. Judging from the following information, the rest of RAM is probably stolen by the integrated GPU. It would be good to eventually have it back.

Case study 1. Switch the active GPU to the discrete one in amdcccle and reboot. amdcccle lists both GPUs in the Informtion section. OpenGL screensavers give nice FPS. Now suspend to RAM (or to disk) and resume. The same screensavers suddenly drop their performance significantly and desktop effects start lagging. 

Case study 2. Switch the active GPU to the integrated one and reboot. amdcccle lists only the HD 6520G device in the Informtion section. OpenGL screensavers give approximately the same FPS/load as in Case 1 before suspending. Suspending now and resuming doesn't affect OpenGL performance.

It appears that aticonfig has written xorg.conf in such a way that only the HD 6520G is listed there (listing as when the integrated GPU is on in amdcccle)

```
dmesg | grep fglrx

[   10.363030] fglrx: module license 'Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY' taints kernel.

[   10.372385] [fglrx] Maximum main memory to use for locked dma buffers: 3272 MBytes.

[   10.372433] [fglrx]   vendor: 1002 device: 9647 count: 1

[   10.372759] [fglrx]   vendor: 1002 device: 6760 count: 2

[   10.372893] [fglrx] ioport: bar 1, base 0xf000, size: 0x100

[   10.373162] [fglrx] ioport: bar 4, base 0xe000, size: 0x100

[   10.373360] [fglrx] Kernel PAT support is enabled

[   10.373392] [fglrx] module loaded - fglrx 8.98.2 [Jun 11 2012] with 2 minors

[   22.772582] [fglrx] ATIF platform detected with notification ID: 0x81

[   23.486492] fglrx_pci 0000:00:01.0: irq 54 for MSI/MSI-X                <- The interesting part

[   23.487439] [fglrx] Firegl kernel thread PID: 8190

[   23.487538] [fglrx] Firegl kernel thread PID: 8191

[   23.487634] [fglrx] Firegl kernel thread PID: 8192

[   23.487767] [fglrx] IRQ 54 Enabled

[   23.826849] [fglrx] Gart USWC size:1072 M.

[   23.826852] [fglrx] Gart cacheable size:424 M.

[   23.826857] [fglrx] Reserved FB block: Shared offset:0, size:1000000 

[   23.826859] [fglrx] Reserved FB block: Unshared offset:fca5000, size:35b000 

[   23.826861] [fglrx] Reserved FB block: Unshared offset:1fff4000, size:c000 

[ 4171.066711] [fglrx] IRQ 54 Disabled                                              <- Tried suspending here

[ 4171.066835] [fglrx] Preparing suspend fglrx in kernel.

[ 4171.226083] [fglrx] Suspending fglrx in kernel completed.

[ 4171.226087] [fglrx] Power down the ASIC .

[ 4171.857071] [fglrx] Power up the ASIC

[ 4171.860865] [fglrx] Preparing resume fglrx in kernel.

[ 4171.866148] [fglrx] Resuming fglrx in kernel completed.

[ 4171.866210] [fglrx] IRQ 54 Enabled

In xorg.conf:

Section "Device"

        Identifier  "aticonfig-Device[0]-0"

        Driver      "fglrx"

#       Option      "UseInternalAGPGART" "no"

#       Option "UseFastTLS"         "0"

        BusID       "PCI:0:1:0"                              <- The numbers match

EndSection
```

Imagining that I'm smarter than this, I switched amdcccle to the dedicated GPU and got this:

```
[   10.804280] fglrx: module license 'Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY' taints kernel.

[   10.814486] [fglrx] Maximum main memory to use for locked dma buffers: 3272 MBytes.

[   10.814530] [fglrx]   vendor: 1002 device: 9647 count: 1

[   10.814840] [fglrx]   vendor: 1002 device: 6760 count: 2

[   10.814975] [fglrx] ioport: bar 1, base 0xf000, size: 0x100

[   10.815260] [fglrx] ioport: bar 4, base 0xe000, size: 0x100

[   10.815462] [fglrx] Kernel PAT support is enabled

[   10.815494] [fglrx] module loaded - fglrx 8.98.2 [Jun 11 2012] with 2 minors

[   24.011580] [fglrx] pcs command failed. rc:0x1

[   24.036988] [fglrx] module unloaded - fglrx 8.98.2 [Jun 11 2012]

[   24.064522] [fglrx] Maximum main memory to use for locked dma buffers: 3272 MBytes.

[   24.064558] [fglrx]   vendor: 1002 device: 9647 count: 1

[   24.064762] [fglrx]   vendor: 1002 device: 6760 count: 2

[   24.064897] [fglrx] ioport: bar 1, base 0xf000, size: 0x100

[   24.065156] [fglrx] ioport: bar 4, base 0xe000, size: 0x100

[   24.065280] [fglrx] Kernel PAT support is enabled

[   24.065305] [fglrx] module loaded - fglrx 8.98.2 [Jun 11 2012] with 2 minors

[   24.094007] [fglrx] ATIF platform detected with notification ID: 0x81

[   25.774424] fglrx_pci 0000:00:01.0: irq 54 for MSI/MSI-X

[   25.775185] [fglrx] Firegl kernel thread PID: 8192

[   25.775308] [fglrx] Firegl kernel thread PID: 8193

[   25.775424] [fglrx] Firegl kernel thread PID: 8194

[   25.775533] [fglrx] IRQ 54 Enabled

[   25.797224] fglrx_pci 0000:01:00.0: irq 55 for MSI/MSI-X     <- Here is something different

[   25.797815] [fglrx] Firegl kernel thread PID: 8195

[   25.797893] [fglrx] Firegl kernel thread PID: 8196

[   25.798152] [fglrx] Firegl kernel thread PID: 8197

[   25.798337] [fglrx] IRQ 55 Enabled

[   26.098554] [fglrx] Gart USWC size:1072 M.

[   26.098557] [fglrx] Gart cacheable size:424 M.

[   26.098562] [fglrx] Reserved FB block: Shared offset:0, size:1000000 

[   26.098564] [fglrx] Reserved FB block: Unshared offset:f9a4000, size:35c000 

[   26.098566] [fglrx] Reserved FB block: Unshared offset:3fff4000, size:c000 

[   26.111061] [fglrx] Gart USWC size:1072 M.

[   26.111064] [fglrx] Gart cacheable size:424 M.

[   26.111069] [fglrx] Reserved FB block: Shared offset:0, size:1000000 

[   26.111071] [fglrx] Reserved FB block: Unshared offset:fca5000, size:35b000 

[   26.111073] [fglrx] Reserved FB block: Unshared offset:1fff4000, size:c000 

[  125.967468] [fglrx] IRQ 55 Disabled                                          <- Suspending and losing a lot of performance after resuming

[  125.967635] [fglrx] Preparing suspend fglrx in kernel.

[  126.143463] [fglrx] Suspending fglrx in kernel completed.

[  126.143467] [fglrx] Power down the ASIC .

[  126.143649] [fglrx] IRQ 54 Disabled

[  126.143661] [fglrx] Preparing suspend fglrx in kernel.

[  126.296394] [fglrx] Suspending fglrx in kernel completed.

[  126.296397] [fglrx] Power down the ASIC .

[  126.757319] [fglrx] Power up the ASIC

[  126.761099] [fglrx] Preparing resume fglrx in kernel.

[  126.766345] [fglrx] Resuming fglrx in kernel completed.

[  126.766384] [fglrx] IRQ 54 Enabled

[  126.773083] [fglrx] Power up the ASIC

[  126.782672] [fglrx] Preparing resume fglrx in kernel.

[  126.792568] [fglrx] Resuming fglrx in kernel completed.

[  126.792654] [fglrx] IRQ 55 Enabled

```

Still thinking that I'm smarter than the configuration utility, I manually changed the device bus address in xorg.conf to the discrete one's. However, X server segfaults when trying to start this way.

So, any clues on the situation? Is the discrete GPU used at all in these cases? Any chance of getting it working properly and preventing the integrated GPU from stealing so much RAM?

Thanks in advance.

----------

