[PlanetCCRMA] Need help getting realtime kernel working with Fedora 8 and nvidia

Matt Barber brbrofsvl at gmail.com
Wed Jun 25 13:23:54 PDT 2008


I don't know if this has been brought up here, but you may have
trouble compiling the nvidia kmod (version 173.14.09-2) against some
newer rt kernels (e.g.  The nvidia
drivers use some structs and functions which have been relegated to
"compat" status in RT kernels.  You can apply the following patch in
the build process to get it to work, but I don't know if it's safe to
use the semaphore stuff anymore -- it would be good to hear about this
from someone who knows the kernel better (at any rate it's needed for
the nvidia drivers):

--- nvidiapkg-x86/usr/src/nv/nv-linux.h	2008-06-05 03:13:45.000000000 -0400
+++ nvidiapkg-x86/usr/src/nv/nv-linux.h	2008-06-23 19:15:49.000000000 -0400
@@ -686,8 +686,8 @@

 #define NV_INIT_MUTEX(mutex)                       \
     {                                              \
-        struct semaphore __mutex =                 \
-            __SEMAPHORE_INITIALIZER(*(mutex), 1);  \
+        struct compat_semaphore __mutex =                 \
+            __COMPAT_SEMAPHORE_INITIALIZER(*(mutex), 1);  \
         *(mutex) = __mutex;                        \

@@ -1132,10 +1132,10 @@
     int rm_lock_count;

     /* lock for linux-specific data, not used by core rm */
-    struct semaphore ldata_lock;
+    struct compat_semaphore ldata_lock;

     /* lock for linux-specific alloc queue */
-    struct semaphore at_lock;
+    struct compat_semaphore at_lock;
 } nv_linux_state_t;

@@ -1175,7 +1175,7 @@
 typedef struct
     nv_stack_t *sp;
-    struct semaphore sp_lock;
+    struct compat_semaphore sp_lock;
     void *nvptr;
     U032 num_events;
     U032 put, get;

you can save that in a file called something like
"nvidia-semaphore.patch" in the SOURCES directory of your build tree.

You'll need this line in the spec file:

Patch0: nvidia-semaphore.patch

(this can go just after the Source0 line)

and this one:

%patch0 -p0

which can go somewhere after the %setup line.  I haven't looked but
there may be a way to get kmodtool to apply the patches, but hacking
the spec does work in this case.



On Wed, May 14, 2008 at 12:08 PM, Juan I Reyes
<juanig at ccrma.stanford.edu> wrote:
> Hi Matt,
> Sorry for getting so late to this post. I used your instructions for
> kmod-nvidia for a while, but on F8 I could not use them anymore (thanks
> a lot). I sent a post to PlanetCCRMA last February with the procedure I
> am using now:
> http://ccrma-mail.stanford.edu/pipermail/planetccrma/2008-February/014423.html
> Looks like Livna is using RPM Fusion in order to facilitate KMOD
> compilation in different Kernels.
> Once I have the KMOD SRPM,  All I have to do is to compile kmod-nvidia
> module for a ccrma rt kernel as:
> 'rpmbuild -ba --define "kernels $(uname -r)" --target i686 \
> nvidia-kmod.spec'
>  --* Juan
> On Fri, 2008-05-09 at 11:35 -0400, Matt Barber wrote:
>> By the way,
>> After you install the kmod-nvidia package, you might have trouble with
>>  yum update   when there's a fedora kernel update, since it will try
>> to update to the new one rather than install the new one (I think this
>> causes a dependency conflict because kernels are installonly by
>> default in yum, but updating tries to take away the old kmod-nvidia
>> package - again, someone who knows yum better please advise).
>> I am thinking you can fix this by adding "kmod-nvidia" to an
>> installonlypkgs line in yum.conf -- or if you don't want to do that,
>> if you get an error from   yum update   saying you have dependency
>> issues involving  kmod-nvidia  I have found success by running
>> yum install kernel kmod-nvidia
>> first before running yum update.
>> Best,
>> Matt

More information about the PlanetCCRMA mailing list