Announcement

Collapse
No announcement yet.

Simple graphics switching through BIOS

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

  • #31
    @Bucic

    I could implement it for Ubuntu as well, but that would require an older version like 12.04 (or a ppa with xserver-xorg-core downgrade). I did not install Ubuntu for over 1 year because it is boring (not even for 1 day). I only compile an Ubuntu style kernel on my systems. I can not implement it for Fedora, Ubuntu should be possible, but why should i do that for free when i have it already for my own system?

    Comment


    • #32
      I don't know if this helpful at all, but I've written a program called hybrid-detect based on a program of the same name shipped with Ubuntu: https://github.com/chenxiaolong/Fedo...ybrid-detect.c

      Basically, Ubuntu (and Debian) has the infrastructure for switching the libGL libraries. Basically, /usr/lib/*/libGL.so is a symlink to /etc/alternatives/something, which is a symlink to the actual libGL library. Because of the intermediate alternatives symlink, it's easy to choose which libGL to use with the update-alternatives tool. On Ubuntu, the Intel/Mesa libGL symlinks would be:

      /usr/lib/*/libGL.so -> /etc/alternatives/something -> /usr/lib/*/mesa/libGL.so

      and for fglrx:

      /usr/lib/*/libGL.so -> /etc/alternatives/something -> /usr/lib/*/fglrx/libGL.so

      Of course, that requires Mesa to set up its GL library in the alternatives system. Ubuntu and Debian do this, but Fedora doesn't.

      That's where my tool comes into play. (Note that it was written for NVIDIA graphics cards with muxes, but it should be easily adaptable for fglrx). It's an ugly solution, but it works. Basically, I patched the rpmfusion NVIDIA rpms so that they installed all the libraries and Xorg drivers in locations that would not be loaded by default. The packages then has a nvidia-lib(64).conf containing the path to the NVIDIA libraries. This is set up with the alternative system for the /etc/ld.so.conf.d/nvidia-lib(64).conf file. So when the Intel card is to be used:

      /etc/ld.so.conf.d/nvidia-lib(64).conf -> /etc/alternatives/nvidia-lib(64).conf -> /dev/null

      The file would point to nothing, so ldconfig will not pick up the NVIDIA libraries. And when the NVIDIA card is used:

      /etc/ld.so.conf.d/nvidia-lib(64).conf -> /etc/alternatives/nvidia-lib(64).conf -> /usr/share/nvidia/nvidia-lib(64).conf

      That takes care of the libraries. What about the NVIDIA Xorg drivers? The package installs a Xorg.conf.d file containing ModulePath lines which tell Xorg where to look for drivers. /etc/X11/xorg.conf.d/00-gfx.conf either points to modulepath.intel.conf or modulepath.nvidia.conf

      Once the patched packages are installed, the hybrid-detect tool will run on every boot, changing the symlinks depending on which card is enabled.

      Again, this is horribly hacky and convoluted, but it's the only way I could think of approaching this issue without altering any Fedora packages, only external packages.

      Source code for hybrid-detect: https://github.com/chenxiaolong/Fedo.../hybrid-detect
      Patched NVIDIA drivers: https://github.com/chenxiaolong/Fedo...x11-drv-nvidia
      Difference between non-patched and patched (may be useful for patching the fglrx package): https://gist.github.com/chenxiaolong/5483695

      Comment


      • #33
        Originally posted by Bucic View Post

        This would let me restore my current system to the productivity-optimized configuration with Intel, so I could proceed with installing another distro for gaming without loosing anything I currently have got, configured and working.
        What I donīt understand is why you want fglrx?

        I currently write from Amilo Xi 1554, which has AMD mobility X1900 (top-line mobile) and its working very good!
        At first the notebook was hot, but when I purchased Arctic Cooling MX2 and Phobya XT pads, and replaced all, the temperatures on surface went down from burning 60C to 40C. The ACPI is still broken thanks to microsoft, but I managed to combat that by editing ACPI and patching kernel + script, so I can now control the fans manually. So, right now its basically top notch an graphics are very fast and compete with opensource radeon.

        So, why fglrx instead of intel+radeon?

        Comment


        • #34
          @Kano & chenxiaolong

          Switching to another distro is out of question. Currently the amount of initial configuration one has to put into a fresh Fedora install is just about 'right' for my taste. I use computer as a production machine. Linux is not my hobby. At least not my first hobby. To put it other way - I won't go for any tinkering that is more than twice as cumbersome than seting up a dual boot environment. Twice as cumbersome is fine.

          The bounty thing is still valid for complete solutions. Elegance is not required. A minimum I can think of is not having to uninstall given drivers in order to switch to another graphics. That's all.

          EDIT:
          http://devgurus.amd.com/message/1296327
          Last edited by Bucic; 04-29-2013, 03:21 PM.

          Comment


          • #35
            Originally posted by Bucic View Post
            @Kano & chenxiaolong

            Switching to another distro is out of question. Currently the amount of initial configuration one has to put into a fresh Fedora install is just about 'right' for my taste. I use computer as a production machine. Linux is not my hobby. At least not my first hobby. To put it other way - I won't go for any tinkering that is more than twice as cumbersome than seting up a dual boot environment. Twice as cumbersome is fine.

            The bounty thing is still valid for complete solutions. Elegance is not required. A minimum I can think of is not having to uninstall given drivers in order to switch to another graphics. That's all.

            EDIT:
            http://devgurus.amd.com/message/1296327
            My solution is for Fedora I don't have the time to adapt it for fglrx right now, but I may do it later. I'll do it for free of course, since it's for the good of the community.

            Comment


            • #36
              Originally posted by chenxiaolong View Post
              My solution is for Fedora I don't have the time to adapt it for fglrx right now, but I may do it later. I'll do it for free of course, since it's for the good of the community.
              The $30 will go to the community then, unless you change your mind

              Comment


              • #37
                Originally posted by Bucic View Post
                The $30 will go to the community then, unless you change your mind
                Haha, as a 17 year old, I don't know if it's even legal to accept a donation

                Anyway, I'll start working on it in the next few days. Could you provide the output of "lspci -nnv" so I can see what the vendor ID for ATI cards is? Thanks!

                EDIT: Also, do you use xorg-x11-drv-catalyst or xorg-x11-drv-catalyst-legacy?
                Last edited by chenxiaolong; 04-29-2013, 04:41 PM.

                Comment


                • #38
                  Originally posted by chenxiaolong View Post
                  Haha, as a 17 year old, I don't know if it's even legal to accept a donation

                  Anyway, I'll start working on it in the next few days. Could you provide the output of "lspci -nnv" so I can see what the vendor ID for ATI cards is? Thanks!

                  EDIT: Also, do you use xorg-x11-drv-catalyst or xorg-x11-drv-catalyst-legacy?
                  It's not mine to decide

                  Here's the return of `lspci -nnv`:
                  http://sdrv.ms/17tRVX7

                  I'm pretty sure I use *-legacy. I used the following procedure to get catalyst legacy 13.1 installed
                  https://ask.fedoraproject.org/questi...gacy-chipsets/
                  The following line concluded the procedure:
                  Code:
                  su -c 'yum -y --disableexcludes=all install akmod-catalyst-legacy-*.rpm xorg-x11-drv-catalyst-legacy-13*.rpm xorg-x11-drv-catalyst-legacy-libs-13*.rpm'

                  Comment


                  • #39
                    Originally posted by chenxiaolong View Post
                    Haha, as a 17 year old, I don't know if it's even legal to accept a donation
                    It's not a donation if you get paid to do work. But it sure is legal as long as you pay taxes for the money you get for doing specific work ;-)

                    Comment


                    • #40
                      Alrighty, I finished making the packages The source code and packaging are available here: https://github.com/chenxiaolong/Fedora-Hybrid-Graphics

                      Instructions

                      1. Switch to the AMD/ATI card in the BIOS. This is just to prevent any crashes when you install xorg-x11-drv-catalyst-legacy.

                      2. Install xorg-x11-drv-catalyst-legacy just like from the link you posted (https://ask.fedoraproject.org/questi...gacy-chipsets/).

                      3. Reboot and make sure everything is fine.

                      4. Clone my git repo:

                      Code:
                      sudo yum install git rpmdevtools rpm-build wget
                      git clone https://github.com/chenxiaolong/Fedora-Hybrid-Graphics.git
                      cd Fedora-Hybrid-Graphics/
                      5. Install my patched Catalyst legacy drivers.

                      Code:
                      cd xorg-x11-drv-catalyst-legacy/
                      wget --inet4-only 'http://developer.amd.com.php53-23.ord1-1.websitetestlink.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz'
                      spectool -g xorg-x11-drv-catalyst-legacy.spec
                      sudo yum-builddep xorg-x11-drv-catalyst-legacy.spec
                      rpmbuild -bb xorg-x11-drv-catalyst-legacy.spec --define "_sourcedir $(pwd)" --define "_rpmdir $(pwd)"
                      sudo yum install ./x86_64/xorg-x11-drv-catalyst-legacy-*hybridgfx*.rpm
                      6. Install the hybrid-detect autoswitcher.

                      Code:
                      cd ../hybrid-detect-fglrx/
                      sudo yum-builddep hybrid-detect-fglrx.spec
                      rpmbuild -bb hybrid-detect-fglrx.spec --define "_sourcedir $(pwd)" --define "_rpmdir $(pwd)"
                      sudo yum install ./x86_64/hybrid-detect-fglrx-*.rpm
                      7. Reboot and enjoy graphics switching!

                      If anything goes wrong in the future (GUI not starting, etc.), try removing /var/lib/hybrid-detect/last_gfx_boot and then rebooting. That will force hybrid-detect to redetect which graphics card is enabled.

                      Please let me know if there are any issues

                      Comment


                      • #41
                        I'll test this this week!


                        I the meantime - could anyone help me out with removing fglrx first? I went roughly like this:
                        su -c 'yum remove akmod-catalyst-legacy-* xorg-x11-drv-catalyst-legacy* xorg-x11-drv-catalyst-legacy-libs'

                        sudo rm /etc/X11/xorg.conf

                        un-blacklist xorg in /etc/yum.conf (which was used to prevent xorg from updating to keep it downgraded)

                        reboot

                        su -c 'yum clean all'

                        yum reinstall mesa-libGL
                        yum reinstall mesa-*

                        yum reinstall xorg-x11-server* && yum install xorg-x11-drv-intel*


                        I also tried updating the intel driver using their official installer.



                        AMD provides a script for fglrx uninstallation (.sh). Can anyone find and upload such script for catalyst 13.1 legacy so that we could all see what it actually does?
                        http://www2.ati.com/relnotes/Catalys..._Installer.pdf

                        Comment


                        • #42
                          Awesome!

                          What you listed in correct for uninstalling fglrx, except for the first yum line. It should be:

                          Code:
                          su -c 'yum remove akmod-catalyst-legacy kmod-catalyst-legacy-* xorg-x11-drv-catalyst-legacy*'
                          Also, after you unblock the packages in /etc/yum.conf, use "yum update" instead of "yum reinstall". You don't want to reinstall the old versions

                          The AMD uninstallation script should only be used if you installed from the binary on AMD's website. It basically just manually deletes all the files instead of letting rpm handle it.

                          Comment


                          • #43
                            Code:
                            su -c 'yum remove akmod-catalyst-legacy kmod-catalyst-legacy-* xorg-x11-drv-catalyst-legacy*'
                            Password: 
                            Loaded plugins: fastestmirror, langpacks, presto, refresh-packagekit
                            No Match for argument: akmod-catalyst-legacy
                            No Match for argument: kmod-catalyst-legacy-*
                            No Match for argument: xorg-x11-drv-catalyst-legacy*
                            No Packages marked for removal
                            Also after I re-installed the said packages I also updated the whole system. Still broken graphics performance.

                            Code:
                            glxinfo | grep render
                            direct rendering: Yes
                            OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.2, 128 bits)
                                GL_NV_conditional_render, GL_NV_fog_distance, GL_NV_light_max_exponent,
                            My xorg.conf
                            http://sdrv.ms/105FY83

                            Comment


                            • #44
                              Originally posted by Bucic View Post
                              This can't be correct. Neither "device" section mentions intel or ati.
                              You're probably better of with skipping xorg.conf completely (delete it) so that it can auto configure itself and change your monitor setup with xrandr after X is started.

                              Comment


                              • #45
                                Originally posted by droste View Post
                                This can't be correct. Neither "device" section mentions intel or ati.
                                You're probably better of with skipping xorg.conf completely (delete it) so that it can auto configure itself and change your monitor setup with xrandr after X is started.
                                Xorg.conf deleted and it hasn't been re-created after reboot. Performance is slightly better but still bad. It was perfect before I installed fglrx.

                                Code:
                                glxinfo | grep render
                                direct rendering: Yes
                                OpenGL renderer string: Mesa DRI Mobile IntelŪ GM45 Express Chipset 
                                    GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp,

                                Comment

                                Working...
                                X