fglrx driver does not work in RT kernel

Bug #159941 reported by Ben Aceler on 2007-11-04
26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Studio
High
Unassigned
fglrx-installer (Ubuntu)
High
Alessio Igor Bogani
Nominated for Intrepid by Francesco Pretto
Nominated for Jaunty by Francesco Pretto

Bug Description

Trying to install fglrx driver from Ati.com (latest - 8.42) into RT kernel (realtime version from Ubuntu Studio). fglrx.ko compiling without errors, but when I intall it, it said that it cannot be merget into kernel, because it uses a GPL symbol in non-GPL module.

For standard kernel, fglrx (compiled separately) works fine.

Ben Aceler (aceler) wrote :

The exact error information is:

root@aceler-desktop:/usr/src/fglrx/modules/fglrx# ./make.sh
ATI module generator V 2.0
==========================
initializing...
kernel includes at /usr/src/linux/include not found or incomplete
file: /usr/src/linux/include/linux/version.h
root@aceler-desktop:/usr/src/fglrx/modules/fglrx# root@aceler-desktop:/usr/src/fglrx/modules/fglrx# ./make.sh
ATI module generator V 2.0
==========================
initializing...
cleaning...
patching 'highmem.h'...
assuming new VMA API since we do have kernel 2.6.x...
 Assuming default VMAP API
 Assuming default munmap API
doing Makefile based build for kernel 2.6.x and higher
./make.sh: line 937: cd: 2.6.x: No such file or directory
make -C /lib/modules/2.6.22-14-rt/build SUBDIRS=/usr/src/fglrx/modules/fglrx modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.22-14-rt'
  CC [M] /usr/src/fglrx/modules/fglrx/firegl_public.o
/usr/src/fglrx/modules/fglrx/firegl_public.c:365: warning: initialization from incompatible pointer type
/usr/src/fglrx/modules/fglrx/firegl_public.c:366: warning: initialization from incompatible pointer type
/usr/src/fglrx/modules/fglrx/firegl_public.c: In function ‘fglrx_pci_suspend’:
/usr/src/fglrx/modules/fglrx/firegl_public.c:799: warning: passing argument 1 of ‘firegl_pci_save_state’ from incompatible pointer type
/usr/src/fglrx/modules/fglrx/firegl_public.c: In function ‘fglrx_pci_resume’:
/usr/src/fglrx/modules/fglrx/firegl_public.c:841: warning: passing argument 1 of ‘firegl_pci_restore_state’ from incompatible pointer type
/usr/src/fglrx/modules/fglrx/firegl_public.c: In function ‘__ke_pci_find_device’:
/usr/src/fglrx/modules/fglrx/firegl_public.c:2019: warning: ‘pci_find_device’ is deprecated (declared at include/linux/pci.h:477)
/usr/src/fglrx/modules/fglrx/firegl_public.c: In function ‘__ke_request_irq’:
/usr/src/fglrx/modules/fglrx/firegl_public.c:2962: warning: ‘deprecated_irq_flag’ is deprecated (declared at include/linux/interrupt.h:68)
/usr/src/fglrx/modules/fglrx/firegl_public.c:2962: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
/usr/src/fglrx/modules/fglrx/firegl_public.c: At top level:
/usr/src/fglrx/modules/fglrx/firegl_public.c:5439: warning: ‘kmem_cache_t’ is deprecated
  LD [M] /usr/src/fglrx/modules/fglrx/fglrx.o
  Building modules, stage 2.
  MODPOST 1 modules
FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol '__rcu_read_lock'
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.22-14-rt'
make: *** [kmod_build] Error 2
build failed with return value 2

Ben Aceler (aceler) wrote :

As a workaround, I compiled a new RT kernel without paravirtualization support.

Daedalus (osd-daedalus) wrote :

Yes, I can confirm with fglrx 8.493.1 and kernel 2.6.18-rt.

Daedalus (osd-daedalus) wrote :

sorry, 2.6.24-18-rt I mean :)
Hope this will be fixed soon...

yeeking (lists-yeeking) wrote :

Having a related problem with the fglrx driver un 8.10 64bit. To reproduce:

sudo aptitude install linux-rt
(error... missing source code for fglrx build )
 sudo aptitude install linux-headers-2.6.27-3-rt

Then:

Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms
 * Running DKMS auto installation service for kernel 2.6.27-3-rt
 * fglrx (8.543)... fglrx (8.543): Installing module.
........(bad exit status: 7)
  Build failed. Installation skipped.

Francesco Pretto (ceztko) wrote :

Confirmed.

WARNING: The following workaround doesn't respect ATI and linux developers copyright. Don't redistribute the produced module. Unfortunately, it seems the problem is in the -rt sources where some symbols are marked GPL only (aren't they in the vanilla sources?).

In these files (change according the installed version of fglrx):
/usr/src/fglrx-8.543/firegl_public.c
/usr/src/fglrx-8.543/drm_compat.h

Look respectively for these lines:
#define MODULE_LICENSE(x)
MODULE_LICENSE("Proprietary. blah blah etc");

and change them respectively to
#define MODULE_LICENSE("GPL")
MODULE_LICENSE("GPL");

Run from the shell:
# sudo /etc/init.d/dkms_autoinstaller start

Reboot and you're done.

affects: ubuntu → linux-rt (Ubuntu)

Could you please provide the exact error message you get when attempting to load the fglrx module? You can most probably get this output from the dmesg command. If you can attach it to this bug, it would go a long way in helping work out the problem.

 affects ubuntu/linux-rt
 status incomplete

Changed in linux-rt (Ubuntu):
status: Confirmed → Incomplete
Francesco Pretto (ceztko) wrote :

2009/10/8 Luke Yelavich <email address hidden>:
> Could you please provide the exact error message you get when attempting
> to load the fglrx module? You can most probably get this output from the
> dmesg command. If you can attach it to this bug, it would go a long way
> in helping work out the problem.
>

Hmm... I advice to read the bug report from the begin: it's not a
matter of loading the kernel. Much simply, the module can't be
compiled within DKMS infrastructure using a -rt kernel because of GPL
symbols violation. Nothing get compiled -> nothing to load -> nothing
can fail :) .

I've posted an (illegal) workaround [1]. Wondering why there's no
legal problem compiling fglrx module using standard kernel/headers.

[1] https://bugs.launchpad.net/ubuntu/+source/linux-rt/+bug/159941/comments/6

Alessio Igor Bogani (abogani) wrote :

Hi,

We can't do nothing with this bug (in sense that we can't help when people choose to use self compiled driver).
Instead could you try fglrx driver with rt kernel in Karmic?

Thanks!

2009/10/11 Alessio Igor Bogani <email address hidden>:
> Hi,
>
> We can't do nothing with this bug (in sense that we can't help when people choose to use self compiled driver).
>
>

But..... it's how DKMS infrastructure *works*! When you install a
standard nvidia or flgrx driver, the module must be built (very little
compiling, because everyone knows that nvidia/flgrx drivers are
bundled with a big binary blob) for each kernel you install, generic
ubuntu kernels too; to avoid this, DKMS was created [1] so it performs
the build phase for you without user intervention. I don't want to be
too much critic but this bug report is VERY clear: the matter is just
to understand why some symbols are GPL only in the -rt kernel
headers/source that aren't in the generic. Please, don't misunderstand
it a third time.

[1] http://linux.dell.com/projects.shtml#dkms

Changed in linux-rt (Ubuntu):
assignee: nobody → Alessio Igor Bogani (abogani)
importance: Undecided → High
status: Incomplete → Confirmed
Alessio Igor Bogani (abogani) wrote :

Hi,

Anyone could test fglrx package in my PPA archive, please?

Thanks!

Changed in ubuntustudio:
status: New → Confirmed
importance: Undecided → High
Ryan Salomon (chyldofthebeat) wrote :

I installed your version of the fglrx package from your PPA, no go.

The module still wasn't loaded upon boot. When running 'sudo dkms build -m fglrx -v 8.660', I get:

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area....
su nobody -c "cd /var/lib/dkms/fglrx/8.660/build; sh make.sh --nohints --uname_r=2.6.31-7-rt --norootcheck"....(bad exit status: 1)

Error! Bad return status for module build on kernel: 2.6.31-7-rt (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/fglrx/8.660/build/ for more information.
0
0

Attached is the relevant make.log file.

Alessio Igor Bogani (abogani) wrote :

Ryan,

Thanks for feedback!

Now build step should be fixed with a new version available in a couple of hours.

Could you try again, please?

Thanks a lot!

Ryan Salomon (chyldofthebeat) wrote :

SUCCESS!!
At least on kernel 2.6.31-8-rt and driver 2.8.660-0ubuntu30

Let me know if I should test on any other kernels

Ryan Salomon (chyldofthebeat) wrote :

Heh sorry, in my enthusiasm I forgot to be more specific.

X started fine, started in compiz, all acceleration seems to work fine

Changed in linux-rt (Ubuntu):
status: Confirmed → In Progress
Alessio Igor Bogani (abogani) wrote :

Hi,

Anyone other could further confirm that the fix work?

Thanks!

Francesco Pretto (ceztko) wrote :

In the weekend I can try :)
Thanks Alessio!

Luke Yelavich (themuso) on 2009-10-14
affects: linux-rt (Ubuntu) → fglrx-installer (Ubuntu)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fglrx-installer - 2:8.660-0ubuntu4

---------------
fglrx-installer (2:8.660-0ubuntu4) karmic; urgency=low

  * Force fglrx-rt-compat.patch applied only on 2.6.28
  * Added new patch for rt kernel flavour (rt_preempt_31.patch) (LP: #159941)

 -- Alessio Igor Bogani <email address hidden> Mon, 12 Oct 2009 22:31:02 +0200

Changed in fglrx-installer (Ubuntu):
status: In Progress → Fix Released
Jan Engelhardt (jengelh) wrote :

Your patch rt_preempt_31.patch does the locking totally wrong.

Jan Engelhardt (jengelh) wrote :

(Meant >fglrx-rt-compat.patch.diff<, 'cause that is what changes rcu_read_lock.)

Mark Falcey (mfalcey) wrote :

I can confirm that the rt_preempt_31.patch is working with the 2.6.31-8rt kernel as of the latest updates.

I used Hardware Manger to remove and reactivate fglrx to get the DKMS kernel modules to build properly. Running usr/src/fgrlx-8.660/ make.sh failed with errors. I have the make.sh.log if anyone would care to look at it.

This is the first rt kernel since hardy that boots on my hardware and now with fglrx this is a good day.

Thank you all for the hard work.

regards,
mark

Alessio Igor Bogani (abogani) wrote :

j.engelh,

Could you explain what is wrong?

Thanks!

Alessio Igor Bogani (abogani) wrote :

Mark Falcey,

Yes I care of this build failed: Could you send me that log, please?

Thanks!

Jan Engelhardt (jengelh) wrote :

>Could you explain what is wrong?

I would not be so sure whether you can just replace rcu_read_lock by preempt_disable in RT, given thatRT's rcu_read_lock is a little more code than just disabling preempt.

 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
+#if !defined(CONFIG_PREEMPT_RT)
    rcu_read_lock();
+#else
+ preempt_disable();
+#endif
 #else
    read_lock(&tasklist_lock);
 #endif

Changed in ubuntustudio:
status: Confirmed → Invalid
ram (ram-hydrophones) wrote :

This bug shows up in 64Studio (based on Ubuntu Hardy) as well as in UbuntuStudio (Jaunty) when using the AMD/ATI Catalyst version 10.1 drivers (64-bit version).

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

Duplicates of this bug

Other bug subscribers

Bug attachments