AnsweredAssumed Answered

fglrx driver and Kernel version 4.x

Question asked by rakoenig on Feb 4, 2016
Latest reply on Mar 14, 2016 by natasha

Tried to compile fglrx 15.201.1701 on Fedora 23 with Kernel 4.x. Failed dramatically, so I started to look around after extracting the files.

 

First complaint is about a missing <linux/version.h> that comes from detect_requirements.sh. The critical code section is this:

 

# in /lib/modules/<kernel-version> there is a symlink for latest kernel

# which calls "build" and points to the directory where modules were built.

if  [ "$uname_r_major" -eq 3 -a "$uname_r_minor" -gt 6 ]; then

        if [ ! -f /lib/modules/${uname_r}/build/include/generated/uapi/linux/version.h ]; then

                #system does not have the kernel build environment for kernel release > 3.7

                echo "fglrx installation requires that the system have kernel headers for 3.7 release.  /lib/modules/${uname_r}/build/include/generated/uapi/linux/version.h cannot be found on this system." >> ${LOG_FILE}

                status=1

        fi

else

        if [ ! -f /lib/modules/${uname_r}/build/include/linux/version.h ]; then

                #system does not have the kernel build environment

                echo "fglrx installation requires that the system have kernel headers.  /lib/modules/${uname_r}/build/include/linux/version.h cannot be found on this system." >> ${LOG_FILE}

                status=1

        fi

fi

 

Yeah, great. So loks at the right place for all 3.x kernels where the minor version is above 6, but it looks at the wrong place for kernel version 4.x. Easy to fix, but that doesn't help.

 

Next obstacle are moved files in the Kernel ABI. i387.h now moved to fpu/api.h and fpu-internal.h moved to fpu/internal.h. Also easy to fix with a few symlinks.

 

But after that it gets really weird. The compilation of the kernel module throws a lot of errors.

 

make -C /lib/modules/4.3.4-300.fc23.x86_64/build SUBDIRS=/usr/lib/modules/fglrx/build_mod/2.6.x modules

make[1]: Entering directory '/usr/src/kernels/4.3.4-300.fc23.x86_64'

  CC [M]  /usr/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o

/usr/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function ‘firegl_major_proc_read’:

/usr/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:626:9: error: void value not ignored as it ought to be

     len = seq_printf(m, "%d\n", major);

         ^

Bad news: seq_printf is no longer returning an int.

 

/usr/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function ‘kcl__cmpxchg’:

/usr/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:1745:12: error: implicit declaration of function ‘__fgl_cmpxchg’ [-Werror=implicit-function-declaration]

     return __fgl_cmpxchg(ptr,old,new,size);

            ^

 

looked at this in firegl_public.c. The function is declared a few lines above that call, but only if __i386__ is defined. So, on my x86_64 system we get this error.

 

More errors are in the log, but at this point I realized that its probably not my job to fix all the bugs.

 

Yes, I know that its had to maintain a driver that should fit to a wide range of kernel versions. But I have customers that want to use this driver on recent kernels and they run into the same problems that I just found.

 

So questions are:

  1. Is AMD working on a maintenance release that also supports recent kernels?
  2. If so, when can we expect a working driver for kernel versions >= 4?

 

Best regards

Rainer

Outcomes