View Single Post
Old 06-07-11, 01:12 AM   #2
cr1ogen
Registered User
 
Join Date: Aug 2010
Posts: 9
Default Re: Error installing nvidia drivers

Don't know if that has already been posted but here is a way to make NVIDIA drivers work on RT kernels 2.6.33.13-real-time

1. Download the NVIDIA driver you want to use (270.41.06 for example) and make it executable

2. Run :

/[path to the downloaded driver]/NVIDIA-Linux-x86_64-270.41.06.run -x

this will only extract the package content

3. Open the file /usr/src/NVIDIA-Linux-x86_64-270.41.06/kernel/nv-linux.h and make those changes :

Replace :

#if defined(CONFIG_PREEMPT_RT)
typedef atomic_spinlock_t nv_spinlock_t;
#define NV_SPIN_LOCK_INIT(lock) atomic_spin_lock_init(lock)
#define NV_SPIN_LOCK_IRQ(lock) atomic_spin_lock_irq(lock)
#define NV_SPIN_UNLOCK_IRQ(lock) atomic_spin_unlock_irq(lock)
#define NV_SPIN_LOCK_IRQSAVE(lock,flags) atomic_spin_lock_irqsave(lock,flags)

#define NV_SPIN_UNLOCK_IRQRESTORE(lock,flags) \
atomic_spin_unlock_irqrestore(lock,flags)
#define NV_SPIN_LOCK(lock) atomic_spin_lock(lock)
#define NV_SPIN_UNLOCK(lock) atomic_spin_unlock(lock)
#define NV_SPIN_UNLOCK_WAIT(lock) atomic_spin_unlock_wait(lock)

#else
typedef spinlock_t nv_spinlock_t;
#define NV_SPIN_LOCK_INIT(lock) spin_lock_init(lock)

by

#if defined(CONFIG_PREEMPT_RT)
typedef raw_spinlock_t nv_spinlock_t;
#define NV_SPIN_LOCK_INIT(lock) raw_spin_lock_init(lock)
#define NV_SPIN_LOCK_IRQ(lock) raw_spin_lock_irq(lock)
#define NV_SPIN_UNLOCK_IRQ(lock) raw_spin_unlock_irq(lock)
#define NV_SPIN_LOCK_IRQSAVE(lock,flags) raw_spin_lock_irqsave(lock,flags)

#define NV_SPIN_UNLOCK_IRQRESTORE(lock,flags) \
raw_spin_unlock_irqrestore(lock,flags)
#define NV_SPIN_LOCK(lock) raw_spin_lock(lock)
#define NV_SPIN_UNLOCK(lock) raw_spin_unlock(lock)
#define NV_SPIN_UNLOCK_WAIT(lock) raw_spin_unlock_wait(lock)

#else
typedef spinlock_t nv_spinlock_t;
#define NV_SPIN_LOCK_INIT(lock) spin_lock_init(lock)

and
Cita:

#if defined(CONFIG_PREEMPT_RT)
#define NV_INIT_MUTEX(mutex) semaphore_init(mutex)
#else
#if !defined(__SEMAPHORE_INITIALIZER) && defined(__COMPAT_SEMAPHORE_INITIALIZER)
#define __SEMAPHORE_INITIALIZER __COMPAT_SEMAPHORE_INITIALIZER


by
Cita:

#if defined(CONFIG_PREEMPT_RT)
#define NV_INIT_MUTEX(mutex) sema_init(mutex,1)
#else
#if !defined(__SEMAPHORE_INITIALIZER) && defined(__COMPAT_SEMAPHORE_INITIALIZER)
#define __SEMAPHORE_INITIALIZER __COMPAT_SEMAPHORE_INITIALIZER


4. Run:


NVIDIA-Linux-x86_64-270.41.06/nvidia-installer


You're done !


That work like a charm for me.
That's inspired (for not saying totaly ripped ) from there :
http://www.spinics.net/lists/linux-r.../msg06142.html
Beware the patch posted in that page can't be applyed directly since the line numbers change from version to version of the driver
cr1ogen is offline   Reply With Quote