-
NVidia drivers with knoppix
Hi.
I've just finished a custom knoppix remastering with the nvidia drivers enabled (with autodetection).
If someone is interested, here's the complete procedure, step by step.
First of all change into the source chroot environment as described in the KnoppixRemasteringHowto.
Make sure some basic development packages are installed in the
chrooted environment (gcc, make, kernel-headers, dpkg-dev...).
Then download the nvidia source debs and build the binary debs following these steps:
* Download the latest nvidia source debs (the newest are in debian unstable):
http://packages.debian.org/unstable/...ernel-src.html
http://packages.debian.org/unstable/...a-glx-src.html
(nvidia-kernel-src_1.0.4191-2_i386.deb and nvidia-glx-src_1.0.4191-1_i386.deb)
* Build the binary kernel module (in the chrooted environment)
# dpkg -i nvidia-kernel-src_1.0.4191-2_i386.deb
# export KSRC=/usr/src/linux
# export KVERS=2.4.20-xfs
# cd /usr/src
# tar zxvf nvidia-kernel-src.tar.gz
# cd modules/nvidia-kernel-1.0.4191
# debian/rules binary_modules
Now, if you want, it is possible to apply a tweak. Edit NVIDIA_kernel-1.0.4191/os-registry.c
and set NVreg_EnableAGPSBA and NVreg_EnableAGPFW to 1, then run
debian/rules binary_modules again.
* Build nvidia-glx
# dpkg -i nvidia-glx-src_1.0.4191-1_i386.deb
# cd /usr/src/nvidia-glx_1.0.4191
# dpkg-buildpackage -us -uc
If all went well you can install the binary debs now (still in the chrooted environment).
# dpkg -i nvidia-kernel-2.4.20-xfs_1.0.4191-2+_i386.deb
# dpkg -i nvidia-glx_1.0.4191-1_i386.deb
To clean up you can remove the source debs as they are no longer necessary (dpkg -P).
If the Linux kernel is replaced you also have to rebuild nvidia-kernel-src after the new kernel is installed
(if the kernel versionnumber is the same then it's enough to just
reinstall the binary nvidia-kernel deb).
--
Now to the fun part. Hack Klaus knopper's scripts to use the nvidia module
instead of nv for all graphic cards supported by the nvidia driver.
Basically here is what I changed:
In the file /usr/share/hwdata/Cards replace "DRIVER nv" with "DRIVER nvidia" for all
supported cards (RIVA TNT, RIVA TNT2, RIVA Ultra TNT2, NVIDIA GeForce, NVIDIA GeForce 256
(generic), NVIDIA GeForce DDR (generic), NVIDIA GeForce 2 (generic), NVIDIA GeForce 3 (generic),
NVIDIA GeForce 4 (generic), NVIDIA Quadro 4 (generic)). Also, if it exists, remove the
line "SERVER SVGA" for the cards that use the nvidia driver. Leave RIVA128 with the nv
driver, the RIVA128 cards are not supported by the nvidia driver.
In the file /usr/share/hwdata/pcitable change the strings "Server:XFree86(nv)"
to "Server:XFree86(nvidia)" for all supported pci id's (there are also a couple of
"Server:XFree86(vesa)" lines that can be changed to nvidia). Look at the linux driver
page at nvidias homepage for a list of pci id's that are supported by the driver,
http://download.nvidia.com/XFree86_40/1.0-4191/README, the list is in APPENDIX A.
To make these chages the "correct" way, download the source for hwdata-knoppix from
http://www.knopper.net/knoppix/sources/, unpack (tar zxvf hwdata-knoppix_x.y-z.tar.gz), edit
the files (Cards and pcitable) and rebuild the .deb package with the command:
# debian/rules binary
Then you can install the .deb inside the chrooted environment with dpkg -i.
Well now you would think it's done, but not yet. The nvidia driver needs a change in the file
/etc/X11/XF86Config-4. In Section "Module", comment out the lines Load "GLcore" and
Load "dri" by putting a # sign at the beginning of those two lines.
This change should actually be done in the file /etc/X11/XF86Config-4.in.
To build a modified .deb that does this, download the source for xf86config-knoppix.
Unpack and hack the script mkxf86config.sh so that the # sign is inserted at the
beginning of the lines (Load "GLcore" and Load "dri") _ONLY_ if the variable $XMODULE
is equal to nvidia. Then rebuild as usual
# debian/rules binary
and install inside the chrooted environment (dpkg -i).
The change in mkxf86config.sh is a little tricky, but it can be made, for example, like this:
Find the line SWCURSOR="" (somewhere around line 27. Between the SWCURSOR="" line and the
"sed -e" lines, insert the following 7 lines:
Code:
# Remove GLcore and dri modules if the nvidia driver is used
NVGLCORE=""
NVDRI=""
if [ "$XMODULE" = "nvidia" ]; then
NVGLCORE='s|^.*Load.*"GLcore".*$|#Load "GLcore"|g;'
NVDRI='s|^.*Load.*"dri".*$|#Load "dri"|g;'
fi
and a couple of lines down, among the sed -e lines, find the line
Code:
-e 's|@@XMODULE@@|'"$XMODULE"'|g;'"$VMWARE""$SERIALMOUSE""$USBMOUSE""$PSMOUSE""$SWCURSOR""$WHEEL" \
and add "$NVGLCORE""$NVDRI" to it:
Code:
-e 's|@@XMODULE@@|'"$XMODULE"'|g;'"$VMWARE""$SERIALMOUSE""$USBMOUSE""$PSMOUSE""$SWCURSOR""$WHEEL""$NVGLCORE""$NVDRI" \
That's all, now you should be able to enjoy autodetected hardware-accellerated OpenGL with
NVidia cards and KNOPPIX!
This procedure worked for me and it should work for all cards supported by the nvidia driver.
The license on the nvidia driver is a bit messy though so I don't think these changes, with
a pre-compiled version of the nvidia drivers, can go into a distribution, but that's another
story...
Best Regards!
/Albert "underland" Veli
-
Senior Member
registered user
Good work, did about the same for the M-game cd, save for the autodetection, which i must say you solved very nicely!
However, i was wondering if this also lets the mesa software drivers peacefully co-exist with the nvidia glx drivers, as this was the big problem i ran into (and needed trans to fix).
Anyway, would you mind if this was integrated with the morphix base? the licence problem isn't that bad, there is an exception for linux-based software. Oh well, good stuff
-
Ok, so as I see it, you have to do a LOT of things to get nvidia drivers to work...
First of all... I'd like to think this could all be simpler, but probably I'm wrong then...
Then, if it really is this hard, could anybody getting the nvidia drivers to work just make a simple script or something ?
A lot of people just don't bother using the nvidia-drivers because of this apparent knowledge you're supposed to have...
-
Originally Posted by
Alextreme
However, i was wondering if this also lets the mesa software drivers peacefully co-exist with the nvidia glx drivers, as this was the big problem i ran into (and needed trans to fix).
Don't know about that. But perhaps the mesa software drivers somehow
are used if GLcore and dri are loaded by X. Those lines are only removed
at boot if the driver is nvidia. Perhaps that solves it.
I tried the modified Knoppix CD with a computer with a NVidia card and
glxinfo said: direct rendering: Yes. And when I tried it with
another computer with a i810 chip, then it says that Mesa OpenGL is used.
Edited You're right. There seems to be a collision between nvidia-glx and xlibmesa3. I'll investigate it and see if it's possible to
get around it with some boot-script magic...
The files thats causing trouble is /usr/lib/libGL.so.1*
and /usr/X11R6/lib/libGL.so.1*
Perhaps it's possible to make a script that copies the right files at boot
depending on if a nvidia card was detected or not...
Originally Posted by
Alextreme
Anyway, would you mind if this was integrated with the morphix base? the licence problem isn't that bad, there is an exception for linux-based software. Oh well, good stuff
Sure do whatever you like with it. I'm no license expert
And thanx for the compliment
I just made the CD as en experiment to see if it is possible to run
Quake III from a live Linux CD (even without a harddisk). The answer
is YES!!! And Q3 even gives better FPS running from the Live CD
than it does with Windows XP on the same computer
By the way. The sources at knopper.net are not the latest.
But it's possible to use them as a base, and then copy the latest
files from a machine running the latest official Knoppix CD (3.2).
For example, hwdata-knoppix seems to change fast. It's also possible to
do a dpkg-repack to rebuild a .deb from a running system.
But sometimes there are some troubles with symbolic links to /KNOPPIX
when dpkg-repack is used...
Originally Posted by
MichieloZ
First of all... I'd like to think this could all be simpler, but probably I'm wrong then...
Then, if it really is this hard, could anybody getting the nvidia drivers to work just make a simple script or something ?
A lot of people just don't bother using the nvidia-drivers because of this apparent knowledge you're supposed to have...
I agree that these changes are pretty complicated and that a script would make it
easier. Its really enough if one person creates the modified .deb files and makes them available. Or perhaps even better, makes the whole CD iso available (like morphix)
But the libGL collision has to be solved first. Too bad they are in read-only...
How does this trans stuff work?
-
Senior Member
registered user
-
been trying to talk about this in other threads but it's not taken off, this one seems t ohavea while back so maybe people will return..
just thoguht i'd add sometihng aay dug up, redistribution seems possable for nvidia's linux drivers.
someone _please_ sort out a knoppix install script like the recent alsa driver that is works with knoppix boot cd and persistent home dir..
"Linux Exception. Notwithstanding the foregoing terms of Section 2.1.1, SOFTWARE designed exclusively for use on the Linux operating system may be copied and redistributed, provided that the binary files thereof are not modified in any way (except for unzipping of compressed files)."
The entire license agreement is here: http://nvidia.com/view.asp?IO=nv_swlicense"
(ta again aay )
:roll:
-
More NVidia tips
Originally Posted by
Yakumo
someone _please_ sort out a knoppix install script like the recent alsa driver that is works with knoppix boot cd and persistent home dir..
Well I finally got it working on my custom remastering. The first part is easy
just do like I described in the earlier post and then spread the custimized .deb files. The hard part is the collision between nvidia-glx and xlibmesa3. I solved it by manually creating some symbolic links. But to make it a deb you have
to mess with diversions, preferably in nvidia-glx.
The files that collide are in:
/usr/X11R6/lib/modules/extensions
So I copied that directory to /usr/X11R6/lib/modules/extensions-org
Then I installed the nvidia-glx .deb. After that I moved the new /usr/X11R6/lib/modules/extensions to /usr/X11R6/lib/modules/extensions-nvidia.
Then I made /usr/X11R6/lib/modules/extensions a symbolic link to
/var/lib/extensions (/var/lib is in writeable ramdisk)
At boot /var/lib/extensions is made a symbolic link to either /usr/X11R6/lib/modules/extensions-org or /usr/X11R6/lib/modules/extensions-nvidia depending on what graphic card was detected.
The second collission is the /usr/lib/libGL.so.1*.
I copied them to a new directory called /usr/lib/libGL-org.
Then I installed nvidia-glx and after that I moved the nvidia libGL.so.1* files to a new directory called /usr/lib/libGL-nvidia.
The nvidia libGLcore.so.1* should also go into that directory.
Then at boot (in the same script as before, /usr/sbin/mkxf86config) I did a
echo "/usr/lib/ligGL-nvidia" >> /etc/ld.so.conf
if a nvidia card was detected or else a
echo "/usr/lib/ligGL-org" >> /etc/ld.so.conf
and at last a ldconfig.
This could all be made automatic by fixing a modified xf86config-knoppix-nvidia deb and a modified nvidia-glx deb. I have fixed the first one but I don't know
how to fix the diversions in the second one...
/Albert
-
well keep posting, some of us dont have your linux knowledge, or the vast amount of HD space you need (& knoppix HD isntall in the first place) to remaster our own CD's :)
good luck sorting those last bits out.
-
Junior Member
registered user
Re: More NVidia tips
Originally Posted by
underland
Then at boot (in the same script as before, /usr/sbin/mkxf86config) I did a
echo "/usr/lib/ligGL-nvidia" >> /etc/ld.so.conf
if a nvidia card was detected or else a
echo "/usr/lib/ligGL-org" >> /etc/ld.so.conf
and at last a ldconfig.
This could all be made automatic by fixing a modified xf86config-knoppix-nvidia deb and a modified nvidia-glx deb. I have fixed the first one but I don't know
how to fix the diversions in the second one...
/Albert
This didn't work for me, as ld.so.conf is on a read-only filesystem. (i.e. it can't be modified)
I think I've got everything else working right, but not this. Maybe a similar /var/lib trick???
(Burning an image trying that method and I'll let you know how it works)
Edit: It works. Might not even have been necessary, turns out the X problems were something else. (Used mismatching versions of XF86Config-4.in and mkxf86config.sh)
Now to figure out why X hangs on my laptop (GeForce4 Go 440) but not on the machine with a TNT2 system in the lab downstairs.
Edit 2: For compatibility reasons, you might want to use the 31.25 drivers instead of 43.49 - 4349 refused to work on my laptop, 3125 works well. SLIGHT chance it could've been a compiler mismatch, but not likely. Don't know about the 41.whatever series drivers.
-
Re: NVidia drivers with knoppix
Originally Posted by
underland
Make sure some basic development packages are installed in the
chrooted environment (gcc, make, kernel-headers, dpkg-dev...).
/Albert "underland" Veli
It's been asked over an over again on this forum, but maybe you'd know :
Where to get the necessary kernel-headers for 2.4.20-xfs kernel ??
I'm trying to do it without those, but with very little succes...
Similar Threads
-
By Kethinov in forum Hdd Install / Debian / Apt
Replies: 3
Last Post: 12-26-2003, 12:54 AM
-
By andrei in forum General Support
Replies: 1
Last Post: 08-15-2003, 10:33 PM
-
By beefthief in forum Hardware & Booting
Replies: 2
Last Post: 07-22-2003, 04:40 AM
-
Replies: 3
Last Post: 03-29-2003, 11:07 PM
-
By rmayer1 in forum Hardware & Booting
Replies: 1
Last Post: 02-09-2003, 11:30 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Apple Macintosh PowerBook 180 Vintage Laptop | Retro Computer
$149.95
Apple Macintosh Performa 466 Vintage Computer | SKU 146754
$149.95
Apple 800K External Drive M0131 for vintage Macintosh Japan
$20.00
Vintage Apple M2980 AppleDesign Keyboard - Tested and working - Good condition
$19.75
Vintage Apple Macintosh Plus 1MB Model M0001A - For parts
$91.99
Vintage Apple Macintosh MAC PC MATSUSHITA CR-587-C 24x CD-ROM Drive SCSI 1998
$39.99
VINTAGE APPLE MACINTOSH POWERBOOK 180 ( M4440) Powers On
$100.00
VINTAGE APPLE MACINTOSH POWERBOOK G3 UNTESTED NO POWER CORD
$64.99
Vintage Apple A2M6016 12" Monochrome Monitor
$25.00
Vintage Apple Macintosh PowerBook G3 M4753 w/ Power Adapter
$149.00