Update: See the next post in the series! The new Catalyst 15.7 driver no longer requires the X.org downgrade. Hooray!
Process Development Summary
Below, find the updated installation instructions for the AMD Catalyst 15.5 driver on Fedora 22 with kernel version 4.0.4-303.fc22.x86_64.
The process retains much of its content from past processes, but with the following new changes:
- The modification described by the patch stanza for kcl_acpi.c in the ultra.patch (originally from Philm of the Manjaro team, all the way back in November 2014) has made its way into fglrx 15.101, so the patch operation is no longer required! I have removed the stanza from the new ultra-2.patch version provided below.
- Fedora 22 uses X.org’s X11 Server version 1.17, whereas Fedora 21 tops out at X.org’s X11 Server version 1.16. While the new Catalyst 15.20 driver released to the Ubuntu community as a deb package supports X.org X11 Server 1.17, it is not an easy job to install it in Fedora 22. The recent general Linux release of the Catalyst 15.5 driver can be installed with the below method, and involves downgrading the X.org X11 Server in Fedora 22 to the Fedora 21 packages.
- It is a simple, reversible, and seemingly safe operation, all conducted with standard tools (dnf, primarily). I have followed the procedure for my production desktop at home and everything is stable and without observable issue. Nonetheless, we’ve had little time for testing, so the potential impact of the procedure on future software packages for Fedora 22 are not thoroughly known (if anything requires Xorg X11 Server 1.17, for example, we’d be in trouble). I did conduct a very large package upgrade operation after completing the process below and suffered no ill effects in a virtual environment, so things seem pretty good. Hopefully, AMD releases a driver compatible with X.org X11 Server 1.17 soon and we can upgrade and get on with it.
The new Fedora KDE Plasma Desktop Spin is wonderful, and I have taken the release of Fedora 22 as an opportunity to conduct a fresh OS installation. I store all of my data on a central server (nfsv4 + autofs = woot) and maintain administrative familiarity with my software, so blowing away and reinstalling the OS is no problem. Honestly, I recommend a rebuild if you’re well organized and it’s not too big of a headache. A fresh OS is nice.
Universal Package Prerequisites
Remaining yet unchanged, the general prerequisites are:
- GCC version 3.3.3 or higher.
- Kernel headers or kernel sources matching version of the kernel you’re running.
Please consult to documentation for your distribution how to get and install this.
- XFree86 version 4.1.X, 4.2.X, 4.3.X, or XOrg version 6.8.X (Fedora 20 does not use XFree86) or higher.
- Note this is the protocol version, and not the server version discussed above and below.
Heed the warning:
- If you have multiple version of X Window System installed on your computer the installer will try to detect the default X, and install the driver for the detected version. However, you could experience problems trying to run other versions of X after this. Also, if your X Window System is installed into a nonstandard location, installation of the driver could be either problematic or incomplete.
With a fully up-to-date Fedora 22 installation, perform the following command to acquire the requisite packages:
dnf install gcc kernel-headers kernel-devel
Fedora 22 Products and the Proprietary AMD Catalyst Graphics Driver
Again, as has been the case for some time, the Catalyst driver does not work with GNOME. As you may also be aware, Fedora 22 Workstation, the mainstream product designed for the purposes you’re most likely to have in mind if you’re using your system like a normal person, integrates GNOME into the OS more than previous Fedora iterations. As I have written before, changing Fedora products is no easy task, and as I wrote above, I encourage you to install the Fedora 22 KDE Plasma Desktop Spin (or any non-GNOME spin to your liking) fresh!
Installing the kde-desktop-environment With Fedora 22
If you REALLY don’t want to reinstall, you can execute
dnf group install "KDE Plasma Workspaces"
And it’ll probably work. I haven’t tested this yet (I’ll spin up a Fedora 22 Workstation VM soon), but make sure you use KDM as your Desktop Manager ’cause the GNOME Desktop Manager (GDM) breaks with the Catalyst driver, as well.. You can try following the procedure I laid out in the original post on this subject way back in March of 2014; let me know if it doesn’t work for you.
Once you’ve set yourself up with KDE and KDM in some fashion (just install the Spin), you’re in good shape to simply install the driver as described below. First, you need to downgrade Fedora 22 to the X.org X11 Server package version 1.16, so that the Catalyst driver doesn’t throw an angry segmentation fault:
Downgrading Fedora 22 KDE Plasma Desktop Spin to X.org X11 Server 1.16
1) Isolate the multi-user.target so you don’t have to worry about the X server while you work
# systemctl isolate multi-user.target
2) Add the Fedora 21 repositories from which we will obtain the older X.org X11 server 1.16 packages (it looks like a lot of people failing to get dnf downgrade to work might not be doing this)
# cd /etc/yum.repos.d/ # cp fedora.repo fedora21.repo # vim fedora21.repo :%s/\[fedora/\[fedora21/g :%s/$releasever/21/g :%s/$basearch/x86_64/g :wq # cp fedora-updates.repo fedora21-updates.repo # vim fedora21-updates.repo :%s/\[updates/\[updates21/g :%s/$releasever/21/g :%s/$basearch/x86_64/g :wq # vim fedora.repo Add "exclude=xorg-x11-server-Xorg xorg-x11-server-common" to the [fedora] stanza :wq # vim fedora-updates.repo Add "exclude=xorg-x11-server-Xorg xorg-x11-server-common" to the [updates] stanza :wq # dnf repolist (fedora21 repositories appear as expected)
3) Manually install the GPG Keys
# cd /etc/pki/rpm-gpg/ # curl https://getfedora.org/static/95A43F54.txt > ./RPM-GPG-KEY-fedora-21-primary # curl https://getfedora.org/static/A0A7BADB.txt > ./RPM-GPG-KEY-fedora-21-secondary # for LINK in `find -name RPM-GPG-KEY-fedora-22\* -type l`; do LINKMV=`echo $LINK | sed 's/22/21/g'`; if [[ $LINK =~ armhfp|i386|x86_64 ]]; then ln -s RPM-GPG-KEY-fedora-21-primary $LINKMV; else ln -s RPM-GPG-KEY-fedora-21-secondary $LINKMV; fi; done;
4) Downgrade the important packages
# dnf --allowerasing downgrade xorg-x11-server-common xorg-x11-server-Xorg
# shutdown -r now
6) Fully update your system
# dnf upgrade (The xorg-x11-server-common and xorg-x11-server-Xorg packages should not be listed for upgrade to .fc22 packages.)
If all went well, continue on. If not, let me know what’s going on and we’ll see what we can do.
1) Download the AMD Catalyst 15.5 (fglrx) driver from AMD’s site.
2) Change your working directory to your ~/Downloads directory and extract the amd-catalyst-15-5-linux-run-installers.zip file:
$ cd ~/Downloads $ unzip amd-catalyst-omega-15.5-linux-run-installers.zip
3) Extract the run archive:
$ sh amd-catalyst-omega-15.5-linux-run-installers.run --extract
Here, you’ll see a message which reads something like: “Created directory fglrx-install.wIhzk3″ and then “Verifying archive integrity… All good.” followed by a “Uncompressing AMD Catalyst(TM) Proprietary Driver-14.501.1003″ followed by a lot of dots.
4) Now, you should see a newly created folder called fglrx-install.whateveryourcomputernamedit (mine, for example, was fglrx-install.wIhzk3). Change your working directory appropriately and apply the ultra-2.patch:
$ cd fglrx-install.wIhzk3 $ mv ~/Downloads/ultra-2.patch.doc ~/Downloads/ultra-2.patch #WordPress does not permit me to upload a .patch file, so I add the .doc extension to lazily get around that restraint $ mv ~/Downloads/ultra-2.patch ./ #this is not necessary, but I do it for sanity's sake, to keep the patch file with the patched code as a reminder $ patch -p0 < ultra-2.patch
If you are successful, you will see the following output:
(Stripping trailing CRs from patch; use --binary to disable.) patching file common/lib/modules/fglrx/build_mod/firegl_public.c patching file common/lib/modules/fglrx/build_mod/kcl_str.c
If you have a unpacked .run file with previously-applied patches, you can still apply the ultra-2.patch – just address appropriately the prompts you receive during execution; when asked to reverse a patch operation, decline (it’s thinking you might want that since you’ve already applied the patch, as it can tell). If you don’t feel like messing with it at all, just remove the directory containing the previously-patched content and extract a new directory from the .run file per step 3 above.
5) As Jacob Yates points out, one must copy the version.h header file into the build directory for the current kernel version:
$ sudo cp /usr/include/linux/version.h /lib/modules/`uname -r`/build/include/linux/
6) Now that you’ve patched the installation package and copied the header file needed to build the module, run the installation:
$ sudo ./ati-installer.sh 15.101 --install
7) Choose the “Install Driver 15.101 on X.Org 6.9 or later 64-bit” option from the Setup Wizard, and then simply follow the prompts.
Ensure that you do not select “Generate Distribution Specific Driver Package (Recommended)”. This will only work if you use one of the officially supported Linux distributions listed on AMD’s site (Fedora is not included).
8) Reboot your machine and enjoy!
Properly Maintaining your Catalyst Implementation
Being a custom kernel module, you unfortunately must rebuild the Catalyst driver every time you upgrade the kernel version or, in some cases, other GPU-dependent packages (like mesa). The surefire way to tell that you need to reinstall your driver is a notice from Steam (for example) that
OpenGL GLX context is not using direct rendering, which may cause performance problems.
The solution to this issue is to uninstall your driver, reboot, reinstall it, and reboot. Don’t wait for this error to pop up after kernel upgrades, however, because you’ll probably just see a black screen and have to enter a CLI terminal to uninstall the driver.
Before every kernel upgrade:
1. Uninstall the driver
$ sudo aticonfig --uninstall
$ shutdown -r now
3. Upgrade your system
$ sudo dnf upgrade
$ shutdown -r now
5. Reinstall the driver
$ cd /driver/location/fglrx-install.wIhzk3 #Keep your patched driver files around and ready to go! $ sudo ./ati-installer.sh 15.101 --install
It’s not so bad, but it adds a little burden. I hope to design a DKMS solution which automatically handles this for you, but I haven’t gotten to it yet.
Remember, if you see this message:
Check out the post to which that link sends you for a potential resolution for your problem. You probably have an Intel CPU with an on-die Haswell GPU combined with a Radeon GPU, but let me know if you don’t, or if you encounter an issue that that post doesn’t resolve.