• ATI driver with atiupgrade (by please_try_again)

    Let's start with the actual code. See the latest info here
    http://forums.opensuse.org/english/o...ml#post2421309

    The above link will be used to provide a link to the very latest info on the use of Atiupgrade. Please use the rest of this as a reference guide

    Now a Reference Guide:


    atiupgrade is a bash script that builds, packages and installs the ATI proprietary driver (Catalyst). It can do more than its name implies, specifically:

    • replace the opensource driver (radeon/radeonhd) on a fresh openSUSE install
    • replace an older ATI driver installed from the ATI repo
    • upgrade - or even downgrade - a previously installed ATI driver installed with the ati run file (but not packaged)
    • upgrade or downgrade from a package created with atiupgrade.

    More precisely, atiupgrade doesn't package the driver itself but just passes specific parameters to the ati run file to instruct it to create a package for openSUSE.

    Installing atiupgrade

    You can install atiupgrade several ways.

    • from my repo for the latest version of openSUSE by typing the following commands in a terminal or in the console:
    • (Older versions will require you edit the repo info accordingly)

      Code:
      su -l
      zypper ar http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_12.2/ PTA
      zypper refresh -r PTA
      zypper in atiupgrade



    • by downloading the script from this page, saving in an appropriate place (such as /usr/bin or /usr/local/bin) and making it executable:

      Code:
      su -l
      cd /usr/bin
      wget http://www.unixversal.com/linux/openSUSE/atiupgrade
      chmod 755 atiupgrade
    • or by copying/pasting the code posted here into a file and making this file executable as in the example just above.


    The way you install it doesn't matter. It is just a single script. Installing from the repo is easier, especially in situations where X cannot be started and you have to work in the console, and it ensures that the script is executable and installed in the right place.


    Using atiupgrade

    To use atiupgrade once properly installed, just type:

    Code:
    atiupgrade
    It must be executed as root, so if you are not already logged in as root, you would have to type:

    Code:
    su -l 
    atiupgrade
    Running atiupgrade inside or outside of X.

    If another ATI proprietary driver is not already installed - and thus the fglrx module is not loaded - you can run atiupgrade in xterm (or any terminal in a X session), and it should normally complete all the steps. Be warned that X might crash if you do not reboot immediately: Do not just log out! I don't like this approach very much. There is no point in installing a graphic driver in X when you can do it in console - but that's just my opinion. However, you might not have the choice if you don't have a network connection in console - like if you are using the networkmanager. In this case, atiupgrade will build and create the package but not install it, and you will have to run the script again after rebooting in runlevel 3. At that point it will no longer need a network connection. It remembers where it saved the package the first time and installs it.


    What does atiupgrade do?

    atiupgrade is divided in 10 steps.
    • steps 0-5 can be performed in X.
    • steps 6-9 must be performed in console if you are upgrading/downgrading a running fglrx driver, but can be performed in X when you install fglrx for the first time.


    Notice that fglrx refers to the kernel module while Catalyst refers to the ATI product. The name of the rpm package built by the ati installer is in the form fglrx64_xpic_SUSE114-8.861-1.x86_64

    • (0) creates a directory /usr/share/atiupgrade to download the installer and later store the rpm package.
    • (1) checks the model of your ATI card
      If you don't have an ATI graphics card or the model of your graphics card cannot be determined or is not supported, atiupgrade will issue a warning suggesting to cancel. You can build and package the driver on a non ATI machine if you wish and cancel the script when prompted to install, as it doesn't make much sense to install the ATI driver on a non ATI machine. Be aware though that even if you create the package in advance to install it on another machine, you will still have to install the kernel sources on the system where you install the driver, since the kernel module is compiled when you install the package, not when you build it.
    • (2) gets the version number of the latest available Catlayst from ATI download page.
      The latest Catalyst version will be read from the page http://support.amd.com/us/gpudownload/linux/Pages/radeon_linux.aspx. If this page changes, can not be read, or the version number can not be found for any reason, atiupgrade will switch back to the version specified in the variable catalystDef at the top of the script. You can modify this value by editing the script for future versions. Finally, you can explicitly specify the version of Catalyst to install as a command line argument to atiupgrade. It will overwrite both the latest version available on the ATI site and the default version set in catalystDef. That way you could also downgrade the driver (although I never did it, so it should be considered as untested).
    • (3) installs kernel sources and compiler
      atiupgrade will install all the packages needed to compile the driver. This include gcc, make and the kernel sources. If these are already installed, it won't install them again. However it might take a couple seconds to check if they are present. So just be patient at this point. If these packages are going to be installed, the output in the terminal will be a bit longer. Previous versions of atiupgrade used to install the devel_basis pattern. I finally realized that it is of little use to most people, so now it only installs the gcc compiler and the make utility.
    • (4) downloads the latest version of ATI Catalyst installer or the version specified in catalystDef or in the command line (as desctibed in (2)).
      If you specify the version to be installed in an argument, you should use an hyphen in the version number, not a dot! 11-4, 11-5, 11-6 are valid arguments.
    • (5) creates fglrx rpm package.
    • (6) checks if the fglrx module is loaded (and unloads it if it is)
    • (7) uninstalls the current Catalyst driver which was installed either
      • from earlier rpm package (fglrx-xxxx.rpm)
      • from repo (x11-video-fglrxG02 )
      • from the ATI run file (with /usr/share/ati/fglrx-unistall.sh)

      although I haven't tested the last case.
    • (8) installs the fglrx package stored in /usr/share/atiupgrade.
      If there are several packages (from different versions), it should pick the right one ... unless they have all been created on the same day, which is unlikely to happen. If, for some reason, you're going to run atiupgrade twice within the same 24 hours to build two different versions of the ATI driver, you should previously remove the fglrx rpm package from the /usr/share/atiupgrade directory.
    • (9) Checks if a flgrx driver section is needed in /etc/X11/xorg.conf, and if so, creates one by running:

      Code:
      /usr/bin/aticonfig --initial
      or - in case two monitors have been detected - by running:

      Code:
      /usr/bin/aticonfig --initial=dual-head
      although it is not guaranteed that a basic dual-head configuration will do what you're expecting.


    Notice: The kernel module has to be recompiled every time after a kernel update. It used to be a problem resulting in many black screens in the past. Fortunately the package now installs a service which recompiles the module when the kernel has been updated. (Make sure to update the kernel sources as well!)


    Why does atiupgrade deinstall/reinstall flgrx instead of just updating it?

    Because the package is created by the ATI installer, not by atiupgrade and so the name might change. It was necessary to install the package on openSUSE 11.4, as the release was newer than the driver and the ATI installer could not create a package for 11.4 - so atiupgrade let it believe it was 11.3. This is the purpose of the variable LastSupportedSUSE in the script (which is currently 12.1).

    Screenshots:

    atiupgrade - screenshots Examples

    • installing Catalyst 11.5 on a fresh openSUSE install

      • There is no fglrx module loaded,
      • All steps can be performed in X.
      • After the script has completed, reboot immediately. (Do not log out!)
    • updating to Catalyst 11.6
      steps 0-5 (in X)


      steps 6-9 (in console after rebooting in runlevel 3)



    Original Forum Links:
    Comments 11 Comments
    1. jdmcdaniel3's Avatar
      jdmcdaniel3 -
      This is a super fantastic effort please_try_again. Thanks so much for putting this guide together for us to use here in the openSUSE forums! Thank You,
    1. Alexander_Naumov's Avatar
      Alexander_Naumov -
      Thanks a lot!
    1. deano_ferrari's Avatar
      deano_ferrari -
      Nice work! This will simplify the effort involved for new users to switch over to the proprietary ATI driver or upgrade when the need arises.
    1. aikaimmortal's Avatar
      aikaimmortal -
      Worked like a charm. Thanks so much for writing this script! Really streamlines everything!
    1. mahanand's Avatar
      mahanand -
      Hi there,
      Tried atiupgrade, and got the following messages and I don't know what to do now !!!
      Can you help ?
      Thanks
      Patrick

      (in red the translation from french to english)
      (1) - Analyzing system...
      ATI graphic card detection failed. Is your ATI card a HD Radeon >= 5000 [yn] y
      * Found ATI graphics card: HD > 5000x
      /usr/bin/atiupgrade: ligne 356 : [: amddriver-installer-catalyst-12.10-x86.x86_64.zip : nombre entier attendu comme expression (integer expected as an expression)
      /usr/bin/atiupgrade: ligne 370 : [: trop d'arguments
      (2) - Getting latest (or specified) Catalyst version: amd.driver-installer-catalyst-12-10-x86.x86_64.zipamd-driver-installer-catalyst-12.11-beta-x86.x86_64.zip/usr/bin/atiupgrade: ligne397: amddriver-installer-catalyst-12-10-x86.x86_64.zip amd-driver-installer-catalyst-12.11-beta-x86.x86_64.zip*1 : erreur de syntaxe : opérateur arithmétique non valable syntax error arithmetic operator non valid(le symbole erroné est the wrong symbol is".x86_64.zip amd-driver-installer-catalyst-12.11-beta-x86.x86_64.zip*1")
    1. MarcoMeswara's Avatar
      MarcoMeswara -
      try executing ./atiupgrade instead of just atiupgrade

      Quote Originally Posted by mahanand View Post
      Hi there,
      Tried atiupgrade, and got the following messages and I don't know what to do now !!!
      Can you help ?
      Thanks
      Patrick

      (in red the translation from french to english)
      (1) - Analyzing system...
      ATI graphic card detection failed. Is your ATI card a HD Radeon >= 5000 [yn] y
      * Found ATI graphics card: HD > 5000x
      /usr/bin/atiupgrade: ligne 356 : [: amddriver-installer-catalyst-12.10-x86.x86_64.zip : nombre entier attendu comme expression (integer expected as an expression)
      /usr/bin/atiupgrade: ligne 370 : [: trop d'arguments
      (2) - Getting latest (or specified) Catalyst version: amd.driver-installer-catalyst-12-10-x86.x86_64.zipamd-driver-installer-catalyst-12.11-beta-x86.x86_64.zip/usr/bin/atiupgrade: ligne397: amddriver-installer-catalyst-12-10-x86.x86_64.zip amd-driver-installer-catalyst-12.11-beta-x86.x86_64.zip*1 : erreur de syntaxe : opérateur arithmétique non valable syntax error arithmetic operator non valid(le symbole erroné est the wrong symbol is".x86_64.zip amd-driver-installer-catalyst-12.11-beta-x86.x86_64.zip*1")
    1. foki's Avatar
      foki -
      I installed Catalyst yesterday by one-click install from https://lizards.opensuse.org/2012/07...x-legacy-news/ and something was wrong, when I rebooted system refused to load. Now I can't start system normally but only in recovery mode.
      I have HP ProBook 4530s with hybrid graphics (intel and ati hd6490m).
      From recovery mode I just tried to run your script but this is autput :
      Code:
      linux-6z4k:~ # atiupgrade
       (1) - Analyzing system...
           * Found ATI graphics card: HD 7400M
           * Found fglrx: 9.002
       (2) - Getting latest (or specified) Catalyst version: 12.10
       (3) - Installing required packages...
           * Kernel source matches installed kernel (3.4.11-2.16)
      Failed to mount cd:///?devices=/dev/disk/by-id/ata-hp_DVD-RAM_UJ8B1_SKB2406334,/dev/sr0 on /var/adm/mount/AP_0x0OCUH6: Mounting media failed (mount: no medium found on /dev/sr0)
      Where is the problem?
    1. deano_ferrari's Avatar
      deano_ferrari -
      Quote Originally Posted by foki View Post
      I installed Catalyst yesterday by one-click install from https://lizards.opensuse.org/2012/07...x-legacy-news/ and something was wrong, when I rebooted system refused to load. Now I can't start system normally but only in recovery mode.
      I have HP ProBook 4530s with hybrid graphics (intel and ati hd6490m).
      From recovery mode I just tried to run your script but this is autput :
      Code:
      linux-6z4k:~ # atiupgrade
       (1) - Analyzing system...
           * Found ATI graphics card: HD 7400M
           * Found fglrx: 9.002
       (2) - Getting latest (or specified) Catalyst version: 12.10
       (3) - Installing required packages...
           * Kernel source matches installed kernel (3.4.11-2.16)
      Failed to mount cd:///?devices=/dev/disk/by-id/ata-hp_DVD-RAM_UJ8B1_SKB2406334,/dev/sr0 on /var/adm/mount/AP_0x0OCUH6: Mounting media failed (mount: no medium found on /dev/sr0)
      Where is the problem?
      It appears that you still have your installation DVD repo enabled. From a terminal, become root with
      Code:
      su -
      Enter root password when prompted, then enter
      Code:
      zypper lr -d
      Disable it (assuming it is repo #1)
      Code:
      zypper mr --disable 1
      or remove it with
      Code:
      zypper rr 1
      *Be careful to select the right repo before entering these commands.
    1. foki's Avatar
      foki -
      Quote Originally Posted by deano_ferrari View Post
      It appears that you still have your installation DVD repo enabled. From a terminal, become root with
      Code:
      su -
      Enter root password when prompted, then enter
      Code:
      zypper lr -d
      Disable it (assuming it is repo #1)
      Code:
      zypper mr --disable 1
      or remove it with
      Code:
      zypper rr 1
      *Be careful to select the right repo before entering these commands.
      Works just as I wanted.
      Thanks!
    1. LuisC-SM's Avatar
      LuisC-SM -
      Hi.
      Is Atiupgrade working with OS 13.1?
      Thanks in advance
      Luis
    1. mahanand's Avatar
      mahanand -
      Quote Originally Posted by LuisC-SM View Post
      Hi.
      Is Atiupgrade working with OS 13.1?
      Thanks in advance
      Luis
      Hi,
      Well I don't know as I haven't installed opensuse 13.1 yet. I suppose it should be working.