Ubuntu – Any way to make switching between discrete and integrated graphics from the BIOS work with proprietary drivers

atidriversfglrxgraphicsswitchable-graphics

What I would like to be able to do:

I would like to be able to switch between my dedicated graphics card (AMD) and integrated chip (Intel) from the BIOS, that means:

Restart → BIOS: set to integrated Intel enabled (only) → boot

or

Restart → BIOS: set to discrete AMD enabled (only) → boot

This type of primitive switching works fine when running on open source drivers. However, as soon as I install fglrx, switching from AMD to Intel from the BIOS breaks the session and the system falls back to low-graphics mode on boot-up.

What I did:

  1. fresh system, open source drivers with Intel enabled
  2. switched to AMD = no problemo!
  3. switched to Intel = no problemo!
  4. (the above repeated few times and tested for performance
    issues)
  5. installed proprietary AMD drivers per
    http://www.unixmen.com/ubuntu-12-10-and-amd-catalyst-problem-solved/
    (PPA) ⇒ working fine after restart!
  6. switched to Intel ⇒ broken configuration, i.e. system boots to
    2D/fallback mode!

Why do I need it?

First of all, it's a matter of my curiosity. More importantly though, getting this thing to switch on AMD proprietary would be huge for me.

I was asking about AMD/Intel switching a while ago and while I got the answer, 1) it doesn't work 2) I can't contact the author of the answer 3) I suspect the answer is overcomplicated.

In summary I need help either with this question or with the old one linked above.

System information:

Ubuntu 12.04 amd64, installed clean
Lenovo Thinkpad T500
Intel GMA 4500MHD / ATI Mobility Radeon HD 3650

Best Answer

I haven't tried this with an AMD adapter, but your issue is common to integrated vs. discrete Nvidia graphics setups as well (tested on a Lenovo Thinkpad T510s).

Under normal circumstances, an open source graphics driver is automatically selected by the X server during boot based upon your adapter selection in BIOS -- integrated vs. discrete.

When enabling proprietary drivers while the discrete adapter is in use, an Xorg configuration file is created in /etc/X11/xorg.conf in order to explicitly tell the X server to use the proprietary driver. While this configuration file exists, X will use the driver specified in it rather than auto-detecting your hardware setup. You can see how this would be problematic when you switch back to your integrated graphics adapter; the AMD/Nvidia proprietary driver is still specified in the xorg.conf file.

The way to safely revert back to your integrated graphics adapter is to delete the xorg.conf file:

$ sudo rm /etc/X11/xorg.conf

Alternately, you may rename the file such that it can no longer be found by X:

$ sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

On your next boot, when no xorg.conf file is detected, the X system will again auto-detect your hardware configuration and load the appropriate open source driver.