Announcement

Collapse
No announcement yet.

Patch to compile fgrlx module on Linux 3.3.rc4 with x86 32 bit arch

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

  • Patch to compile fgrlx module on Linux 3.3.rc4 with x86 32 bit arch

    Hi all,
    due to this commit:

    https://github.com/torvalds/linux/co...949a703977a7f3

    the fgrlx module fails to compile on kernel 3.3-rc4 with the 32-bit x86 architecture, with this error:

    Code:
    DKMS make.log for fglrx-8.930 for kernel 3.3.0-rc4-extra-drivers (i686)
    mar 21 feb 2012, 14.36.00, CET
    AMD kernel module generator version 2.1
    [: 393: 1: unexpected operator
    [: 399: 1: unexpected operator
    doing Makefile based build for kernel 2.6.x and higher
    rm -rf *.c *.h *.o *.ko *.a .??* *.symvers
    make -C /lib/modules/3.3.0-rc4-extra-drivers/build SUBDIRS=/var/lib/dkms/fglrx/8.930/build/2.6.x modules
    make[1]: ingresso nella directory "/home/jena/experimental-kernel/linux-3.3-rc4"
      CC [M]  /var/lib/dkms/fglrx/8.930/build/2.6.x/firegl_public.o
    In file included from /var/lib/dkms/fglrx/8.930/build/2.6.x/firegl_public.c:192:0:
    /var/lib/dkms/fglrx/8.930/build/2.6.x/kcl_debug.h:202:5: warning: "_DEBUG" is not defined [-Wundef]
    /var/lib/dkms/fglrx/8.930/build/2.6.x/firegl_public.c: In function ?KCL_fpu_begin?:
    /var/lib/dkms/fglrx/8.930/build/2.6.x/firegl_public.c:5802:28: error: ?TS_USEDFPU? undeclared (first use in this function)
    /var/lib/dkms/fglrx/8.930/build/2.6.x/firegl_public.c:5802:28: note: each undeclared identifier is reported only once for each function it appears in
    /var/lib/dkms/fglrx/8.930/build/2.6.x/firegl_public.c: At top level:
    /var/lib/dkms/fglrx/8.930/build/2.6.x/kcl_debug.h:162:16: warning: ?module_log_map? defined but not used [-Wunused-variable]
    /var/lib/dkms/fglrx/8.930/build/2.6.x/kcl_debug.h:175:19: warning: ?module_type_map? defined but not used [-Wunused-variable]
    make[2]: *** [/var/lib/dkms/fglrx/8.930/build/2.6.x/firegl_public.o] Errore 1
    make[1]: *** [_module_/var/lib/dkms/fglrx/8.930/build/2.6.x] Errore 2
    make[1]: uscita dalla directory "/home/jena/experimental-kernel/linux-3.3-rc4"
    make: *** [kmod_build] Errore 2
    build failed with return value 2
    This patch fixes the problem:

    Code:
    fixed fgrlx compilation error on 32-bit x86 arch with kernel 3.3-rc4 due to commit:
    https://github.com/torvalds/linux/commit/f94edacf998516ac9d849f7bc6949a703977a7f3
    
    Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
    ---
     firegl_public.c |    9 +++++++++
     1 files changed, 9 insertions(+), 0 deletions(-)
    
    diff --git a/firegl_public.c b/firegl_public.c
    index 6e0aa82..5010b91 100644
    --- a/firegl_public.c
    +++ b/firegl_public.c
    @@ -5797,6 +5797,14 @@ void ATI_API_CALL KCL_fpu_begin(void)
     #ifdef CONFIG_X86_64
         kernel_fpu_begin();
     #else
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
    +    struct task_struct *tsk = current;
    +    preempt_disable();
    +    if (tsk->thread.has_fpu)
    +        __save_init_fpu(tsk);
    +    else
    +        clts();
    +#else
         struct thread_info *cur_task = current_thread_info();
         preempt_disable();
         if (cur_task->status & TS_USEDFPU)
    @@ -5804,6 +5812,7 @@ void ATI_API_CALL KCL_fpu_begin(void)
         else
             clts();
     #endif
    +#endif
     }
     
     /** \brief End of using FPU
    -- 
    1.7.5.4
    Regards,
    Gennar1

  • adder
    replied
    Thanks it guys worked now. I was actually extracting the debs installing them and applying the patch in the /usr/src/fglrx-8.961 dir and then installing the debs again over them top.

    Thanks to link from DanL it worked.

    Leave a comment:


  • Detructor
    replied
    Originally posted by adder View Post
    Is there a patch for this it's in Ubuntu 12.04 and am trying catalist 12.4, fglrx 8.961.

    Any help appreacted.

    I've tried all the above patches and none of them work.
    what does
    Code:
    cat /var/lib/dkms/fglrx/8.961/build/make.log
    give you?

    I used the patch provided in this post -> http://phoronix.com/forums/showthrea...809#post257809 and I'm on Ubuntu 12.04

    also check if the package build-essential is installed (it's a meta package that'll install everything that you need to build the driver package (and every other program you build by 'make && make install')
    Last edited by Detructor; 04-30-2012, 05:05 PM.

    Leave a comment:


  • DanL
    replied
    I found that the patch in comment #3 works for Precise if you change KERNEL_VERSION(3,2,8) to KERNEL_VERSION(3,2,0). Exact instructions are here: http://ubuntuforums.org/showthread.php?t=1969827

    Leave a comment:


  • adder
    replied
    Is there a patch for this it's in Ubuntu 12.04 and am trying catalist 12.4, fglrx 8.961.

    Any help appreacted.

    Code:
    Building for architecture i686
    Building initial module for 3.2.0-23-generic-pae
    Error! Bad return status for module build on kernel: 3.2.0-23-generic-pae (i686)
    Consult /var/lib/dkms/fglrx/8.961/build/make.log for more information.
    update-initramfs: deferring update (trigger activated)
    Processing triggers for ureadahead ...
    Processing triggers for bamfdaemon ...
    Rebuilding /usr/share/applications/bamf.index...
    Setting up fglrx-amdcccle (2:8.961-0ubuntu1) ...
    Setting up fglrx-dev (2:8.961-0ubuntu1) ...
    Processing triggers for initramfs-tools ...
    update-initramfs: Generating /boot/initrd.img-3.2.0-23-generic-pae
    Processing triggers for libc-bin ...
    I've tried all the above patches and none of them work.
    Last edited by adder; 04-28-2012, 03:23 PM.

    Leave a comment:


  • Detructor
    replied
    just for the record: the provided patch (last one/newest one) works with fglrx 8.961/kernel 3.2.0.24 just fine.

    Leave a comment:


  • DjDiabolik
    replied
    Gennar... you are italian true ??

    Can you help me, by PM, in italian language ??

    I have contacted you by mail last night... (djdiabolik_at_libero.it)

    If you can guide me step-to-step it's better

    Leave a comment:


  • Gennar1
    replied
    Your installation is apparently messed-up. You should remove any catalyst/fglrx package, and start from scratch.

    I've never used the distribution packages. I usually download the AMD installer and create the deb packages for my Ubuntu 11.10 oneiric:

    Code:
    sudo sh amd-driver-installer-12-3-x86.x86_64.run --buildpkg Ubuntu/oneiric
    Install the .deb packaegs (it will fail to build the modules), then apply the patch and reinstall the kernel module with:

    Code:
    sudo dkms install -m fglrx -v 8.951
    If you have multiple kernels installed, you can specify the "-k kernel-version" option to build the module for a specific kernel version ("kernel-version" is what you get from "uname -r" when you run that kernel).

    Leave a comment:


  • DjDiabolik
    replied
    I have apply this patch.. and after i have try to reinstall the .deb of catalyst 12.3.... i obtain this:
    Code:
    diabolik@Diabolik-ubuntu:~/catalyst12.3$ sudo dpkg -i fgl*.deb
    (Lettura del database... 323026 file e directory attualmente installati.)
    Preparativi per sostituire fglrx v.2:8.951-0ubuntu1 (utilizzando fglrx_8.951-0ubuntu1_i386.deb)...
    Removing all DKMS Modules
    Done.
    Estrazione del sostituto di fglrx...
    Preparativi per sostituire fglrx-amdcccle v.2:8.951-0ubuntu1 (utilizzando fglrx-amdcccle_8.951-0ubuntu1_i386.deb)...
    Estrazione del sostituto di fglrx-amdcccle...
    Preparativi per sostituire fglrx-dev v.2:8.951-0ubuntu1 (utilizzando fglrx-dev_8.951-0ubuntu1_i386.deb)...
    Estrazione del sostituto di fglrx-dev...
    Configurazione di fglrx (2:8.951-0ubuntu1)...
    update-alternatives: attenzione: viene forzata l'installazione dell'alternativa /usr/lib/fglrx/ld.so.conf poich? il gruppo i386-linux-gnu_gl_conf ? danneggiato.
    update-alternatives: attenzione: saltata la creazione di /etc/OpenCL/vendors/amdocl64.icd poich? il file /usr/lib/fglrx/etc/OpenCL/vendors/amdocl64.icd associato (del gruppo i386-linux-gnu_gl_conf) non esiste.
    update-alternatives: attenzione: saltata la creazione di /usr/lib32/libaticalcl.so poich? il file /usr/lib32/fglrx/libaticalcl.so associato (del gruppo i386-linux-gnu_gl_conf) non esiste.
    update-alternatives: attenzione: saltata la creazione di /usr/lib32/libaticalrt.so poich? il file /usr/lib32/fglrx/libaticalrt.so associato (del gruppo i386-linux-gnu_gl_conf) non esiste.
    update-alternatives: attenzione: viene forzata l'installazione dell'alternativa /usr/lib/fglrx/ld.so.conf poich? il gruppo i386-linux-gnu_gl_conf ? danneggiato.
    update-alternatives: attenzione: saltata la creazione di /etc/OpenCL/vendors/amdocl64.icd poich? il file /usr/lib/fglrx/etc/OpenCL/vendors/amdocl64.icd associato (del gruppo i386-linux-gnu_gl_conf) non esiste.
    update-alternatives: attenzione: saltata la creazione di /usr/lib32/libaticalcl.so poich? il file /usr/lib32/fglrx/libaticalcl.so associato (del gruppo i386-linux-gnu_gl_conf) non esiste.
    update-alternatives: attenzione: saltata la creazione di /usr/lib32/libaticalrt.so poich? il file /usr/lib32/fglrx/libaticalrt.so associato (del gruppo i386-linux-gnu_gl_conf) non esiste.
    update-initramfs: deferring update (trigger activated)
    update-initramfs: Generating /boot/initrd.img-3.3.1-030301-generic-pae
    Loading new fglrx-8.951 DKMS files...
    Building only for 3.3.1-030301-generic-pae
    Building for architecture i686
    Building initial module for 3.3.1-030301-generic-pae
    Error! Bad return status for module build on kernel: 3.3.1-030301-generic-pae (i686)
    Consult /var/lib/dkms/fglrx/8.951/build/make.log for more information.
    update-initramfs: deferring update (trigger activated)
    Elaborazione dei trigger per ureadahead...
    Elaborazione dei trigger per gnome-menus...
    Elaborazione dei trigger per bamfdaemon...
    Rebuilding /usr/share/applications/bamf.index...
    Configurazione di fglrx-amdcccle (2:8.951-0ubuntu1)...
    Configurazione di fglrx-dev (2:8.951-0ubuntu1)...
    Elaborazione dei trigger per initramfs-tools...
    update-initramfs: Generating /boot/initrd.img-3.3.1-030301-generic-pae
    Elaborazione dei trigger per libc-bin...
    ldconfig deferred processing now taking place
    diabolik@Diabolik-ubuntu:~/catalyst12.3$
    What's the all error of file not found ?
    You thinks now the driver it's correctly installed ?? i thinks no

    Leave a comment:


  • Gennar1
    replied
    Strange. Maybe a copy&paste problem?

    Anyway, here is another version of the patch, required to build the fglrx module against kernel 3.4-rc2.
    This time, cpu_possible_map has been dropped in favor of cpu_possible_mask.
    Probably, this trivial change is necessary also for 64 bit kernels, but I have not tested it.

    Anyway, this is the new patch:

    Code:
    fixed fgrlx compilation error on 32-bit x86 arch with kernel 3.3-rc4 due to commit:
    https://github.com/torvalds/linux/commit/f94edacf998516ac9d849f7bc6949a703977a7f3
    later modified (in 3.3-rc5) by commit:
    https://github.com/torvalds/linux/commit/7e16838d94b566a17b65231073d179bc04d590c8#diff-1
    and finally backported to kernel 3.2.8.
    
    This new version adds support for the 3.4 kernels, where some ASM header
    file was splitted into several smaller files, so we have to explicitally
    include the new file <asm/fpu-internal.h>.
    
    Since 3.4-rc2, cpu_possible_map has been definitely removed. Let's use
    cpu_possible_mask instead. This is probably required also for 64 bit kernels.
    
    Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
    ---
     firegl_public.c |   13 +++++++++++++
     1 files changed, 13 insertions(+), 0 deletions(-)
    
    diff --git a/firegl_public.c b/firegl_public.c
    index a56fff1..b4bdfb7 100644
    --- a/firegl_public.c
    +++ b/firegl_public.c
    @@ -187,6 +187,9 @@
     #include <linux/gfp.h>
     #include <linux/swap.h>
     #include "asm/i387.h"
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
    +#include <asm/fpu-internal.h>
    +#endif
     
     #include "firegl_public.h"
     #include "kcl_osconfig.h"
    @@ -4181,7 +4184,11 @@ static int kasInitExecutionLevels(unsigned long level_init)
     {
         unsigned int p;
         KCL_DEBUG5(FN_FIREGL_KAS, "%d\n", level_init);
    +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
    +    for_each_cpu_mask(p, cpu_possible_mask)
    +#else
         for_each_cpu_mask(p, cpu_possible_map)
    +#endif
         {
             KCL_DEBUG1(FN_FIREGL_KAS,"Setting initial execution level for CPU # %d\n", p);
             preempt_disable();
    @@ -5799,10 +5806,16 @@ void ATI_API_CALL KCL_fpu_begin(void)
     #ifdef CONFIG_X86_64
         kernel_fpu_begin();
     #else
    +#ifndef TS_USEDFPU
    +    preempt_disable();
    +    if (__thread_has_fpu(current))
    +        __save_init_fpu(current);
    +#else
         struct thread_info *cur_task = current_thread_info();
         preempt_disable();
         if (cur_task->status & TS_USEDFPU)
             __save_init_fpu(cur_task->task);
    +#endif
         else
             clts();
     #endif
    -- 
    1.7.5.4

    Leave a comment:

Working...
X