Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

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

  1. #11
    Join Date
    Feb 2012
    Posts
    10

    Default

    Another update of the patch for the newly released kernel 3.4-rc1. In the new kernel several header files have been cleaned-up and splitted into smaller files, so now we have to include a new header file. Again, this is only required for 32 bit kernels.

    The patch has been tested with fglrx 8.951 (Catalyst 12.3) and the 3.4-rc1 vanilla kernel (32 bit).

    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>.
    
    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 a56fff1..2858170 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"
    @@ -5799,10 +5802,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

  2. #12

    Default

    Unfortunately I get a

    Code:
    patching file firegl_public.c
    Hunk #2 FAILED at 5802.
    1 out of 2 hunks FAILED -- saving rejects to file firegl_public.c.rej
    this time.


    firegl_public.c.rej:
    Code:
    --- firegl_public.c
    +++ firegl_public.c
    @@ -5802,10 +5805,16 @@
     #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

  3. #13
    Join Date
    Feb 2012
    Posts
    10

    Default

    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

  4. #14
    Join Date
    Apr 2012
    Posts
    4

    Default

    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

  5. #15
    Join Date
    Feb 2012
    Posts
    10

    Default

    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).

  6. #16
    Join Date
    Apr 2012
    Posts
    4

    Default

    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

  7. #17
    Join Date
    Sep 2008
    Posts
    264

    Default

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

  8. #18
    Join Date
    Apr 2011
    Posts
    4

    Default

    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 at 03:23 PM.

  9. #19
    Join Date
    Oct 2007
    Posts
    1,273

    Default

    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

  10. #20
    Join Date
    Sep 2008
    Posts
    264

    Default

    Quote 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 at 05:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •