Home > Ubuntu > Installing nVidia driver 185.18.14 with real time linux kernel 2.6.28-3-rt

Installing nVidia driver 185.18.14 with real time linux kernel 2.6.28-3-rt

This article discusses how to get the NVidia Linux graphics driver working with the real time linux kernel version 2.6.28-rt under Ubuntu (Kubuntu) 9.04 on AMD 64.

DISCLAIMER:I have no idea if what I have here is a good idea beyond the fact that my video card is working properly under linux-rt.  My computer froze a couple times with the following setup but I’m not sure if it’s the fix or the fact that linux-rt apparently doesn’t play well with multiple core machines. Or the computer freezy gnomes. Whatever. Use at your own risk.

I’m running Kubuntu 9.04 on AMD64.

While setting up my linux audio recording setup on Kubuntu 9.04 I installed the linux-rt meta-package (which right now points to linux-2.6.28-3-rt) for real time process scheduling.  I was dismayed and not at all surprised that the proprietary nVidia driver for my GeForce 7950  GT did not work immediately when I booted up out of GRUB with the new kernel.  So, I downloaded the latest nVidia driver from http://www.nvidia.com/object/linux_display_amd64_185.18.14.html and tried to install as I have to do every time there is a new linux kernel update by running this with the downloaded script:

$> sudo sh NVIDIA-Linux-x86_64-185.18.14-pkg2.run

The script informs you that it needs to compile the kernel module as usual, but dies saying compilation was unsuccessful. Following the advice of some forum posts I found, I extracted the script into its source tree with:

$> sudo sh NVIDIA-Linux-x86_64-185.18.14-pkg2.run -x

which creates a directory with a script nvidia-installer.sh and the source tree. I ran the installer manually with:

$> cd NVIDIA-Linux-x86_64-185.18.14-pkg2
$> sudo ./nvidia-installer

Compilation fails again at the same step. Inspecting /var/log/nvidia-installer.log tells us:

/home/labadorf/video_drivers/NVIDIA-Linux-x86_64-185.18.14-pkg2/usr/src/nv/os-interface.c:130: error: incompatible types in assignment

After poking around some forums there were some suggestions about replacing some SEMAPHORE code in certain driver source files, but they were for the wrong driver version (177) and didn’t work. Alright, well I have the source for both the kernel and driver, I thought, so let’s see what this incompatible type assignment is. At the end of the day, I traced the error to a couple lines of code earlier in usr/src/nv/os-interface.c. Apparently, the driver is trying to pass some raw_spinlock_t kernel struct to a function that can only accept spinlock_t structs when it detects you’re using a real time kernel. So, I thought a little commenting might do the trick…

Original os-interface.c source:


86 typedef struct os_sema_s
87 {
88 nv_stack_t *sp;
89 struct completion completion;
90 #if defined(CONFIG_PREEMPT_RT)
91 raw_spinlock_t lock;
92 #else
93 spinlock_t lock;
94 #endif
95 S032 count;
96 } os_sema_t;
97

Modified code:

86 typedef struct os_sema_s
87 {
88 nv_stack_t *sp;
89 struct completion completion;
90 //#if defined(CONFIG_PREEMPT_RT)
91 // raw_spinlock_t lock;
92 //#else
93 spinlock_t lock;
94 //#endif
95 S032 count;
96 } os_sema_t;
97

Lo and behold, on recompiling the driver everything works fine. Now, I suppose there may have been a good reason to use the raw version of the struct, but I got all of my audio stuff running with much lower latency AND using both monitors on high resolution (which is really handy since some of these audio apps take up a lot of screen real estate). There are a couple bugs open on this issue so I didn’t feel the need to post anything (though none of the comments there helped with my problem), hopefully someone will figure out what the problem is and fix it soon.

Note: By default the installer replaces whatever driver you have with the new one. You have to unpack the driver source and use the installer manually if you want to use different kernels and not recompile the driver every time. Look at this post and specifically Switcher’s comment 12 for instructions on how to do that.

Like I said, the commenting out I’ve done may be a terrible, terrible idea, but as I know nothing about graphics drivers and even less about kernel building I’m playing the ignorant fool. Good luck.

  1. binmode
    July 19th, 2009 at 12:18 | #1

    It worked for me.

    Thank you!!

  2. July 31st, 2009 at 13:16 | #2

    It also worked for me.

    Tested on Intel Q9550, nVidia GTX280, 64 bit mode, Ubuntu 9.04 with 185.18.31 driver version.

    Thank you !

  3. July 31st, 2009 at 21:13 | #3

    I’m glad this walkthrough has been useful for you both. Adam is the one who wrote this up, I’ll send your thanks on to him.

  4. tralston
    August 2nd, 2009 at 13:47 | #4

    You are wonderful! I didn’t actually have to do all those steps. I tried to install the 185.18.31 driver on my GeForce 8700M GT (Dell XPS M1730) mobile computer so many times, but it never worked, kept saying that the versions for the API and the kernel weren’t compatible…

    Anyway, I extracted the installer and ran it from its folder. One thing I noticed this time, is I didn’t uninstall the drivers (the same version I was installing again) because the nvidia installer said something about “you want to install 185.18.31, but you have 185.18.31 already installed so we will uninstall it for you first…” and I was like “OK……”. I got some errors during the build/compile process. I think that the magic step was doing the nvidia-xconfig (which amazingly NO OTHER forum posting I’ve found until yours mentioned that…). I didn’t even end up changing the source (probably because there was no log file.., not sure why it didn’t go all the way thru). I just started up X (gdm) and tried the Display options and hallelujah 1920×1200 my sweet native resolution was there!

    Side note, after logging off/then on to test the resolution again, it wouldn’t stay. I found that the settings wouldn’t “stick” in the nVidia settings, but they would if I used the native Display Manager applet. Thanks a million!!!

  5. August 17th, 2009 at 19:20 | #5

    It also worked for me.

    Tested on AMD Phenom 9750, MSI K9N6PGM2, GeForce 6150SE nForce 430 32bit, UbuntuStudio 9.04 with 185.18.31 driver version.

    Thank you !

    Gracias pana, por fin logré hacer funcionar esta cosa… Qué molleja ‘e capo sois vos!!!

  1. No trackbacks yet.