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 09-10-2019, 10:22 AM   #1
SaabGripen
LQ Newbie
 
Registered: Sep 2018
Distribution: Slackware
Posts: 7

Rep: Reputation: Disabled
Slackware 14.2x86 stable Cannot build nvidia kernel module


Hello!
My GPU is GeForce G102M, proprietary driver version 340.107, system - Slackware 14.2 stable, 32 bit.

Now I'm using kernel 4.4.157, and there's no problem with nvidia driver. Yesterday I installed a new kernel version - 4.4.190 including sources and headers, but the driver installer refuses to build module. In the interface it says:

"ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it."

At first I looked for files
/usr/src/linux-4.4.190/include/generated/autoconf.h and the second one, and found out there were both of them in the right place.

make oldconfig && make prepare didn't help, neither did README on nvidia download page.

In the /var/log/nvidia-installer.log I found some errors:
-Werror-implicit-function-declaration;
-Werror=implicit-int;
-Werror=strict-prototypes etc.

Does it require any patch or what should I do?

Sorry, I couldn't attach my logfile for its size exceeded the forum's limit.
 
Old 09-10-2019, 11:39 AM   #2
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 597

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
I'm running nVidia 340.107 under -current64 and I have been able to build the kernel modules by adding the following line to the SlackBuild-script:
Code:
#!/bin/sh
PRGNAM=nvidia-legacy340-kernel
VERSION=${VERSION:-340.107}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
KERNEL=${KERNEL:-$(uname -r)}
KERNELPATH=${KERNELPATH:-/lib/modules/${KERNEL}/build}
PKGVER=${VERSION}_$(echo $KERNEL | tr - _)
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi
if [ "$ARCH" = "i586" ]; then
  TARGET="x86"
  SRCSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  TARGET="x86"
  SRCSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  TARGET="x86_64"
fi
unset ARCH
SRCNAM=NVIDIA-Linux-$TARGET-${VERSION}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=${PKG:-$TMP/package-$PRGNAM}
OUTPUT=${OUTPUT:-/tmp}
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
rm -rf $SRCNAM
sh $CWD/$SRCNAM.run --extract-only || exit 1
cd $SRCNAM || exit 1
#Patch needed for kernel 4.4.168 and above:
#patch -p0 < kernel-4.4.168.patch
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
(cd kernel || exit 1
  make SYSSRC=$KERNELPATH module || exit 1
  cd uvm
  sed -i "s|-O2$|-O2 -Wno-error=incompatible-pointer-types|" Makefile
  make SYSSRC=$KERNELPATH module || exit 1
)
mkdir -p $PKG/lib/modules/$KERNEL/kernel/drivers/video
install -m 0664 kernel/nvidia.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
install -m 0664 kernel/uvm/nvidia-uvm.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
# Make sure the X is specified to automagically load the
# correct driver, since I always forget. You can remove
# this file if you have an equivilent entry in /etc/X11/xorg.d
mkdir -p $PKG/usr/share/X11/xorg.conf.d/
cat $CWD/10-nvidia.conf > $PKG/usr/share/X11/xorg.conf.d/10-nvidia.conf
mkdir -p $PKG/usr/doc/$PRGNAM-$PKGVER
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKGVER/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVER-$TARGET-$BUILD$TAG.${PKGTYPE:-tgz}
Attached Files
File Type: txt kernel-4.4.168.patch.txt (2.4 KB, 6 views)

Last edited by mats_b_tegner; 09-11-2019 at 08:04 AM.
 
2 members found this post helpful.
Old 09-10-2019, 02:58 PM   #3
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 597

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Quote:
Originally Posted by SaabGripen View Post
Hello!
My GPU is GeForce G102M, proprietary driver version 340.107, system - Slackware 14.2 stable, 32 bit.

Now I'm using kernel 4.4.157, and there's no problem with nvidia driver. Yesterday I installed a new kernel version - 4.4.190 including sources and headers, but the driver installer refuses to build module. In the interface it says:

Code:
"ERROR: Kernel configuration is invalid.include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it."
At first I looked for files /usr/src/linux-4.4.190/include/generated/autoconf.h and the second one, and found out there were both of them in the right place. make oldconfig && make prepare didn't help, neither did README on nvidia download page.
I also get that error when compiling the kernel modules but the modules are still built. I just rebuilt the nvidia 340.107 kernel modules for kernel 4.19.72 using the above modified SlackBuild-script. The nvidia-legacy340-driver SlackBuild-script from SBo seems to work without modifications with 340.107.
http://slackbuilds.org/repository/14...acy340-driver/
http://slackbuilds.org/repository/14...acy340-kernel/

Edit:
The nVidia 340.107 kernel modules needs needs to be patched to build on kernels 4.4.168 and above:
https://www.linuxquestions.org/quest...bo-4175647490/
https://aur.archlinux.org/packages/nvidia-340xx-lts44/
https://aur.archlinux.org/cgit/aur.g...ia-340xx-lts44

Last edited by mats_b_tegner; 09-11-2019 at 03:31 AM.
 
1 members found this post helpful.
Old 09-11-2019, 12:00 AM   #4
kingbeowulf
Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware64 14.2 Slackware 14.2, Slackware{32,64}-current
Posts: 904
Blog Entries: 9

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
I'll have to take another look at the SBo nvidia legacy drivers. They neither get much love from Nvidia, nor am I able to test them on real hardware. So an email bug report to the SBo mail list or to the maintainer (me) is appreciated. I'll see the emails; I don't always have a chance to check LQ. There's no problem posting on LQ as well. No doubt someone will come up with a solution before I can get to it ;-)

Last edited by kingbeowulf; 09-11-2019 at 12:01 AM. Reason: spelling
 
Old 09-11-2019, 04:04 AM   #5
mats_b_tegner
Member
 
Registered: Nov 2009
Location: Gothenburg, Sweden
Distribution: Slackware
Posts: 597

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Quote:
Originally Posted by kingbeowulf View Post
I'll have to take another look at the SBo nvidia legacy drivers. They neither get much love from Nvidia, nor am I able to test them on real hardware. So an email bug report to the SBo mail list or to the maintainer (me) is appreciated. I'll see the emails; I don't always have a chance to check LQ. There's no problem posting on LQ as well. No doubt someone will come up with a solution before I can get to it ;-)
I have posted the Arch Linux patch to the SBo mailing list.
 
Old 09-11-2019, 05:13 AM   #6
SaabGripen
LQ Newbie
 
Registered: Sep 2018
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mats_b_tegner View Post
I'm running nVidia 340.107 under -current64 and I have been able to build the kernel modules by adding the following line to the SlackBuild-script:
Code:
#!/bin/sh
PRGNAM=nvidia-legacy340-kernel
VERSION=${VERSION:-340.107}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
KERNEL=${KERNEL:-$(uname -r)}
KERNELPATH=${KERNELPATH:-/lib/modules/${KERNEL}/build}
PKGVER=${VERSION}_$(echo $KERNEL | tr - _)
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi
if [ "$ARCH" = "i586" ]; then
  TARGET="x86"
  SRCSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  TARGET="x86"
  SRCSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  TARGET="x86_64"
fi
unset ARCH
SRCNAM=NVIDIA-Linux-$TARGET-${VERSION}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=${PKG:-$TMP/package-$PRGNAM}
OUTPUT=${OUTPUT:-/tmp}
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
rm -rf $SRCNAM
sh $CWD/$SRCNAM.run --extract-only || exit 1
cd $SRCNAM || exit 1
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
(cd kernel || exit 1
  make SYSSRC=$KERNELPATH module || exit 1
  cd uvm
  sed -i "s|-O2$|-O2 -Wno-error=incompatible-pointer-types|" Makefile
  make SYSSRC=$KERNELPATH module || exit 1
)
mkdir -p $PKG/lib/modules/$KERNEL/kernel/drivers/video
install -m 0664 kernel/nvidia.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
install -m 0664 kernel/uvm/nvidia-uvm.ko $PKG/lib/modules/$KERNEL/kernel/drivers/video/
# Make sure the X is specified to automagically load the
# correct driver, since I always forget. You can remove
# this file if you have an equivilent entry in /etc/X11/xorg.d
mkdir -p $PKG/usr/share/X11/xorg.conf.d/
cat $CWD/10-nvidia.conf > $PKG/usr/share/X11/xorg.conf.d/10-nvidia.conf
mkdir -p $PKG/usr/doc/$PRGNAM-$PKGVER
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKGVER/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVER-$TARGET-$BUILD$TAG.${PKGTYPE:-tgz}
Thank you, mats_b_tegner. I usually compile driver by means of nvidia-installer, but I'll keep this in mind for the future.
 
Old 09-11-2019, 05:18 AM   #7
SaabGripen
LQ Newbie
 
Registered: Sep 2018
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by mats_b_tegner View Post
I also get that error when compiling the kernel modules but the modules are still built. I just rebuilt the nvidia 340.107 kernel modules for kernel 4.19.72 using the above modified SlackBuild-script. The nvidia-legacy340-driver SlackBuild-script from SBo seems to work without modifications with 340.107.
http://slackbuilds.org/repository/14...acy340-driver/
http://slackbuilds.org/repository/14...acy340-kernel/

Edit:
The nVidia 340.107 kernel modules needs needs to be patched to build on kernels 4.4.168 and above:
https://www.linuxquestions.org/quest...bo-4175647490/
https://aur.archlinux.org/packages/nvidia-340xx-lts44/
https://aur.archlinux.org/cgit/aur.g...ia-340xx-lts44
Thanx a lot again, the problem is solved by using the patch which you gave a link to.

Here's what I did, in case anyone would want to make it the same way:

1. sh NVIDIA-Linux-x86-340.107.run --extract-only
2. cp patch-file to the extracted directory NVIDIA-Linux-x86-340.107
3. cd NVIDIA-Linux-x86-340.107
4. patch -p1 < patch-file-name
5. nvidia-installer

You wrote the modules were built but I didn't find them in /usr/src/linux-4.4.190/drivers/video/

Last edited by SaabGripen; 09-11-2019 at 05:39 AM.
 
1 members found this post helpful.
  


Reply


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
What is more stable: Slackware or Debian Stable ? Xeratul Slackware 100 11-14-2015 10:07 PM
Stable 13 kernel vs Current kernel in Stable system linus72 Slackware 6 04-01-2010 07:45 AM
stable:2.6.32.7 from kernel.org is really stable? miros84 Linux - Software 2 02-02-2010 01:44 AM
[Error] Kernel Module : No kernel module build environment saman007uk Debian 7 09-09-2006 06:34 PM
Unable to build NVIDIA kernel module / determin kernel version Night Ink Fedora 2 05-31-2004 04:54 PM

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

All times are GMT -5. The time now is 12:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration