fglrx fails to compile with 2.6.27-2 kernel

Bug #266956 reported by Jean-Louis Dupond
34
This bug affects 3 people
Affects Status Importance Assigned to Milestone
fglrx-installer (Ubuntu)
Fix Released
Critical
Unassigned

Bug Description

Error:

Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
 * Running DKMS auto installation service for kernel 2.6.27-2-generic
 * fglrx (8.522)... fglrx (8.522): Installing module.
.......(bad exit status: 7)
  Build failed. Installation skipped.
                                                                         [fail]

When installing fglrx on newest kernel in Intrepid it fails.
This is because some methods in 2.6.27 changed

smp_call_function & on_each_cpu

Changed in fglrx-installer:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Yannis Tsop (ogiannhs) wrote :

Same problem here with 2.6.27-3

Revision history for this message
Alberto Milone (albertomilone) wrote :

Even if it worked with the new kernel it still wouldn't work because it's not compatible with Xorg's new ABI.

Revision history for this message
Stefan Hamminga (stefanhamminga) wrote :

That can be solved with pinning the xserver.

Doesn't compile here either (Intrepid AMD64, 2.6.27-3-generic)...

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fglrx-installer - 2:8.532-0ubuntu1

---------------
fglrx-installer (2:8.532-0ubuntu1) intrepid; urgency=low

  * Add debian/kernel-source-patches/fglrx_8.9_2.6.27.patch
    to allow compiling against 2.6.27. (LP: #266956)
  * debian/dkms.conf.in:
    - Use 2.6.27 patch when building against 2.6.27
  * debian/fglrx-kernel-source.install.in:
    - Install patches in kernel-source-patches.

 -- Mario Limonciello <email address hidden> Thu, 18 Sep 2008 12:08:46 -0500

Changed in fglrx-installer:
status: Confirmed → Fix Released
Revision history for this message
Olivier Blanc (olivier-blanc) wrote :

Installing the new versions gives the following errror :

Paramétrage de fglrx-kernel-source (2:8.532-0ubuntu1) ...
Adding Module to DKMS build system
Doing initial module build

Error! Patch fglrx_8.9_2.6.27.patch as specified in dkms.conf cannot be
found in /var/lib/dkms/fglrx/8.532/build/patches/.
Installing initial module

Error! Could not locate fglrx.ko for module fglrx in the DKMS tree.
You must run a dkms build for kernel 2.6.27-3-generic (i686) first.
Done.

A directory patches should have been in the source tree and it should have contained the patch itself.
Doing this modification in the source makes the build and install working properly.

Here is the directory tree modified :
# ls -R /usr/src/fglrx-8.532/
/usr/src/fglrx-8.532/:
dkms.conf drm.h drmP.h fglrx_8.9_2.6.27.patch firegl_public.c libfglrx_ip.a.GCC3 Makefile patches
drm_compat.h drm_os_linux.h drm_proc.h fglrxko_pci_ids.h firegl_public.h libfglrx_ip.a.GCC4 make.sh

/usr/src/fglrx-8.532/patches:
fglrx_8.9_2.6.27.patch

Revision history for this message
mahdi (mirzazadeh) wrote :

the fix released still does not solve the problem. after installing 2:8.532-0ubuntu2 and running
"sudo dkms build -m fglrx -v 8.532 -k 2.6.27-3-generic"
I get:

Kernel preparation unnecessary for this kernel. Skipping...
applying patch fglrx_8.9_2.6.27.patch...patching file firegl_public.c

Building module:
cleaning build area....
pushd /var/lib/dkms/fglrx/8.532/build; sh make.sh --nohints --uname_r=2.6.27-3-generic; popd....

Error! Build of fglrx.ko failed for: 2.6.27-3-generic (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/fglrx/8.532/build/ for more information.

the log files are attached

Revision history for this message
Mario Limonciello (superm1) wrote :

What locale are you in? I'm wondering if something odd is happening here....

Revision history for this message
Mario Limonciello (superm1) wrote :

particularly with seeing those characters while you were having the patch applied.

Changed in fglrx-installer:
status: Fix Released → New
Revision history for this message
mahdi (mirzazadeh) wrote :

I am in Canada. Yes, they are strange!

Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Bug 266956] [NEW] fglrx fails to compile with 2.6.27-2 kernel

Well no crazy locales for Canada, ill try to look closer at the source
for any other ideas then.

On 09/19/2008, mahdi <email address hidden> wrote:
> I am in Canada. Yes, they are strange!
>
> --
> fglrx fails to compile with 2.6.27-2 kernel
> https://bugs.launchpad.net/bugs/266956
> You received this bug notification because you are subscribed to fglrx-
> installer in ubuntu.
>

--
Sent from my mobile device

Mario Limonciello
<email address hidden>

Revision history for this message
Stefan Hamminga (stefanhamminga) wrote :

I can confirm the problem Mahdi has, running Ubuntu Intrepid x86_64 (latest updates as of 2008-09-20). My language is set as (US) English, as per default, and my location is set as Netherlands (for correct timezone & kbd).

Revision history for this message
Mario Limonciello (superm1) wrote :

Ok so I just did a test another test build on an i386 virtual machine,
and it is looking like a 64 bit issue since I had no problems building
on 32 bit

On 09/20/2008, Stefan Hamminga <email address hidden> wrote:
> I can confirm the problem Mahdi has, running Ubuntu Intrepid x86_64
> (latest updates as of 2008-09-20). My language is set as (US) English,
> as per default, and my location is set as Netherlands (for correct
> timezone & kbd).
>
> ** Attachment added: "make.sh.log"
> http://launchpadlibrarian.net/17777077/make.sh.log
>
> --
> fglrx fails to compile with 2.6.27-2 kernel
> https://bugs.launchpad.net/bugs/266956
> You received this bug notification because you are subscribed to fglrx-
> installer in ubuntu.
>

--
Sent from my mobile device

Mario Limonciello
<email address hidden>

Revision history for this message
Jean-Louis Dupond (dupondje) wrote :

http://kerneltrap.org/mailarchive/linux-kernel/2008/5/29/1968744

This is causing it ... on_each_cpu has 1 argument less in 2.6.27 ... Can't be so hard to fix ...
The 3rd argument is removed ... so just remove it in the code, and it will work !

Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Bug 266956] Re: fglrx fails to compile with 2.6.27-2 kernel

That's what the kernel patch that's included does.. It works on i386.

On Sat, Sep 20, 2008 at 15:49, Dupond Jean-Louis <email address hidden> wrote:

> http://kerneltrap.org/mailarchive/linux-kernel/2008/5/29/1968744
>
> This is causing it ... on_each_cpu has 1 argument less in 2.6.27 ... Can't
> be so hard to fix ...
> The 3rd argument is removed ... so just remove it in the code, and it will
> work !
>
> --
> fglrx fails to compile with 2.6.27-2 kernel
> https://bugs.launchpad.net/bugs/266956
> You received this bug notification because you are subscribed to fglrx-
> installer in ubuntu.
>

--
Mario Limonciello
<email address hidden>

Revision history for this message
Jean-Louis Dupond (dupondje) wrote :

It patches the smp_call_function function argument change ... but NOT the on_each_cpu argument change .. can't be so hard to fix :(

Revision history for this message
Jean-Louis Dupond (dupondje) wrote :

#if defined(__x86_64__) && defined(__SMP__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
    on_each_cpu(KCL_flush_tlb_one, &va, 1, 1);

thats why it only applies to 64bit, because on_each_cpu is never called when u compile it on a 32bit system !

#if defined(__x86_64__) && defined(__SMP__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
    on_each_cpu(KCL_flush_tlb_one, &va, 1, 1);
#elseif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
    on_each_cpu(KCL_flush_tlb_one, &va, 1);
#else
    flush_tlb_page(vma, va);
#endif

Could be a possible fix

Revision history for this message
Arceliar (littlebuzz71) wrote :

Dupond Jean-Louis is pretty much correct. I modified /var/lib/dkms/fglrx/8.532/source/firegl_public.c to look like:

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
    on_each_cpu(KCL_flush_tlb_one, &va, 1);
#elif defined(__x86_64__) && defined(__SMP__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
    on_each_cpu(KCL_flush_tlb_one, &va, 1, 1);
#else
    flush_tlb_page(vma, va);
#endif

in the relevant section and it compiles just fine. Unfortunately, when trying to start the xserver, I get the following error:

(EE) module ABI major version (0) doesn't match the server's version (1)
(EE) Failed to load module dri (module requirement mismatch, 0)
dlopen: /usr/lib/xorg/modules/drivers//fglrx_drv.so: undefined Symbol: miZeroLineScreenIndex
(EE) Failed to load /usr/lib/xorg/modules/driver//fglrx_drv.so
(EE) Failed to laod module fglrx (loader failed, 7)
(EE) No drivers available.

Or at least, that's the part that I assume is relevant. I think that this error is because Xorg 1.5 and fglrx don't agree yet. The point is, Dupond's suggestion does essentially solve the bug with with dkms failing to compile fglrx-kernel-source.

Revision history for this message
Jean-Louis Dupond (dupondje) wrote :

#if defined(__x86_64__) && defined(__SMP__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
    on_each_cpu(KCL_flush_tlb_one, &va, 1);
#elif defined(__x86_64__) && defined(__SMP__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
    on_each_cpu(KCL_flush_tlb_one, &va, 1, 1);
#else
    flush_tlb_page(vma, va);
#endif

is more correct :)

Revision history for this message
Marco Chiappero (mchiappero) wrote :

Same thing here, the module is now compiling and loading fine but X refuses to start because of the mismatch.

Revision history for this message
Stefan Hamminga (stefanhamminga) wrote :

How I got the Hardy xorg running on Intrepid:

1. Move /etc/apt/sources.list => intrepid.list & create a hardy list
mv /etc/apt/sources.list /etc/apt/sources.list.d/intrepid.list
cp /etc/apt/sources.list.d/intrepid.list /etc/apt/sources.list.d/hardy.list
Then open up your favorite editor and edit /etc/apt/sources.list.d/hardy.list to preference (I just replace every instance of 'intrepid' with 'hardy')

2. Create /etc/apt/preferences (eg. nano /etc/apt/preferences)
File should contain:
Package: xserver-xorg-core
Pin: release a=hardy
Pin-Priority: 999

3. Remove xorg* (haven't found a way to do a 100% working direct downgrade)

4. run apt-get update to fetch both hardy and intrepid package lists

5. Reinstall xorg & ubuntu-desktop

Alternatively, when doing a fresh install I'd start with a minimal server install and just add the desktop kernel & gui after setting the pin.

Revision history for this message
Stefan Hamminga (stefanhamminga) wrote :

I'm by no means a programmer, but anyhow I tried to change some stuff to get the fglrx module to compile on x86_64, in firegl_public.c:

Line 1560:
- return current->euid;
+ return current_euid();

Line 4659 & 4678 (don't know if this is sane to do):
- if (smp_call_function(KCL_setup_pat, NULL, 0, 1) != 0)
+ if (smp_call_function(KCL_setup_pat, NULL, 0) != 0)

It compiles now, but I get the message "modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol '__rcu_read_lock', so still no go...

Revision history for this message
Stefan Hamminga (stefanhamminga) wrote :

For a simple workaround I changed the license in firegl_public.c to GPL and it compiles, installs & works! Compiz et all working great with Intrepid AMD64 and the Hardy x-server.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fglrx-installer - 2:8.532-0ubuntu3

---------------
fglrx-installer (2:8.532-0ubuntu3) intrepid; urgency=low

  [ Alberto Milone (tseliot) ]
  * debian/modaliases/fglrx_supported:
    - Add "xorg-driver-fglrx" to the strings printed to
      fglrx-modules.alias.override so that Jockey can
      detect the name of the package to install (LP: #258641)

  [ Mario Limonciello ]
  * debian/kernel-source-patches/fglrx_8.9_2.6.27.patch:
    - Update to compile on x86_64 for 2.6.27 (LP: #266956)

 -- Mario Limonciello <email address hidden> Sun, 21 Sep 2008 12:29:18 -0500

Changed in fglrx-installer:
status: New → Fix Released
Revision history for this message
mahdi (mirzazadeh) wrote :

still has problems, when running dkms it says:

Kernel preparation unnecessary for this kernel. Skipping...
applying patch fglrx_8.9_2.6.27.patch...missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- /usr/src/fglrx-8.532/firegl_public.c 2008-09-18 15:21:58.000000000 +0000
|+++ firegl_public.c 2008-09-21 17:26:16.797520636 +0000
--------------------------
File to patch:

Revision history for this message
Jaakan Shorter (jaakanshorter) wrote :

I installed the driver with jockey this morning and saw this in my logs

Sep 22 08:27:37 jms1000 kernel: [22405.922057] Symbol init_mm is marked as UNUSED, however this module is using it.
Sep 22 08:27:37 jms1000 kernel: [22405.922076] This symbol will go away in the future.
Sep 22 08:27:37 jms1000 kernel: [22405.922079] Please evalute if this is the right api to use and if it really is, submit a report the linux kernel mailinglist together with submitting your code for inclusion.
Sep 22 08:27:37 jms1000 kernel: [22405.954168] [fglrx] Maximum main memory to use for locked dma buffers: 793 MBytes.
Sep 22 08:27:37 jms1000 kernel: [22405.954239] [fglrx] vendor: 1002 device: 5975 count: 1
Sep 22 08:27:37 jms1000 kernel: [22405.957764] [fglrx] ioport: bar 1, base 0x9000, size: 0x100
Sep 22 08:27:37 jms1000 kernel: [22405.958496] [fglrx] Pat entry 2 is already configured
Sep 22 08:27:37 jms1000 kernel: [22405.958498] [fglrx] PAT is enabled successfully!
Sep 22 08:27:37 jms1000 kernel: [22405.962442] [fglrx:firegl_init_module] *ERROR* firegl_stub_register failed

Revision history for this message
Jaakan Shorter (jaakanshorter) wrote :

I forgot to add.
fglrx version was "8.532-0ubuntu4"

Revision history for this message
Mario Limonciello (superm1) wrote :

This is caused by having both radeon and fglrx modules loaded at the same
time. Nonetheless, it's a different bug, i'd recommend opening a different
report if issues like that persist.

On Mon, Sep 22, 2008 at 07:35, Jaakan Shorter <email address hidden>wrote:

> I installed the driver with jockey this morning and saw this in my logs
>
> Sep 22 08:27:37 jms1000 kernel: [22405.922057] Symbol init_mm is marked as
> UNUSED, however this module is using it.
> Sep 22 08:27:37 jms1000 kernel: [22405.922076] This symbol will go away in
> the future.
> Sep 22 08:27:37 jms1000 kernel: [22405.922079] Please evalute if this is
> the right api to use and if it really is, submit a report the linux kernel
> mailinglist together with submitting your code for inclusion.
> Sep 22 08:27:37 jms1000 kernel: [22405.954168] [fglrx] Maximum main memory
> to use for locked dma buffers: 793 MBytes.
> Sep 22 08:27:37 jms1000 kernel: [22405.954239] [fglrx] vendor: 1002
> device: 5975 count: 1
> Sep 22 08:27:37 jms1000 kernel: [22405.957764] [fglrx] ioport: bar 1, base
> 0x9000, size: 0x100
> Sep 22 08:27:37 jms1000 kernel: [22405.958496] [fglrx] Pat entry 2 is
> already configured
> Sep 22 08:27:37 jms1000 kernel: [22405.958498] [fglrx] PAT is enabled
> successfully!
> Sep 22 08:27:37 jms1000 kernel: [22405.962442] [fglrx:firegl_init_module]
> *ERROR* firegl_stub_register failed
>
> --
> fglrx fails to compile with 2.6.27-2 kernel
> https://bugs.launchpad.net/bugs/266956
> You received this bug notification because you are subscribed to fglrx-
> installer in ubuntu.
>

--
Mario Limonciello
<email address hidden>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.