Nvidia driver - Debian way, custom (or not) kernel.

Share your own howto's etc. Not for support questions!

Postby julian67 » 2009-03-02 01:35

monacelli wrote:A simple "apt-get install nvidia-glx" worked for me on a fresh testing install with non-free and contrib added to the sources.list. After install nvidia-glx all I had to do was add the appropriate driver line to xorg.conf and restart x. Maybe I'm missing something but it seems like you guys are making the process harder than it really is.


And now try that on a custom kernel with the latest nvidia driver. Yes, you are missing plenty.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Postby mzilikazi » 2009-03-02 03:40

monacelli wrote:A simple "apt-get install nvidia-glx" worked for me on a fresh testing install with non-free and contrib added to the sources.list. After install nvidia-glx all I had to do was add the appropriate driver line to xorg.conf and restart x. Maybe I'm missing something but it seems like you guys are making the process harder than it really is.

Are you saying that you didn't use module-assistant? What does this say:
Code: Select all
lsmod|grep nv
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby monacelli » 2009-03-04 13:42

mzilikazi wrote:Are you saying that you didn't use module-assistant? What does this say:
Code: Select all
lsmod|grep nv


Indeed, I didn't use module-assistant.

lsmod|grep nv returns:
Code: Select all
nvidia               7086148  26
i2c_core               19828  2 nvidia,i2c_i801
agpgart                28776  2 nvidia,intel_agp
Image
monacelli
 
Posts: 9
Joined: 2007-12-20 12:38
Location: Jericho, KS

Postby mzilikazi » 2009-03-04 15:03

monacelli wrote:
mzilikazi wrote:Are you saying that you didn't use module-assistant? What does this say:
Code: Select all
lsmod|grep nv


Indeed, I didn't use module-assistant.

lsmod|grep nv returns:
Code: Select all
nvidia               7086148  26
i2c_core               19828  2 nvidia,i2c_i801
agpgart                28776  2 nvidia,intel_agp

OK then how about this:
Code: Select all
modinfo nvidia
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby didi » 2009-03-04 22:37

I can confirm that you can (also) install it by just using aptitude, did it recently on my laptop.
Code: Select all
# modinfo nvidia
filename:       /lib/modules/2.6.26-1-686-bigmem/nvidia/nvidia.ko
license:        NVIDIA
alias:          char-major-195-*
alias:          pci:v000010DEd*sv*sd*bc03sc02i00*
alias:          pci:v000010DEd*sv*sd*bc03sc00i00*
depends:        agpgart,i2c-core
vermagic:       2.6.26-1-686-bigmem SMP mod_unload modversions 686
parm:           NVreg_EnableVia4x:int
parm:           NVreg_EnableALiAGP:int
parm:           NVreg_ReqAGPRate:int
parm:           NVreg_EnableAGPSBA:int
parm:           NVreg_EnableAGPFW:int
parm:           NVreg_Mobile:int
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_RemapLimit:int
parm:           NVreg_UpdateMemoryTypes:int
parm:           NVreg_UseVBios:int
parm:           NVreg_RMEdgeIntrCheck:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_NvAGP:int
Testing (server) + Unstable (workstation) 32-bit on AMD Athlon64 X2
didi
 
Posts: 909
Joined: 2007-12-04 16:26
Location: the Netherlands

Postby mzilikazi » 2009-03-05 13:44

didi wrote:I can confirm that you can (also) install it by just using aptitude, did it recently on my laptop.

Well nvidia-glx depends on nvidia-kernel
Code: Select all
# apt-cache depends nvidia-glx
nvidia-glx
  Depends: <nvidia-kernel-180.29>

and nvidia-kernel must be built against your running kernel.
What do these tell you?
Code: Select all
dpkg -l|grep nvidia
apt-cache policy nvidia-kernel-source
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby didi » 2009-03-05 13:56

Code: Select all
$ dpkg -l | grep nvidia
ii  nvidia-glx                               173.14.09-5                   NVIDIA binary Xorg driver
ii  nvidia-kernel-2.6-686-bigmem             173.14.09+3                   NVIDIA binary kernel module for 2.6 series c
ii  nvidia-kernel-2.6.26-1-686-bigmem        173.14.09+3                   NVIDIA binary kernel module for Linux 2.6.26
ii  nvidia-kernel-common                     20080825+1                    NVIDIA binary kernel module common files
ii  nvidia-settings                          180.22-1                      Tool of configuring the NVIDIA graphics driv
ii  nvidia-xconfig                           1.0+20080522-2                The NVIDIA X Configuration Tool


Code: Select all
$ apt-cache policy nvidia-kernel-source
nvidia-kernel-source:
  Installed: (none)
  Candidate: 173.14.09-5
  Version table:
     180.29-1 0
        500 http://ftp.nl.debian.org unstable/non-free Packages
     173.14.09-5 0
        990 http://ftp.nl.debian.org testing/non-free Packages
Testing (server) + Unstable (workstation) 32-bit on AMD Athlon64 X2
didi
 
Posts: 909
Joined: 2007-12-04 16:26
Location: the Netherlands

Postby mzilikazi » 2009-03-05 15:21

didi wrote:
Code: Select all
$ dpkg -l | grep nvidia
ii  nvidia-glx                               173.14.09-5                   NVIDIA binary Xorg driver
ii  nvidia-kernel-2.6-686-bigmem             173.14.09+3                   NVIDIA binary kernel module for 2.6 series c
ii  nvidia-kernel-2.6.26-1-686-bigmem        173.14.09+3                   NVIDIA binary kernel module for Linux 2.6.26
ii  nvidia-kernel-common                     20080825+1                    NVIDIA binary kernel module common files
ii  nvidia-settings                          180.22-1                      Tool of configuring the NVIDIA graphics driv
ii  nvidia-xconfig                           1.0+20080522-2                The NVIDIA X Configuration Tool


Code: Select all
$ apt-cache policy nvidia-kernel-source
nvidia-kernel-source:
  Installed: (none)
  Candidate: 173.14.09-5
  Version table:
     180.29-1 0
        500 http://ftp.nl.debian.org unstable/non-free Packages
     173.14.09-5 0
        990 http://ftp.nl.debian.org testing/non-free Packages

Well there you have it. You have a precompiled nvidia-kernel. Note that the title of the thread is for a custom kernel but also applies to any kernel in the event that there is not a precompiled nvidia-kernel available.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby didi » 2009-03-05 15:30

mzilikazi wrote:Well there you have it. You have a precompiled nvidia-kernel. Note that the title of the thread is for a custom kernel but also applies to any kernel in the event that there is not a precompiled nvidia-kernel available.

I know and I've used this howto successfully in the past.
I only confirmed that you can now (also) install the nvidia stuff just through apt-get/aptitude when you're using a stock kernel.
Testing (server) + Unstable (workstation) 32-bit on AMD Athlon64 X2
didi
 
Posts: 909
Joined: 2007-12-04 16:26
Location: the Netherlands

Postby mzilikazi » 2009-03-05 15:49

didi wrote:I know and I've used this howto successfully in the past.
I only confirmed that you can now (also) install the nvidia stuff just through apt-get/aptitude when you're using a stock kernel.

Well I didn't know that and it is very interesting even if it's a very old version.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby julian67 » 2009-03-05 20:19

This situation may change according to the policy of the Linux kernel developers and possibly according to differences of interpretation of the Debian Social Contract amongst Debian developers. If you use Nvidia proprietary drivers you'll probably have noticed how the ability to do a simple apt/aptitude install has not been a permanent fixture and that Linux kernel development and release and Debian updates will go on regardless if it breaks the ability to install a proprietary binary driver. This has happened before and may happen again.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Postby Eck » 2009-03-07 15:32

Both the Nvidia Debian team (essentially Randell Donald) and the fglrx team pushed matching kernel modules into Debian before the Lenny release. This was in order to provide easy installation for those using the default Debian kernel on the i386 and x64 arch's.

If on other arch's or if the kernel is manually compiled then those NVidia and fglrx modules no longer match and module assistant must be used instead.

The last NVidia setup I had on my GeForce 6600 GT AGP was using the pre-built module without running module assistant and my current Radeon x850 PRO setup using the pre-built fglrx kernel module, also without running module-assistant.

So as long as a version of Debian stable is used (Etch, with the older drivers included or Lenny with its drivers) and one does not update to squeeze (which would bring in newer fglrx or nvidia versions too) then these modules are brought in as recommends by aptitude. Just gotta be careful to specify the meta-package module for your arch or aptitude also mistakenly installs the 486 modules too! I just ran aptitude in ncurses mode when installing and de-selected those, just installing the 686 version.

Another thing to be careful of is module assistant use for at least the fglrx driver. The m-a a-i fglrx includes the m-a get command. That's bad when installing the packages built by the ATI downloaded driver as it downloads an older module from the Lenny source. Gotta use m-a update, m-a prepare, m-a build, m-a install fglrx-kernel-src instead of a-i. Since I now use the Lenny driver I don't have the problem, but I did when I had the ATI download build its packages. Had to run through the m-a steps separately as a-i would otherwise replace the fglrx-kernel-src package with the one in Lenny (older).

But it's really easy (no m-a at all) for those using the stock default kernel and the included drivers.
Lenovo z560 Laptop Nvidia GeForce 310m Hitachi 500GB HD Intel HD Audio 4GB RAM
Eck
 
Posts: 740
Joined: 2007-06-27 16:13

Postby didi » 2009-03-29 16:56

I have an addition to this HOW-TO for ppl who have build the nvidia kernel module (using this method?) before.
Code: Select all
m-a clean nvidia

This will clean up any old nvidia files in /usr/src/modules, which could prevent it from compiling.
At least that was the case with me when trying to upgrade to 180.29.

This was the error part on the (failed) build log:
Code: Select all
In file included from include/acpi/acpi.h:67,
                 from /usr/src/modules/nvidia-kernel/nv-linux.h:181,
                 from /usr/src/modules/nvidia-kernel/nv.c:14:
include/acpi/acutils.h: At top level:
include/acpi/acutils.h:503: error: expected '=', ',', ';', 'asm' or '__attribute__' before '}' token
include/acpi/acutils.h:506: warning: data definition has no type or storage class
include/acpi/acutils.h:506: warning: type defaults to 'int' in declaration of 'rces'

It could be that someone else get's a totally different error msg, but this is what I got.
Running the clean command before executing the steps in this HOW-TO made me able to compile the new nvidia kernel.

I got the idea from the last msg of this bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=367976
Testing (server) + Unstable (workstation) 32-bit on AMD Athlon64 X2
didi
 
Posts: 909
Joined: 2007-12-04 16:26
Location: the Netherlands

Postby jongi » 2009-03-29 18:20

When I try to build with m-a a-i -t -k /usr/src/linux-headers-$(uname -r) -l $(uname -r) nvidia, the build fails with the below:

Code: Select all
make[4]: *** [/usr/src/modules/nvidia-kernel/nv.o] Error 1
make[3]: *** [_module_/usr/src/modules/nvidia-kernel] Error 2
make[3]: Leaving directory `/usr/src/linux-headers-2.6.28.9'
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[2]: *** [module] Error 1
make[2]: Leaving directory `/usr/src/modules/nvidia-kernel'
make[1]: *** [build-stamp] Error 2
make[1]: Leaving directory `/usr/src/modules/nvidia-kernel'
make: *** [kdist_image] Error 2


Full log here

This has happened with kernel 2.6.29 from the unstable repo and with a self compiled 2.6.28.9 kernel.
Desktop: Debian (Sid) 64-bit, Gentoo 64-bit and Ubuntu Jaunty 64-bit
Laptop: Gentoo 32-bit
MythTV: Debian (Testing) 32-bit
jongi
 
Posts: 477
Joined: 2007-04-15 02:41

Postby didi » 2009-03-29 18:48

2.6.29 is missing a file in the kernel/linux headers: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521472

As for your custom kernel compile error, did you try "m-a clean nvidia" before starting the procedure? It fixed issues with me (see post above yours).
Testing (server) + Unstable (workstation) 32-bit on AMD Athlon64 X2
didi
 
Posts: 909
Joined: 2007-12-04 16:26
Location: the Netherlands

PreviousNext

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable