Installing legacy AMD proprietary drivers (15.5) on newer linux kernels 3.19 4.2 4.4 the hard way

Abstract: Below I shall show you what to do if you receive the infamous ‘DKMS part of installation failed.  Please refer to /usr/share/ati/fglrx-install.log for details.’ error upon trying to achieve what the title says.

Intro: I have been using linux for many years now. To be more precise mostly Ubuntu and today Linux Mint 17.3 64 bit fully updated, with the 4.4.0-15-generic x86_64 kernel. I have an older CPU, an AMD A8-3870K APU, which has an integrated Radeon HD 6550D GPU.

The Problem: Until now, I have used the fglrx driver available from Mint’s Driver Manager (DM). During an update a newer version was installed (I don’t remember whether or not I was asked about it) and consequently Full HD video has the tendency to turn into a slideshow whenever there is a bit more movement in a scene. Therefore I have switched to the recommended open-source xserver-xorg-video-ati driver in the DM, but that didn’t make things better. As far as I can tell, the latest AMD linux driver that supports my APU is the 15.5. Installing it on a new kernel, like the 4.4 causes an X error message and I can only use the command line interface. With changing the kernel on boot to 3.13 I can get to my desktop again.

Choosing the latest driver for your APU.
Choosing the latest driver for your APU.
The latest driver for APUs with HD6000D GPUs, BUT WAIT!
The latest driver for APUs with HD6000D GPUs, BUT WAIT!

 

 

 

 

 

 

 

 

Look under the previous drivers.
Look under the previous drivers.
On the 15.5 page under desktop APUs, you find the latest llano driver.
On the 15.5 page under desktop APUs, you find the latest llano driver.

 

 

 

 

 

 

 

Catalyst showing no data on the GPU - no DKMS.
Catalyst showing no data on the GPU – no DKMS.
Mint's Driver Manager show that I am using the open-source driver.
Mint’s Driver Manager show that I am using the open-source driver.

 

 

 

 

 

 

 

The Solution: Please have a look at the following sites. They have helped me tremendously. Thanks DUDE!!!
The following ‘guide’ will be my trial and error procedure, hopefully ending in an up-to-date system with a working GPU driver.

Installing the Proprietary AMD Catalyst 15.5 (fglrx 15.101) driver on Fedora 22 with Linux Kernel 4.04

Installing the Proprietary AMD Catalyst 15.9 (fglrx 15.201) driver on Fedora 22 with Linux Kernel 4.1.6

If you still get the DKMS error, you will have to dig deeper. I assume you have already extracted the contents of the driver. Get into the following folder:
fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod
(Obviously the code after ‘fglrx-install.’ in the extracted folder’s name will be different.)
You should see a make.sh file. Go into the same folder in a terminal window (as root) and:
bash make.sh

This should start the make process and it is going to give you errors like:
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/4.4.0-15-generic/build SUBDIRS=[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-headers-4.4.0-15-generic'
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:194:22: fatal error: asm/i387.h: No such file or directory
 #include "asm/i387.h"
                      ^
compilation terminated.
make[2]: *** [[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o] Error 1
make[1]: *** [_module_[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-4.4.0-15-generic'
make: *** [kmod_build] Error 2
build failed with return value 2

The interesting part here is ‘asm/i387.h: No such file or directory’.
Google gets me to:
Installing the Proprietary AMD Catalyst 15.9 (fglrx 15.201) driver on Fedora 22 with Linux Kernel 4.1.6

then here.

I exchange the following part in the firegl_public.c file according to the patch:
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
    #include "asm/i387.h"
#else
    #include
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
    #if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
        #include
    #else
        #include
    #endif
#endif

I get the same error even though I’m not on a kernel that is below 4.2, so i just hardcode:
#include <asm/fpu/api.h>
#include <asm/fpu/internal.h>

This seems to solve the problem, but I get 5 other errors. ~30 min later (I googled the errors and patched them.):
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/4.4.0-15-generic/build SUBDIRS=[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-headers-4.4.0-15-generic'
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_agp.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_ioctl.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_io.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_pci.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_str.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_iommu.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl.o
[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c: In function ‘KCL_Request_Firmware’:
[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c:99:5: warning: passing argument 1 of ‘request_firmware’ from incompatible pointer type [enabled by default]
     if(request_firmware(&pfw, (char *)pFirmware->name, pdev) != 0)
     ^
In file included from [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c:28:0:
include/linux/firmware.h:42:5: note: expected ‘const struct firmware **’ but argument is of type ‘struct firmware **’
 int request_firmware(const struct firmware **fw, const char *name,
     ^
  CC [M]  [path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/kcl_wait.o
make[2]: *** No rule to make target `[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/libfglrx_ip.a', needed by `[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x/fglrx.o'.  Stop.
make[1]: *** [_module_[path-to-the-install-dir]/fglrx-install.PafvZj/common/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-4.4.0-15-generic'
make: *** [kmod_build] Error 2
build failed with return value 2

1 warning, 1 note and an error about libfglrx_ip.a (No rule to make target)
Don’t worry about the last one. Let1s try installing. Get back to the fglrx-install.PafvZj directory, then:
bash ati-installer.sh 15.101 --install

(15.101 is the 15.5 driver)
‘DKMS part of installation failed.  Please refer to /usr/share/ati/fglrx-install.log for details’
Now what??
Note that after getting the libfglrx_ip.a error I could install the driver on 3.19.

Second try:

(I have tried to make it more documented and more understandable here.)

The Loop: Basically try building the DKMS module on a specific kernel, look at the errors, search the internet, try to solve them, try again.

kernel: 3.13.0-85-generic x86_64

Mint's System Monitor
Mint’s System Monitor

Extract driver to working directory:
sudo bash ./amd-catalyst-omega-15.5-linux-run-installers.run --extract

Change permissions on created directory for easier access:
sudo chmod 750 -R [path-to-the-install-dir]/fglrx-install.VqGpss/
sudo chown myuser -R [path-to-the-install-dir]/fglrx-install.VqGpss/

I’m going to have 2 terminals open from now on.
PWD 1 is [path-to-the-install-dir]/fglrx-install.VqGpss/ so that I can try to run install after a modification.
PWD 2 is [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod so that I can try to run make after a modification.

PWD 2: (this is just going to mean inside the build_ mod directory) sudo bash make.sh --nohints --uname_r=3.13.0-85-generic --norootcheck
(Change kernel version as appropriate.)

Output:
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/3.13.0-85-generic/build SUBDIRS=[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-85-generic'
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_agp.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_ioctl.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_io.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_pci.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_str.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_iommu.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl.o
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c: In function ‘KCL_Request_Firmware’:
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c:99:5: warning: passing argument 1 of ‘request_firmware’ from incompatible pointer type [enabled by default]
     if(request_firmware(&pfw, (char *)pFirmware->name, pdev) != 0)
     ^
In file included from [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c:28:0:
include/linux/firmware.h:42:5: note: expected ‘const struct firmware **’ but argument is of type ‘struct firmware **’
 int request_firmware(const struct firmware **fw, const char *name,
     ^
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_wait.o
make[2]: *** No rule to make target `[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/libfglrx_ip.a', needed by `[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/fglrx.o'.  Stop.
make[1]: *** [_module_[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-85-generic'
make: *** [kmod_build] Error 2
build failed with return value 2

1 warning, 1 note, 1 libfglrx_ip.a error
All in all, should be OK.
Let’s try the install:
PWD 1: sudo bash ati-installer.sh 15.101 --install
(15.101 is the version code for the 15.5 Catalyst. Change as appropriate.)

Before doing this step, you should remove all fglrx packages completely. I use the Synaptic Package Manager.

Install completes without error.
Restart.

Driver Manager shows a custom installed driver and Catalyst shows the right driver.

 

Catalyst showing info on my GPU, successful install!
Catalyst showing info on my GPU, successful install!
Mint's Driver Manager shows manually installed driver. NICE!
Mint’s Driver Manager shows manually installed driver. NICE!

 

 

 

 

 

 

Everything is in perfect order.

Here we go again:
kernel: 3.19.0-58-generic x86_64

(I made a copy of the fglrx directory.)

PWD 2: sudo bash make.sh --nohints --uname_r=3.19.0-58-generic --norootcheck

Output:
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/3.19.0-58-generic/build SUBDIRS=[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-headers-3.19.0-58-generic'
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function ‘KCL_GetEffectiveUid’:
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:1798:5: error: incompatible types when returning type ‘kuid_t’ but ‘KCL_TYPE_Uid’ was expected
     return current_euid();
     ^
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function ‘kasSetExecutionLevel’:
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:4819:5: error: implicit declaration of function ‘__get_cpu_var’ [-Werror=implicit-function-declaration]
     orig_level = __get_cpu_var(kasExecutionLevel);
     ^
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:4820:38: error: lvalue required as left operand of assignment
     __get_cpu_var(kasExecutionLevel) = level;
                                      ^
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function ‘KCL_GetEffectiveUid’:
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:1804:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
cc1: some warnings being treated as errors
make[2]: *** [[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o] Error 1
make[1]: *** [_module_[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.19.0-58-generic'
make: *** [kmod_build] Error 2
build failed with return value 2

As you can see there are some strange errors.
Installing the Proprietary AMD Catalyst 14.12 (fglrx) Driver on Fedora 21 with Kernel 3.19

3.17 kernel patch:
--- common/lib/modules/fglrx/build_mod/kcl_acpi.c       2014-09-23 10:42:10.000000000 -0400
+++ common/lib/modules/fglrx/build_mod/kcl_acpi.c       2014-11-13 16:44:23.187112123 -0500
@@ -831,7 +831,7 @@
 
 static acpi_status KCL_ACPI_Slot_No_Hotplug(KCL_ACPI_DevHandle handle, u32 lvl, void *data, void **rv)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,7)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,7) && LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
    struct acpi_device *tdev = NULL;
    struct pci_dev *pdev = (struct pci_dev *)data;
    int device = 0;

3.19 kernel patch:
--- common/lib/modules/fglrx/build_mod/firegl_public.c    2015-03-22 14:13:36.628837777 -0400
+++ common/lib/modules/fglrx/build_mod/firegl_public.c    2015-03-22 14:14:43.678029922 -0400
@@ -4816,8 +4816,8 @@
 {
     unsigned long orig_level;
 
-    orig_level = __get_cpu_var(kasExecutionLevel);
-    __get_cpu_var(kasExecutionLevel) = level;
+    orig_level = __this_cpu_read(kasExecutionLevel);
+    __this_cpu_write(kasExecutionLevel, level);
 
     return orig_level;
 }
@@ -4829,7 +4829,7 @@
  */
 static unsigned long kas_GetExecutionLevel(void)
 {
-    return __get_cpu_var(kasExecutionLevel);
+    return __this_cpu_read(kasExecutionLevel);
 }
 
 /** \brief Type definition for kas_spin_lock() parameter */

Note that the 3.17 kernel patch seems already applied.
I applied the 3.19 kernel patch.

PWD 2: sudo bash make.sh --nohints --uname_r=3.19.0-58-generic --norootcheck

Output:
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/3.19.0-58-generic/build SUBDIRS=[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-headers-3.19.0-58-generic'
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function ‘KCL_GetEffectiveUid’:
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:1798:5: error: incompatible types when returning type ‘kuid_t’ but ‘KCL_TYPE_Uid’ was expected
     return current_euid();
     ^
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:1804:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make[2]: *** [[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o] Error 1
make[1]: *** [_module_[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.19.0-58-generic'
make: *** [kmod_build] Error 2
build failed with return value 2

The code with the error in firegl_public.c around line 1798:

/** /brief Return the effective user ID
 *  /return OS dependent value of the effective user ID
 */
KCL_TYPE_Uid ATI_API_CALL KCL_GetEffectiveUid(void)
{
#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
    return __kuid_val(current_euid());
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,00)
    return __kuid_val(current_euid());
#else
#ifdef current_euid
    return current_euid();
#else
    return current->euid;
#endif // current_euid
#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,00)
#endif // CONFIG_UIDGID_STRICT_TYPE_CHECKS
}

As you can see ‘return current_euid();’ is the problem, however this code will never be used on a kernel above 3.14, so I just exchanged the line with ‘return __kuid_val(current_euid());’ as that is what should be used for higher kernel versions. I am going to use this modified driver only for 3.19 so…

Here the rewritten function:
/** /brief Return the effective user ID
 *  /return OS dependent value of the effective user ID
 */
KCL_TYPE_Uid ATI_API_CALL KCL_GetEffectiveUid(void)
{
#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
    return __kuid_val(current_euid());
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,00)
    return __kuid_val(current_euid());
#else
#ifdef current_euid
    return __kuid_val(current_euid());
#else
    return current->euid;
#endif // current_euid
#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,00)
#endif // CONFIG_UIDGID_STRICT_TYPE_CHECKS
}

PWD 2: sudo bash make.sh --nohints --uname_r=3.19.0-58-generic --norootcheck

Output:
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/3.19.0-58-generic/build SUBDIRS=[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-headers-3.19.0-58-generic'
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.c: In function ‘KCL_ACPI_Slot_No_Hotplug’:
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.c:845:21: error: ‘struct acpi_device_flags’ has no member named ‘no_hotplug’
          tdev->flags.no_hotplug = true;
                     ^
make[2]: *** [[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o] Error 1
make[1]: *** [_module_[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.19.0-58-generic'
make: *** [kmod_build] Error 2
build failed with return value 2

The code with the error in kcl_acpi.c around line 845:
static acpi_status KCL_ACPI_Slot_No_Hotplug(KCL_ACPI_DevHandle handle, u32 lvl, void *data, void **rv)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,7) && LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
   struct acpi_device *tdev = NULL;
   struct pci_dev *pdev = (struct pci_dev *)data;
   int device = 0;

   acpi_bus_get_device(handle, &tdev);
   if(tdev != NULL)
   {
      device = (acpi_device_adr(tdev) >> 16) & 0xffff;
      if(PCI_SLOT(pdev->devfn) == device)
      {
         tdev->flags.no_hotplug = true;
      }
   }
#endif
   return 0;
}

As you can see ‘tdev->flags.no_hotplug = true;’ is the problem, however this code will never be used on a kernel above 3.17, so I just exchanged the line with ‘pci_ignore_hotplug(pdev);’ that comes from the next function from the file. I also searched for this error and found this solution and that one should just comment out the whole line…

PWD 2: sudo bash make.sh --nohints --uname_r=3.19.0-58-generic --norootcheck

Output:
AMD kernel module generator version 2.1
doing Makefile based build for kernel 2.6.x and higher
rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
make -C /lib/modules/3.19.0-58-generic/build SUBDIRS=[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x modules
make[1]: Entering directory `/usr/src/linux-headers-3.19.0-58-generic'
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_agp.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_ioctl.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_io.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_pci.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_str.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_iommu.o
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl.o
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c: In function ‘KCL_Request_Firmware’:
[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c:99:5: warning: passing argument 1 of ‘request_firmware’ from incompatible pointer type [enabled by default]
     if(request_firmware(&pfw, (char *)pFirmware->name, pdev) != 0)
     ^
In file included from [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl.c:28:0:
include/linux/firmware.h:42:5: note: expected ‘const struct firmware **’ but argument is of type ‘struct firmware **’
 int request_firmware(const struct firmware **fw, const char *name,
     ^
  CC [M]  [path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/kcl_wait.o
make[2]: *** No rule to make target `[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/libfglrx_ip.a', needed by `[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x/fglrx.o'.  Stop.
make[1]: *** [_module_[path-to-the-install-dir]/fglrx-install.VqGpss/common/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.19.0-58-generic'
make: *** [kmod_build] Error 2
build failed with return value 2

1 warning, 1 note, 1 libfglrx_ip.a error
All in all, should be OK.
Let’s try the install:
PWD 1: sudo bash ati-installer.sh 15.101 --install

DKMS part of installation failed. What did I do wrong again?
Turns out you have to comment out the ‘tdev->flags.no_hotplug = true;’ in the kcl_acpi.c. With that, the install is successful.

Restart.

Driver Manager shows a custom installed driver and Catalyst shows the right driver.
Everything is in perfect order.

Update for 4.2 follows.

 

Update 2016-08-13:
Following the 3.19 install I have wasted a couple weekends on trying the 4.2 and 4.4 kernels. Unfortunately with no success.
As I have read about the then new Ubuntu 16.04, and that because of an update of the X Server most drivers will be useless, so Canonical and AMD plan to release a new open source driver, I have decided to wait.
About a week ago I have read some articles about this issue and it turns out, that this new driver will not support my old Llano APU.
Basically I have the following choices:

Stay with the working 3.19 kernel and 15.5 driver on a Ubuntu 14.04 system.
Hack the 4.4 kernel with the 15.5 driver and use those on a Ubuntu 14.04 system.
Buy a direct GPU, that is supported and update everything as soon as the new driver is ready.

Update 2017-09-15:
After waiting for a year, I have tried the new linux mint 18.2. Turns out the new graphics stack found in ubuntu 16.04, on which this mint version is based on, with libdrm and mesa (?) is working on my llano GPU, providing among other things WebGL acceleration.
I am very thankful to AMD, who has helped the open source community with these new linux drivers.
Also, as my machine is from 2012, it would probably be a good idea to update…

Leave a Reply

Your email address will not be published. Required fields are marked *