LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   nvidia-legacy304-kernel on -current (https://www.linuxquestions.org/questions/slackware-14/nvidia-legacy304-kernel-on-current-4175700054/)

JayByrd 08-18-2022 10:49 AM

Quote:

Originally Posted by RodoSlav (Post 6373787)
Will there be a solution for Slackware 15.0 and Xorg 1.20?

This thread contains the solution for Slackware 15. As to Xorg 1.20, please review post #6 of this thread.

If you want to keep using the proprietary nVidia304 driver, you must use Xorg 1.19. I provided a SlackBuild script for Xorg 1.19.7 (w/ security patches) in post #26.

JayByrd 08-18-2022 11:00 AM

Quote:

Originally Posted by TorC (Post 6373828)
Thanks, @JayByrd! Now I am able to hrun Slackware15 and have nVidea graphics on an old Latitude D610 I stashed in storage and considered unusable!

BTW, which nVidea graphics prompted you to do this?

You're quite welcome, Tor.

I embarked on this project a couple of years ago when I found that the nvidia304 driver available on SBo had been orphaned. Although it was unmaintained, it worked perfectly for me on Slackware 14.2.

But then, one day, after a kernel update, I could no longer get the nvidia kernel module to compile. I was able to track down the "bad" nvidia code and created a patch for it. (Turns out, it was a bit of 4.6 kernel code that got back-ported to the 4.4 branch starting at kernel version 4.4.168.)

In my case, the nVidia card in question is a Quadro FX 3500. I have two Dell Precision 490 desktops that came with this card pre-installed. When first released in 2006, this nVidia card cost $1600! I couldn't bear to consign $3200 to the landfill, just because of an orphaned driver, so I decided to try to keep it going.

I'm just glad that someone has found my efforts helpful.:)

TorC 08-18-2022 05:27 PM

Interesting story -- thanks.

The Latitude D610 and D810 I ran for years learning Linux had Quadro cards, too. Traded the 810 for an old Buck folding knife and was kinda bummed when newer kernel issues with the hardware arose, as you stated. Now I can get it running and give it to a grandkid to explore.

Lived on Wallingford Av N at about 85th for a time. Went to a LUG there at Seattle U (I think) and one of the Libraries a couple times and then it went caput, I guess.

Came to SW Sep 2018.

Best wishes!

nimagp 08-23-2022 04:29 PM

This project is great!
Just wanted to ask that is this possible to use these patches in debian based distros? (Linux mint for instance)
I guess I can manage to compile kernel myself, and the Xorg 1.19 is already at ubuntu focal repositories, but what about the driver itself?
Thanks a lot.

JayByrd 08-24-2022 09:19 AM

Quote:

Originally Posted by nimagp (Post 6375703)
This project is great!
Just wanted to ask that is this possible to use these patches in debian based distros?(Linux mint for instance)
I guess I can manage to compile kernel myself, and the Xorg 1.19 is already at ubuntu focal repositories, but what about the driver itself?
Thanks a lot.

Yes, the patches included in my SlackBuild should work on just about any distro. The patches themselves are about bringing nVidia's original code into line with new kernels (up to 5.17), nothing distro-specific.

Before you re-compile your kernel, be sure to review both README files (post ). Just remember that in order for this old-arse nVidia code to work on kernels 5.8 and above, you must compile the kernel with "CONFIG_LKDTM=m". (My build script is prepared to do that automatically, but that part is Slackware-centric. ;))

Good luck.

nimagp 08-24-2022 03:01 PM

Quote:

Originally Posted by JayByrd (Post 6375860)
Yes, the patches included in my SlackBuild should work on just about any distro. The patches themselves are about bringing nVidia's original code into line with new kernels (up to 5.17), nothing distro-specific.

Before you re-compile your kernel, be sure to review both README files (post ). Just remember that in order for this old-arse nVidia code to work on kernels 5.8 and above, you must compile the kernel with "CONFIG_LKDTM=m". (My build script is prepared to do that automatically, but that part is Slackware-centric. ;))

Good luck.

Thanks a lot. You just saved an antique graphic card. :)
But some questions, the steps are just compiling the kernel, installing xorg 1.19.xx and applying the patches?
And is it OK if I use ubuntu provided source code for kernel? (It already has drivers and general modules)

Thanks again

JayByrd 08-26-2022 12:09 PM

Quote:

Originally Posted by nimagp (Post 6375919)
...But some questions, the steps are just compiling the kernel, installing xorg 1.19.xx and applying the patches?

Yes. Switch Xorg from your current version to version 1.19.7.

Then, after setting "CONFIG_LKDTM=m" in your kernel config, you are looking at commands something like the following:
Code:

cd ${KERNEL_SOURCE_DIRECTORY}
make clean
make
make modules

And then, do the patching of the nVidia code:
Code:

cd ${NVIDIA_SOURCE_DIRECTORY}
# Apply patches
for file in $CWD/patches/*.gz ; do
  zcat $file | patch -p1 --verbose
done

Last, after patching, build the nvidia kernel module:
Code:

cd ${NVIDIA_SOURCE_DIRECTORY}/kernel
# Build nvidia.
echo "Building module \"nvidia.ko\" ..."
make SYSSRC=/usr/src/kernel-${KERNEL} module || exit 1

(Adjusting paths accordingly, of course.)

Quote:

Originally Posted by nimagp (Post 6375919)
And is it OK if I use ubuntu provided source code for kernel?...

I don't see why not... Just remember to remove/blacklist the nouveau module before attempting to use the resulting nvidia module.

Good luck.

nimagp 08-26-2022 12:50 PM

Thanks :D

henca 09-02-2022 01:44 PM

Thanks for your great work!

It seems to be a minor typo in nvidia-legacy340-driver.info at slackbuilds.org :

Code:

MD5SUM_x86_64="28a7ec013c4ef657d3e9b978e2f653c1\
              2f63e63b1c475ed023e3ee31b6ed0116 \
              b76a6500801b96c2296310e17b2e0cdf \

The first line is missing a space before \ causing warnings about failed md5sums.

regards Henrik

willysr 09-03-2022 12:51 PM

thanks, fixed in my branch

JayByrd 11-28-2022 04:19 PM

After letting this project rest for a few months, (my last build was with kernel 5.17.0-rc1,) I've decided to get back on the horse and see if this antique kernel module will compile against newer kernels.

First surprise: I had to move from Slackware 15.0 to -current, because kernel 5.19.17 won't compile with GCC 2.33!

Second surprise: After moving my testing machine from 15.0 to -current, I had no keyboard and mouse functionality under X. Turns out that the newer versions/builds of libinput, xf86-input-libinput, and libwacom don't play nice with xorg-server-legacy119... :(

However, after "downgrading" those three packages to the versions shipped with Slackware 15.0, I'm back in business. I did have to develop a couple of new patches to address compilation issues arising with kernel 5.18, but the nvidia304 kernel module builds and works as ever now on kernel 5.19.17.

If anyone still using these 15+ year-old nvidia cards that require legacy304 drivers wants them, just post here and I'll post the latest patches.

In the meantime, I think I'll have a go at the 6.x kernels now... ;)

LuckyCyborg 11-28-2022 04:58 PM

Quote:

Originally Posted by JayByrd (Post 6394986)
First surprise: I had to move from Slackware 15.0 to -current, because kernel 5.19.17 won't compile with GCC 2.33!

What? My experience differ very much.

Code:

root@darkstar:~# gcc -v
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/11.2.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/11.2.0/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,brig,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=new --disable-libstdcxx-pch --disable-libunwind-exceptions --enable-__cxa_atexit --disable-libssp --enable-gnu-unique-object --enable-plugin --enable-lto --disable-install-libiberty --disable-werror --with-gnu-ld --with-isl --verbose --with-arch-directory=amd64 --disable-gtktest --enable-clocale=gnu --disable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (GCC)
root@darkstar:~# uname -a
Linux darkstar.example.org 5.19.17-custom #1 SMP PREEMPT_DYNAMIC Wed Oct 26 11:31:12 EEST 2022 x86_64 Intel(R) Core(TM) i3-3220T CPU @ 2.80GHz GenuineIntel GNU/Linux
root@darkstar:~#
root@darkstar:~# cat /etc/slackware-version
Slackware 15.0
root@darkstar:~#

Yes, the 5.19.17 builds and works fine in Slackware 15.0 . And 6.0.10 too.

fourtysixandtwo 11-28-2022 05:07 PM

5.19.17 (from -current source) builds just fine on 15.0?

Can you use the legacy340 driver with that card? That slackbuild (no maintainer) includes the patch to build on newer kernels (although I see there's another patch that could be added for 6.x now). If not, someone might be providing the patches for the 304 driver still.

JayByrd 11-28-2022 05:54 PM

Quote:

Originally Posted by fourtysixandtwo (Post 6394996)
5.19.17 (from -current source) builds just fine on 15.0?

Can you use the legacy340 driver with that card? That slackbuild (no maintainer) includes the patch to build on newer kernels (although I see there's another patch that could be added for 6.x now). If not, someone might be providing the patches for the 304 driver still.

No, 340 doesn't work with my card, only 304. The someone is me!--that's the whole point of this thread... Did you not see the part of my post where I said
Quote:

I did have to develop a couple of new patches to address compilation issues arising with kernel 5.18
As to the kernel build issues: whenever I try to build 5.19 kernel on either 14.2 or 15.0, it fails saying something along the lines of "LIBC 2.34 not found!" I thought it was rather strange that I couldn't compile it on 15.0... Is there some build time option I am missing?

fourtysixandtwo 11-28-2022 06:19 PM

Quote:

Originally Posted by JayByrd (Post 6395007)
No, 340 doesn't work with my card, only 304. The someone is me!--that's the whole point of this thread... Did you not see the part of my post where I said

As to the kernel build issues: whenever I try to build 5.19 kernel on either 14.2 or 15.0, it fails saying something along the lines of "LIBC 2.34 not found!" I thought it was rather strange that I couldn't compile it on 15.0... Is there some build time option I am missing?

I didn't go back and read the whole thread :)

The only time I've seen that kind of message was if I was using a kernel (edit: and it's source) that was compiled with the newer glibc, booted on an older glibc system, and then tried to compile something. You weren't running a kernel downloaded from or complied on -current are you?


All times are GMT -5. The time now is 10:18 AM.