LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-12-2021, 11:51 AM   #16
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,776

Rep: Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425

The only remaining legacy nvidia gpu I have is a Quadro FX570M on my ancient T61P Thinkpad. RC2 is working pretty well with just a few issues. I'm running a custom 5.4.164 kernel and the 340.108 nvidia driver. I'm considering trying to go back to the 304x driver because of minor odd behaviours. For one thing, and maybe because I have yet to find the Vert and Horiz data for the 15.4 inch TFT display, but nvidia-settings doesn't show or seem to support the highest resolution of 1920x1200 and GUI appears different from root vs Users (especially positioning) and doesn't directly seem to follow /etc/X11/xorg.conf, eg: if I specify 1920x1200 mode X still starts but reverts to 1680x1050, the maximum displayed in nvidia-settings menu.

There are workarounds that get me by as long as I'm willing to accept the slightly lower resolution on the TFT. The Quadro even with that 340.108 driver will do even higher resolution than 1920x1200 on an extension monitor with a HDMI converter dongle, so I know it isn't the Quadro at fault and possibly not even the 340.108 but more the TFT specs in xorg.conf, and nvidia-settings on 340x doesn't show the "Get EDID" menuitem.

Anyway, it works for as little as I use a laptop so it isn't urgent but I will be watching this thread. The only somewhat urgent need is fan control which I am struggling with despite using the latest (1.21?) Thinkfan with a modified SBO script.

EDIT - Thinkfan working beautifully thanks to vonbiber on LQN. Also, dual monitors now working very well on RC2 w/ 5.4.164 and 340.108.

Last edited by enorbet; 12-14-2021 at 06:12 PM.
 
Old 12-19-2021, 12:32 PM   #17
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Smile UPDATE: progress continues...

While I've had the nvidia-legacy304 scripts working for a couple of months now, I continue to make some small tweaks/refinements as we get closer to Slackware 15 becoming official.

My latest update has been to implement a "cleansing" function to clean up the kernel source tree after building the nvidia kernel module, if requested by the user. (This is to ensure that no stale files are left behind so that when the user next uses "slackpkg upgrade kernel-source" (or equivalent,) the old source tree will be removed fully.)

In addition, I added patches to the xorg-server-legacy119 SlackBuild to address two CVEs and added elogind support by default. (These are the same changes that PV recently implemented in his rebuilt xorg-servers for 14.2 and -current.)

As I write this, I am compiling the nvidia304 kernel module on -current w/ kernel 5.15.10 to test the new "cleanse" function. Once 5.15.11 drops, I'll do one more test run, and if all goes well, I may post the text of the SlackBuild here for feedback.
 
1 members found this post helpful.
Old 12-26-2021, 07:15 PM   #18
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
nvidia-legacy304-driver

As promised, here is a sneak preview of the revised nvidia-legacy304 SlackBuilds for Slackware 15.0.

Feedback appreciated.

Don't forget that in order to use these drivers w/ Slackware 15, you must downgrade Xorg server to 1.18 or 1.19.

PS. Download links for nvidia source are in the .info file.

README:
Code:
This is the proprietary binary video driver from nVidia for the X.Org
X-server. This package does not include the kernel-module - it is a part
of the nvidia-kernel package at SlackBuilds.org.

Since this nvidia-driver conflicts with some files of xorg, it's a bit
complex to install/uninstall the driver. However, as of Slackware 15,
this complexity is handled automatically by this SlackBuild and
Slackware's default package tools.

The script determines how to proceed based on Slackware's major version
number via the $SLK_MAJ_VERSION environment variable.  Setting this
variable on the command line will override this script's auto-detection.

E.g., if the user is building on a Slackware 15 system, then the
following command line:

    SLK_MAJ_VERSION=14 ./nvidia-legacy304-driver.SlackBuild

will force the script to build the driver package for Slackware 14.x.

If building/installing for Slackware 14.2 or earlier, please see the
README.uninstall file for important information.

If building on a 64-bit system, setting the $COMPAT32 environment
variable to "yes" on the command line will add optional 32-bit support.
(UNTESTED!)

Requires:  nvidia-kernel, xorg-server-legacy119
Attached Files
File Type: txt 001-sysctl-5.5.patch.txt (883 Bytes, 22 views)
File Type: txt doinst.sh.txt (195 Bytes, 13 views)
File Type: txt nvidia-legacy304-driver.SlackBuild.txt (12.5 KB, 14 views)
File Type: txt nvidia-legacy304-driver.info.txt (1.3 KB, 14 views)
 
1 members found this post helpful.
Old 12-26-2021, 07:23 PM   #19
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
nvidia-legacy304-kernel

And here is the revised SlackBuild for the nvidia304 kernel module.

nvidia source downloads:
32-bit is here.
64-bit is here.

README:
Code:
This is a kernel-module needed by the proprietary binary nvidia driver.
You also need the nvidia-legacy304-driver package from SlackBuilds.org.

To build the package for a kernel different from the running one,
start the script setting the KERNEL variable, as in

    KERNEL=4.4.14 ./nvidia-legacy304-kernel.SlackBuild

A default config file is placed at
/usr/share/X11/xorg.conf.d/10-nvidia.conf to make sure that X loads the
nvidia module.  If you need to make changes, copy that file to
/etc/X11/xorg.conf.d/ and edit the copy.

This module requires that the "native_write_cr4" function be present,
(both at build-time and run-time.)  Starting with kernel v5.8,
this function is available if and only if the kernel is compiled with
"CONFIG_LKDTM=m".  If building for kernels 5.8 or higher, the script
will search for the LKDTM kernel module automatically.

If found, the nVidia kernel module will be built straight away.
But since LKDTM is disabled in the stock Slackware kernels, this script
is prepared to build such a kernel for the user, upon request.

Please see README.kernel for details.

The xf86-video-nouveau-blacklist package from /extra is required.
README.kernel
Code:
Since the nVidia kernel module requires the presence of the LKDTM kernel
module, which is disabled in the stock Slackware kernels, this script
is prepared to auto-build a compatible kernel for the user via the
$AUTO_KERN environment variable.  (Needed only for kernels 5.8 and up.)

Please see https://docs.kernel.org/fault-injection/provoke-crashes.html
for more information about this module.

Setting $AUTO_KERN will prompt the script to look for an appropriate
kernel config file and build LKDTM-enabled kernel package(s) based on
that configuration.

(The script assumes the kernel source tree is in the default location:
"/usr/src/linux-$KERNEL".  This can be overridden by setting $SRCPATH
environment variable.)

Valid options for $AUTO_KERN are listed below:

  AUTO_KERN=huge
  AUTO_KERN=generic
  AUTO_KERN=both
  AUTO_KERN=custom
  AUTO_KERN=y
  AUTO_KERN=all


##### CONFIG PATHS ####
The default is to search in the /boot directory for config file(s).
Set $CONFIG_PATH variable on the command line to override.  E.g.,

  CONFIG_PATH=/home/myself/myconfigs AUTO_KERN=huge \
    KERNEL=5.14.9 ./nvidia-legacy304-kernel.SlackBuild


##### CUSTOM CONFIGS ####
You can pass an absolute path to a specific config file using
$CUSTOM_CONFIG.  E.g.,

  CUSTOM_CONFIG=/home/myself/myconfigfile AUTO_KERN=huge \
    KERNEL=5.14.9 ./nvidia-legacy304-kernel.SlackBuild

(If you use AUTO_KERN=custom without specifying a config file, the
script will look for a file named ".config" in the kernel source tree.)


#### USING THE Y OPTION ####
When using AUTO_KERN=y, the script searches $CONFIG_PATH and $SRCPATH
for a standard Slackware config file, and uses the first one it finds,
preferring huge to generic.  You can also specify a config file using
$CUSTOM_CONFIG, as described above.


#### OPTIONAL MODULES & HEADERS PACKAGES ####
When using AUTO_KERN=all, the script will build kernel-modules and
kernel-headers packages in addition to the huge and generic kernel
packages.

Setting $MODULES and/or $HEADERS to anything on the command line will
prompt this script to build those packages when using an $AUTO_KERN
option other than "all."

E.g., to build a kernel-modules package in addition to kernel-generic:

  MODULES=y AUTO_KERN=generic KERNEL=5.14.9 \
    ./nvidia-legacy304-kernel.SlackBuild


#### POST-BUILD CLEANING ####
After all builds have been completed, this script will perform a clean-
up operation on the source tree.  This is to ensure that when next
upgrading the Slackware kernel-source package, all traces of the old
kernel-source package will be removed.

Setting the environment variable $NO_CLEAN to anything on the command
line will forego this post-build clean-up.  E.g.,

  NO_CLEAN=y AUTO_KERN=all KERNEL=5.14.9 \
    ./nvidia-legacy304-kernel.SlackBuild


#### INSTALLATION ####
As always when installing/updating kernel images, don't forget to update
your boot loader (lilo, etc.) and any initrd image, as applicable.
Note: No need to specify "lkdtm" when calling Slackware's mkinitrd
script with these kernels: just use -k <version number>, as before.
EDIT: attachments removed. See next post.

Last edited by JayByrd; 01-03-2022 at 11:00 AM.
 
Old 01-03-2022, 11:02 AM   #20
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Here is the (hopefully) final version of the nvidia-legacy304-kernel SlackBuild. I think I've worked out all the kinks...

(Links to the nvidia source are in post #19 above.)

Testing and feedback appreciated.

EDIT: attachment removed. (see next post.)

Last edited by JayByrd; 01-16-2022 at 03:37 PM.
 
1 members found this post helpful.
Old 01-16-2022, 03:39 PM   #21
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
To whom it may concern:

Here is the latest version of the nvidia-legacy304-kernel SlackBuild. (It includes a new patch needed for building on kernel 5.16+.)

EDIT: attachment removed, as I investigate kernel 5.10 build failures.

Last edited by JayByrd; 01-22-2022 at 10:12 PM.
 
1 members found this post helpful.
Old 01-16-2022, 08:06 PM   #22
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,651

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
can you push a PR/MR to SBo repository in github/gitlab?
 
Old 01-17-2022, 02:16 AM   #23
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Quote:
Originally Posted by willysr View Post
can you push a PR/MR to SBo repository in github/gitlab?
It appears I cannot. The button for "Create a pull request" is greyed out.

I'm assuming that's because I don't have an account there, and I'm not exactly eager to sign up for one.
 
Old 01-20-2022, 05:33 PM   #24
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Hit a snag today when trying to build the 304 kernel module for kernel 5.10.x.

I've successfully built the module using this same script with 4.4.x, 5.13.x, 5.14.x, 5.15.x, and 5.16.x, but this was my first try with 5.10.

The build encounters a fatal error, saying that the file <drm/drm_pci.h> doesn't exist. This is puzzling, as that file doesn't exist on 4.4 or 5.15 or 5.16 either...

I'm continuing to search for the answer and will report back if and when I find anything.

EDIT: According to the kernel changelogs, this file was removed in kernel 5.8. Yet, I can find no trace of it in my 14.2 system running kernel 4.4.276... And if this file no longer exists, as of 5.8, why does the build not fail on 5.13+??? I'm stumped--for now!

Last edited by JayByrd; 01-20-2022 at 05:38 PM.
 
Old 01-20-2022, 08:09 PM   #25
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,651

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
Quote:
Originally Posted by JayByrd View Post
It appears I cannot. The button for "Create a pull request" is greyed out.

I'm assuming that's because I don't have an account there, and I'm not exactly eager to sign up for one.
yes, the PR/MR is only available when you have an account in github/gitlab
 
Old 01-23-2022, 12:15 PM   #26
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
nvidia-legacy304 works again... ;-)

Quote:
Originally Posted by JayByrd View Post
Hit a snag today when trying to build the 304 kernel module for kernel 5.10.x....
OK, I found the cause of the build failures on kernel 5.10, and have addressed it. (It turns out that one of the patches I harvested from github was responsible.)

I'm still a bit mystified as to why the deleterious effects did not appear on 4.4, 5.4, or 5.13+ kernels--only on 5.10! In any event, after modifying the patching procedure, I conducted extensive build testing on various kernels, and all came off without a hitch. I've now used the attached build script successfully on the following kernels: 4.4, 4.9, 4.14, 5.4, 5.10, 5.13, 5.14, 5.15, and 5.16. We should be good to go!

Attached are the updated build scripts for the legacy nvidia 304 driver and kernel module and xorg-server 1.19. (Note: I have incorporated the same security patches that PV included for the xorg-server and also the option that he added in December for building "rootless" xorg. See the included configure.script for details.)

Testing/feedback appreciated. (Particularly runtime functionality. I've successfully built the kernel module on all the kernels listed above, but my runtime tests were limited to 4.4 and 5.10+.)

EDIT: build script for nvidia kernel module removed. New version available in post #28.
Attached Files
File Type: txt xorg-server-legacy119.tar.gz.txt (20.9 KB, 51 views)
File Type: txt nvidia-legacy304-driver.tar.gz.txt (7.9 KB, 48 views)

Last edited by JayByrd; 02-06-2022 at 11:10 AM.
 
2 members found this post helpful.
Old 01-29-2022, 12:30 PM   #27
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Unhappy Well, fiddlesticks!!

Yesterday, I decided to try my kernel module build on a "rc" kernel for the first time (5.17-rc1), and learned a couple things:

1. Had to add yet another patch due to a "implicit-function-declaration" compilation error on 5.17.

2. Another naming convention caveat: even though the kernel-source*.t?z package extracts to "linux-5.17", the $KERNEL passed to the script must be called "5.17.0-rc1". (This might not be news to most, but seeing as how I'm relatively new to this "roll-your-own" thing, it's been quite the education.)

As to #1, the problem was introduced due to this commit. Just a heads-up that this may apply to newer versions of the nvidia.ko kernel module, as well. The patch I applied was actually designed for nvidia-470. See here. (Thanks to joanbm!)

Issue #2 has me contemplating adding a "README.caveats" file to my SlackBuild to cover the cases of "point-zero" and "rc" kernels.

Also, when I started this endeavor of updating nvidia-304 to build on 5.8+ kernels, I was assuming that either:
Code:
a) The kernel in question would be a stock Slackware kernel-source package.
or
b) The kernel-source tree in question had been pre-configured, a la Slackware's official kernel-source.SlackBuild script, (or similar.)
I've since discovered that my script fails in the case of an un-configured source tree--e.g., a freshly extracted source tarball from kernel.org--unless the user sets the $MODULES environment variable when calling the script. If $MODULES is set, everything builds fine.

This fact has me contemplating the addition to my script of functionality to build a Slackware-style kernel-source package, as well.

In any event, I plan to keep on testing (and learning,) and when I feel I've ironed out all the kinks for building against kernel 5.17, I'll post the updated SlackBuild.

Last edited by JayByrd; 02-05-2022 at 05:56 PM. Reason: minor detail.
 
Old 02-06-2022, 11:17 AM   #28
JayByrd
Member
 
Registered: Aug 2021
Location: Seattle, WA
Distribution: Slackware
Posts: 300

Original Poster
Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
OK, after much testing, I think the latest version of the nvidia-legacy304-kernel build script is ready. Changes include:
Code:
New patch for 5.17 kernels.
Added functionality to create a kernel-source package, at the user's discretion.
Updated README, README.kernel, and Changelog.
Testing/feedback appreciated. (The build scripts for the binary nvidia driver and the xorg-server-legacy packages are unchanged, and can be found in post #26.)
Attached Files
File Type: txt nvidia-legacy304-kernel.tar.gz.txt (26.8 KB, 115 views)
 
Old 08-15-2022, 01:42 AM   #29
RodoSlav
LQ Newbie
 
Registered: Aug 2022
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
Will there be a solution for Slackware 15.0 and Xorg 1.20?
 
Old 08-15-2022, 07:41 AM   #30
TorC
Member
 
Registered: Dec 2020
Location: as far S and E as I want to go in the U.S.
Distribution: Fossapup64
Posts: 224

Rep: Reputation: 78
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?
 
1 members found this post helpful.
  


Reply

Tags
nvidia, nvidia 304.137


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] nvidia-legacy304 compat32 Bad Blue Bull Slackware 9 10-04-2017 06:09 PM
SBo: nvidia-legacy304-driver-304.125-x86_64-1 lopuh Slackware 2 02-18-2015 01:01 AM
Howto install nvidia-legacy304 on a 14.1 multilib system? moesasji Slackware 3 09-06-2014 09:13 AM
(EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module! Stan the caddy Linux - Hardware 8 01-18-2004 04:21 PM
(EE) NVIDIA (0) Failed to initialize the NVIDIA kernel module Isjhe Mandriva 14 09-25-2003 09:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration