Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2.6.6 (stable) and Nvidia - How to make it work?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
hardcampa
n00b
n00b


Joined: 11 Oct 2002
Posts: 58

PostPosted: Mon May 10, 2004 8:13 am    Post subject: 2.6.6 (stable) and Nvidia - How to make it work? Reply with quote

Let me start this thread =D

How do you make nvidias drivers work with kernel 2.6.6 that was released today (the final version not a rc).

If someone finds a patch or similar. Please post it.

:D

Well that's it. I'm sure more people are waiting for this answer/solution.
_________________
http://gibbage.mine.nu
Back to top
View user's profile Send private message
wizard69
Apprentice
Apprentice


Joined: 22 Sep 2003
Posts: 178
Location: Berlin

PostPosted: Mon May 10, 2004 9:23 am    Post subject: Reply with quote

Quote:
If you've emerged nvidia-kernel with a newer (>=2.6.5) kernel, this script should take care of it for you.

There is also a patch available for this, but I've had problems patching some sources, and some people have had trouble applying the patch themselves.

This script does NOT patch anything. It backs up the unpatched files, replaces them with the patched ones, then restores the backups again. It also emerges nvidia-kernel for you. It should leave no trace in the kernel source directory.

THIS SCRIPT WILL NOT WORK UNLESS YOU HAVE ALREADY COMPILED YOUR KERNEL. (actually emerging nvidia-kernel won't work if you have not yet compiled the kernel you wish to emerge nvidia-kernel against).

Also, /usr/src/linux must point to the kernel you wish to emerge nvidia-kernel against.

The script should run out of any directory, but I recommend running it out of /root/.

Simply extract the archive (tar -zxpf nvidia-kernel_fixed.tar.gz).
It will create a script file and another tar file (prepatched.tar.gz).
Then run the script as you would any other (/path/to/script or if you are in the directory, ./<scriptfile>)

Here is the actual code of the script, it uses very basic commands and should be understandable by anyone. The only real special thing this tarball contains is the prepatched files. It is quite easy to also do this by hand.

Code:

#! /bin/sh

# extract the prepatched files
tar -zxpf prepatched.tar.gz

# make backups of unpatched files that are to be replaced
cp /usr/src/linux/include/linux/module.h /usr/src/linux/include/linux/module.h.backup
cp /usr/src/linux/scripts/Makefile.modpost /usr/src/linux/scripts/Makefile.modpost.ba
ckup
cp /usr/src/linux/scripts/modpost.c /usr/src/linux/scripts/modpost.c.backup

# replace unpatched files with patched files
cp module.h /usr/src/linux/include/linux/module.h
cp Makefile.modpost /usr/src/linux/scripts/Makefile.modpost
cp modpost.c /usr/src/linux/scripts/modpost.c

# emerge nvidia-kernel
emerge nvidia-kernel

# restore unpatched files from backups
mv /usr/src/linux/include/linux/module.h.backup /usr/src/linux/include/linux/module.h
mv /usr/src/linux/scripts/Makefile.modpost.backup /usr/src/linux/scripts/Makefile.mod
post
mv /usr/src/linux/scripts/modpost.c.backup /usr/src/linux/scripts/modpost.c

# say all done
echo "All Done!"




I will not be held responsible for any negative effects this script may have on your system (although I can't think of anything that could go wrong).

Script can be found here:
http://hollywoodb.netfirms.com/nvidia-kernel_fixed.tar.gz

If NetFirms won't let you download it using that link, go through this page:
http://hollywoodb.netfirms.com/nvidia.html
try this script
Back to top
View user's profile Send private message
stahlsau
Guru
Guru


Joined: 09 Jan 2004
Posts: 584
Location: WildWestwoods

PostPosted: Mon May 10, 2004 9:37 am    Post subject: Reply with quote

and i´m sure the answer is on this forum. Just try searchin ;-)

But ok, this worked for me:
Code:
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/media-video/nvidia-kernel/nvidia-kernel-1.0.5336-r2.ebuild,v 1.2 2004/04/13 17:07:54 cyfred Exp $

inherit eutils rpm

PKG_V="pkg1"
NV_V="${PV/1.0./1.0-}"
NV_PACKAGE="NVIDIA-Linux-x86-${NV_V}"
S="${WORKDIR}/${NV_PACKAGE}-${PKG_V}/usr/src/nv"
DESCRIPTION="Linux kernel module for the NVIDIA's X driver"
HOMEPAGE="http://www.nvidia.com/"
SRC_URI="ftp://download.nvidia.com/XFree86/Linux-x86/${NV_V}/${NV_PACKAGE}-${PKG_V}.run"

# The slot needs to be set to $KV to prevent unmerges of modules for other kernels.
LICENSE="NVIDIA"
SLOT="${KV}"
KEYWORDS="-* ~x86"
RESTRICT="nostrip"

DEPEND="virtual/linux-sources"
export _POSIX2_VERSION="199209"


pkg_setup() {
   if [ ! -f /proc/mtrr ]
   then
      eerror "This version needs MTRR support for most chipsets!"
      eerror "Please enable MTRR support in your kernel config, found at:"
      eerror
      eerror "  Processor type and features -> [*] MTRR (Memory Type Range Register) support"
      eerror
      eerror "and recompile your kernel ..."
      die "MTRR support not detected!"
   fi

   check_version_h
}

check_version_h() {
   if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
   then
      eerror "Please verify that your /usr/src/linux symlink is pointing"
      eerror "to your current kernel sources, and that you did run:"
      eerror
      eerror "  # make dep"
      die "/usr/src/linux symlink not setup!"
   fi
}

get_KV_info() {
   check_version_h

   # Get the kernel version of sources in /usr/src/linux ...
   export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
      "${ROOT}/usr/src/linux/include/linux/version.h")"
   export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
   export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
   export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
}

is_kernel() {
   [ -z "$1" -o -z "$2" ] && return 1

   get_KV_info

   if [ "${KV_major}" -eq "$1" -a "${KV_minor}" -eq "$2" ]
   then
      return 0
   else
      return 1
   fi
}

pkg_setup() {
   ewarn "This ebuild may require write access to the sources of your current kernel,"
   ewarn "so this directory will be omitted from the sandbox restrictions."
   einfo "This requirement will be overcome in future ebuilds."
}

src_unpack() {
   cd ${WORKDIR}
   bash ${DISTDIR}/${NV_PACKAGE}-${PKG_V}.run --extract-only

   # Next section applies patches for linux-2.5 kernel, and/or
   # bugfixes for linux-2.4.  All these are from:
   #
   #   http://www.minion.de/nvidia/
   #
   # Many thanks to Christian Zander <zander@minion.de> for bringing
   # these to us, and being so helpful to select which to use.

   get_KV_info

   cd ${S}
   einfo "Linux kernel ${KV_major}.${KV_minor}.${KV_micro}"

   if is_kernel 2 5 || is_kernel 2 6
   then
      EPATCH_SINGLE_MSG="Applying basic sysfs patch ..." \
      epatch ${FILESDIR}/${PV}/NVIDIA_kernel-${NV_V}-basic-sysfs-support.patch

      rm makefile
      ln -snf Makefile.kbuild Makefile
   fi

   # if you set this then it's your own fault when stuff breaks :)
   [ ! -z "${USE_CRAZY_OPTS}" ] && sed -i "s:-O:${CFLAGS}:" Makefile

}

src_compile() {
   # Portage should determine the version of the kernel sources
   check_KV

   # IGNORE_CC_MISMATCH disables a sanity check that's needed when gcc has been
   # updated but the running kernel is still compiled with an older gcc.  This is
   # needed for chrooted building, where the sanity check detects the gcc of the
   # kernel outside the chroot rather than within.

   if is_kernel 2 5 || is_kernel 2 6
   then
      addwrite "/usr/src/linux"
      env -u ARCH make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
         SYSSRC="/usr/src/linux" clean module || die
   else
      env -u ARCH make IGNORE_CC_MISMATCH="yes" KERNDIR="/usr/src/linux" \
         clean module || die
   fi

}

src_install() {
   # The driver goes into the standard modules location
   insinto /lib/modules/${KV}/video
   if is_kernel 2 5 || is_kernel 2 6
   then
      doins nvidia.ko
   else
      doins nvidia.o
   fi

   # Add the aliases
   insinto /etc/modules.d
   newins ${FILESDIR}/nvidia-1.1 nvidia

   # Docs
   dodoc ${S}/README

   # The device creation script
   into /
   newsbin ${S}/makedevices.sh NVmakedevices.sh
}

pkg_postinst() {
   if [ "${ROOT}" = "/" ]
   then
      # Update module dependency
      [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
      if [ ! -e /dev/.devfsd ] && [ ! -e /dev/.udev ] && [ -x /sbin/NVmakedevices.sh ]
      then
         /sbin/NVmakedevices.sh >/dev/null 2>&1
      fi
   fi

   echo
   einfo "If you are not using devfs, loading the module automatically at"
   einfo "boot up, you need to add \"nvidia\" to your /etc/modules.autoload."
   echo
   ewarn "Please note that the driver name changed from \"NVdriver\""
   ewarn "to \"nvidia.o\"."
   echo
}
Back to top
View user's profile Send private message
charlieg
Advocate
Advocate


Joined: 30 Jul 2002
Posts: 2149
Location: Manchester UK

PostPosted: Mon May 10, 2004 12:47 pm    Post subject: Reply with quote

stahlsau wrote:
But ok, this worked for me:


You should log that on bugzilla.
_________________
Want Free games?
Free Gamer - open source games list & commentary

Open source web-enabled rich UI platform: Vexi
Back to top
View user's profile Send private message
dsd
Developer
Developer


Joined: 30 Mar 2003
Posts: 2162
Location: nr London

PostPosted: Mon May 10, 2004 1:26 pm    Post subject: Reply with quote

edit:removed misinformation as i misread the ebuild

see https://bugs.gentoo.org/show_bug.cgi?id=48030 for more info on the nvidia vs 2.6.6 problem

also, dont compile the kernel with 4k-stacks enabled, else you'll get lockups when going into X.
_________________
http://dev.gentoo.org/~dsd
Back to top
View user's profile Send private message
stahlsau
Guru
Guru


Joined: 09 Jan 2004
Posts: 584
Location: WildWestwoods

PostPosted: Mon May 10, 2004 3:50 pm    Post subject: Reply with quote

Quote:
You should log that on bugzilla.

well, i found that ebuild in the forum, so i thought most people would know about this. Also, i have no idea ´bout logging s/t at bugzilla or so, i only know the search-function (and maybe google ;-))
I´m no geek, so when i find a problem with my computer, most of all it will be my fault; and i can´t report all my faults to bugzilla :oops:
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Mon May 10, 2004 10:51 pm    Post subject: Reply with quote

stahlsau wrote:
and i´m sure the answer is on this forum. Just try searchin ;-)


I was sure as well, about a week ago. I searched ....and searched , tried lots of suggested "fixes" but sadly still do not have a working GeForce4


The reverse patch suggested above does not help for 2.6.6-rc3-love4.It appears that the patch set already takes care of that and the unpatch fails both "hunks".


Also 4k stacks is off,

Can build and modprobe nvidia module but starting x always fails like this:

Code:

(II) Loading font FreeType
(II) LoadModule: "tdfx"
(II) Loading /usr/X11R6/lib/modules/drivers/tdfx_drv.o
(II) Module tdfx: vendor="X.Org Foundation"
        compiled for 6.7.0, module version = 1.0.0
        Module class: X.Org Video Driver
        ABI class: X.Org Video Driver, version 0.7
(II) LoadModule: "nvidia"
(II) Loading /usr/X11R6/lib/modules/drivers/nvidia_drv.o
(II) Module nvidia: vendor="NVIDIA Corporation"
        compiled for 4.0.2, module version = 1.0.5336
        Module class: XFree86 Video Driver

.................


(II) Reloading /usr/X11R6/lib/modules/libvgahw.a
(**) NVIDIA(1): Depth 24, (--) framebuffer bpp 32
(==) NVIDIA(1): RGB weight 888
(==) NVIDIA(1): Default visual is TrueColor
(==) NVIDIA(1): Using gamma correction (1.0, 1.0, 1.0)
(--) NVIDIA(1): Linear framebuffer at 0xE4000000
(--) NVIDIA(1): MMIO registers at 0xEC000000
(EE) NVIDIA(1): Failed to initialize the NVIDIA kernel module!
(EE) NVIDIA(1):  *** Aborting ***
(II) UnloadModule: "nvidia"
(II) UnloadModule: "vgahw"
(--) Depth 24 pixmap format is 32 bpp


any ideas?
Back to top
View user's profile Send private message
younker
Apprentice
Apprentice


Joined: 18 Feb 2004
Posts: 280
Location: China

PostPosted: Tue May 11, 2004 2:14 am    Post subject: Reply with quote

I have the same problem with kernel 2.6.5 and gcc 3.4
I can only build the nvidia kernel module through the ebuild, if I use the nv installer, it fails to build the module, use the ebuild can build the module but can't use, every time use modprobe to load the module it will show some error messages.

Gentree wrote:
stahlsau wrote:
and i´m sure the answer is on this forum. Just try searchin ;-)


I was sure as well, about a week ago. I searched ....and searched , tried lots of suggested "fixes" but sadly still do not have a working GeForce4


The reverse patch suggested above does not help for 2.6.6-rc3-love4.It appears that the patch set already takes care of that and the unpatch fails both "hunks".


Also 4k stacks is off,

Can build and modprobe nvidia module but starting x always fails like this:

Code:

(II) Loading font FreeType
(II) LoadModule: "tdfx"
(II) Loading /usr/X11R6/lib/modules/drivers/tdfx_drv.o
(II) Module tdfx: vendor="X.Org Foundation"
        compiled for 6.7.0, module version = 1.0.0
        Module class: X.Org Video Driver
        ABI class: X.Org Video Driver, version 0.7
(II) LoadModule: "nvidia"
(II) Loading /usr/X11R6/lib/modules/drivers/nvidia_drv.o
(II) Module nvidia: vendor="NVIDIA Corporation"
        compiled for 4.0.2, module version = 1.0.5336
        Module class: XFree86 Video Driver

.................


(II) Reloading /usr/X11R6/lib/modules/libvgahw.a
(**) NVIDIA(1): Depth 24, (--) framebuffer bpp 32
(==) NVIDIA(1): RGB weight 888
(==) NVIDIA(1): Default visual is TrueColor
(==) NVIDIA(1): Using gamma correction (1.0, 1.0, 1.0)
(--) NVIDIA(1): Linear framebuffer at 0xE4000000
(--) NVIDIA(1): MMIO registers at 0xEC000000
(EE) NVIDIA(1): Failed to initialize the NVIDIA kernel module!
(EE) NVIDIA(1):  *** Aborting ***
(II) UnloadModule: "nvidia"
(II) UnloadModule: "vgahw"
(--) Depth 24 pixmap format is 32 bpp


any ideas?
Back to top
View user's profile Send private message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 551
Location: London,UK

PostPosted: Tue May 11, 2004 2:24 am    Post subject: Reply with quote

Gentree wrote:
stahlsau wrote:
and i´m sure the answer is on this forum. Just try searchin ;-)


I was sure as well, about a week ago. I searched ....and searched , tried lots of suggested "fixes" but sadly still do not have a working GeForce4


any ideas?


same error here too :(
using 2.6.6-mm1 and bugzilla ebuild's


Last edited by trumee on Tue May 11, 2004 7:48 am; edited 1 time in total
Back to top
View user's profile Send private message
kruthles
n00b
n00b


Joined: 12 Dec 2003
Posts: 11
Location: mn

PostPosted: Tue May 11, 2004 3:03 am    Post subject: Reply with quote

the ebuild on the bugzilla worked here with 2.6.6 and a gf3 8)
Back to top
View user's profile Send private message
Gil-galad55
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2004
Posts: 101

PostPosted: Tue May 11, 2004 3:35 am    Post subject: Reply with quote

Btw, the ebuilds don't work with -mm patchset, and you can't turn 4k stacks off in any case that I can tell in -mm, at least not easily. But, working fine with vanilla 2.6.6 here.
_________________
a^2 + b^2 = c^2
"To strive, to seek, to find, and not to yield." Tennyson
Back to top
View user's profile Send private message
dob
Apprentice
Apprentice


Joined: 04 Oct 2002
Posts: 199
Location: S.L.P.

PostPosted: Tue May 11, 2004 2:01 pm    Post subject: Reply with quote

I made a 5341 version of the M="${S}" ebuild (since I had 'badness in
pci.c' crashes with version 5336, and I don't get those anymore with 5341).

It seems to work fine so far with vanilla 2.6.6

Dowload here.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Tue May 11, 2004 6:14 pm    Post subject: Reply with quote

Gil-galad55 wrote:
Btw, the ebuilds don't work with -mm patchset, and you can't turn 4k stacks off in any case that I can tell in -mm, at least not easily. But, working fine with vanilla 2.6.6 here.


This is taken care of in love-sources , which is a patch of mm. No more $k issue with love. But I cant say I've sussed my Geforce yet, although I'm prette sure its not related to love.

8)
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Fri May 14, 2004 9:40 pm    Post subject: Reply with quote

I confirm : this ebuild (5336 or 5341) doesn't work with 2.6.6-mm2, because we cannot disable anymore 4K stack (it will be the same thing in near 2.6.* vanilla release, as said on the lkml)...

I have read on the nvidia forum that nvidia consider 4K stack as a very experimental feature, whereas developpers in the lkml says that its quite stable and very near to be hard integrated to the vanilla sources as it provides some avantages... So we will probably have a long time to wait before new drivers with 4K stack support will be released.

So I think nvidia makes fun of 2.6.x users... I'm really thinking that my new video card will be an ati...
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
HydroSan
l33t
l33t


Joined: 04 Mar 2004
Posts: 764
Location: The Kremlin (aka Canada)

PostPosted: Fri May 14, 2004 10:51 pm    Post subject: Reply with quote

Quote:
So I think nvidia makes fun of 2.6.x users... I'm really thinking that my new video card will be an ati...


Oh come now. It takes a while to implement new features. And nVidia just recently released a new card with ATI breathing down their necks - give them a little slack. nVidia has done wonders with their drivers and yet ATI barely supports XFree nevermind XOrg with shitty .rpm based drivers which apparently only work on RedHat and of course Gentoo.

Give nVidia some more time. They'll eventually implement it when they are convinced that it is stable enough - they want to keep releasing quality drivers that wont die on anyone.
_________________
I was a Gangster for Capitalism, by Major General Smedley Butler.

Server status: Currently down, being replaced with fresh install - 20% completed.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Fri May 14, 2004 11:10 pm    Post subject: Reply with quote

Quote:
I confirm : this ebuild (5336 or 5341) doesn't work with 2.6.6-mm2, because we cannot disable anymore 4K stack


so move to love sources which allow 4k or 8k. I can confirm that this works , I'm running 2.6.6-r1-love1 as I write this.

You're welcome to spend your pocket-money on ATI next time , then dont forget to come back and tell us if you think they are laughing Linux users as well.
Back to top
View user's profile Send private message
Gentii
Guru
Guru


Joined: 01 Feb 2004
Posts: 306

PostPosted: Sat May 15, 2004 12:05 pm    Post subject: Reply with quote

Gentree wrote:
Quote:
I confirm : this ebuild (5336 or 5341) doesn't work with 2.6.6-mm2, because we cannot disable anymore 4K stack


so move to love sources which allow 4k or 8k. I can confirm that this works , I'm running 2.6.6-r1-love1 as I write this.

You're welcome to spend your pocket-money on ATI next time , then dont forget to come back and tell us if you think they are laughing Linux users as well.


You mean more?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum