LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-06-2016, 11:48 AM   #1
pso
LQ Newbie
 
Registered: Mar 2016
Location: Europe
Distribution: Slackware-current, 14.2
Posts: 4

Rep: Reputation: Disabled
FYI - inserting module for NVIDIA 304.131 (possibly 340.xxx) and kernel 4.4.14<


Recently I was doing upgrade from 14.1 to 14.2 and hit the wall of buggy nvidia blob.
The kernel module driver 304.131 build nice for kernel 4.4.14 but couldn't be loaded during boot time.
I have red somewhere on the LQ Slackware forum that if you want to load kernel module you have to patch the kernel or wait to NVIDIA devs do their job.
Since i don't like to mess with smarter than me i would not touch this source code.

Instead of that I've founded patch for driver 304.131. I think that this can be useful for 340 series too.

patch:
Code:
--- a/nv-linux.h
+++ b/nv-linux.h
@@ -256,6 +256,15 @@
 #include <linux/seq_file.h>
 #endif
 
+/*
+ * As of version 304.131, os-agp.c and os-mtrr.c still use deprecated
+ * kernel APIs for mtrr which are no longer exported since 4.3, causing
+ * the module to error out when loaded.
+ */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
+#undef CONFIG_MTRR
+#endif
+
 #if !defined(NV_VMWARE) && defined(CONFIG_MTRR)
 #include <asm/mtrr.h>
 #endif
source:
https://devtalk.nvidia.com/default/t...on-kernel-4-4/

For me this solution works like a charm. -> nv43 - GeForce 6600.
Hope this helps.
 
Old 07-06-2016, 12:06 PM   #2
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
I have my patch here since 6 months ago: https://github.com/willysr/SlackHack...ia/304.131/4.4
 
1 members found this post helpful.
Old 07-07-2016, 04:37 AM   #3
RadicalDreamer
Senior Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 1,816

Rep: Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981
These may work too:
https://slackbuilds.org/repository/1...acy304-kernel/
https://slackbuilds.org/repository/1...acy304-driver/

The 340 version worked for my 9800m gts
 
Old 07-08-2016, 02:31 AM   #4
pso
LQ Newbie
 
Registered: Mar 2016
Location: Europe
Distribution: Slackware-current, 14.2
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yes indeed.
@willysr
I've looked at yours solution and You patched the kernel. Maybe it is good way to do it, but personally I don't know if other apps or drivers would need that instructions in kernel to run properly.

@RadicalDreamer
You are right.
I'd to modify slackbuild script downloaded from slackbuilds.org through sbopkg's possibility of package customization. I've added patch command accordingly to Slackbook's manual on writing slackbuilds scripts. Pure one resulted dmesg errors about mtrr's during module insertion.

BTW on my machine (AMD Sempron 2600, KT333, agp8), compiling the kernel would took ages.
 
Old 07-08-2016, 03:39 AM   #5
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
There is another thread with information here.
Quote:
compiling the kernel would took ages
Dual core processor running 'make -j3 bzImage' completes in ~12 minutes. You only need to compile the kernel, rather than kernel and modules.
 
Old 07-08-2016, 04:14 AM   #6
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
so far, nothing is broken by the patch, so i'm happy with it
 
Old 07-15-2016, 02:00 AM   #7
vivanguarda
Member
 
Registered: Sep 2008
Location: RJ-Brazil
Distribution: Slackware
Posts: 181

Rep: Reputation: 5
I did an upgrade 14.1-> 14.2 slackware system, but there was a nvidia fault. After trying rebuilt kernel using mtrr.pacth, I found fault and module errors on

/var/log/nvidia-installer.log.


Nvidia messages pointed to use steps using beyond make oldconfig

make prepare


I did, but unfortunatelly there was kernel error again.


For now there is another nvidia-kernel installed since 14.1. Do you think it can be causing this installer problem?
 
Old 07-15-2016, 04:59 AM   #8
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
it still worked for me
 
Old 07-15-2016, 04:34 PM   #9
vivanguarda
Member
 
Registered: Sep 2008
Location: RJ-Brazil
Distribution: Slackware
Posts: 181

Rep: Reputation: 5
Are you using 14.2 release after a upgrade or a fresh install?
 
Old 07-15-2016, 05:09 PM   #10
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
i use current all the time
 
Old 07-15-2016, 09:48 PM   #11
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
FWIW I just did a fresh 14.2 32 bit install with 4.14.4 kernel om an older laptop with a Quadro 570m. I blacklisted nouveau and just used nVidia's 340.96 install script from runlevel 3 and it loads and works perfectly, even on HD videos so far.
 
Old 07-16-2016, 10:34 AM   #12
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
I recently upgraded one system to 14.2 and could not compile NVIDIA. willysr's solution worked for me (Thanks!).
 
Old 07-17-2016, 05:24 PM   #13
vivanguarda
Member
 
Registered: Sep 2008
Location: RJ-Brazil
Distribution: Slackware
Posts: 181

Rep: Reputation: 5
After errors this is my procedures.

#uname -r
4.14.14-smp

/usr/src/linux-4.4.14
patch -p1 < [/path/to/mtrr_ed.patch]
cp /boot/config-huge-4.4.14 .config
make oldconfig
make prepare
make bzImage
cp arch/x86/boot/bzImage /boot/vmlinuz-generic-smp-4.4.1-smp
/sbin/lilo -v
reboot



Whatīs my mistake?


mtrr_ed.patch

Quote:
diff -Npur linux-4.4.14.orig/arch/x86/kernel/cpu/mtrr/main.c linux-4.4.14/arch/x86/kernel/cpu/mtrr/main.c
--- linux-4.4.14.orig/arch/x86/kernel/cpu/mtrr/main.c 2015-11-02 01:05:25.000000000 +0100
+++ linux-4.4.14/arch/x86/kernel/cpu/mtrr/main.c 2015-12-18 10:39:42.286530027 +0100
@@ -448,6 +448,21 @@ int mtrr_add(unsigned long base, unsigne
return mtrr_add_page(base >> PAGE_SHIFT, size >> PAGE_SHIFT, type,
increment);
}
+EXPORT_SYMBOL(mtrr_add);
+
+/**
+ * With 2baa891e42d84159b693eadd44f6fe1486285bdc the kernel internal
+ * MTRR interfaces (unexport mtrr_add() and mtrr_del()) got removed.
+ * However Nvidia legacy driver 304xx still needs these exports:
+ *
+ * # modprobe -v nvidia
+ * insmod /lib/modules/4.4.14-ARCH/extramodules/nvidia.ko.gz
+ * modprobe: ERROR: could not insert 'nvidia': Unknown symbol in module,
+ * or unknown parameter (see dmesg)
+ *
+ * [ 22.236809] nvidia: Unknown symbol mtrr_del (err 0)
+ * [ 22.237073] nvidia: Unknown symbol mtrr_add (err 0)
+ * /

/**
* mtrr_del_page - delete a memory type region
@@ -513,6 +528,21 @@ int mtrr_del_page(int reg, unsigned long
put_online_cpus();
return error;
}
+EXPORT_SYMBOL(mtrr_del);
+
+/**
+ * With 2baa891e42d84159b693eadd44f6fe1486285bdc the kernel internal
+ * MTRR interfaces (unexport mtrr_add() and mtrr_del()) got removed.
+ * However Nvidia legacy driver 304xx still needs these exports:
+ *
+ * # modprobe -v nvidia
+ * insmod /lib/modules/4.4.14-ARCH/extramodules/nvidia.ko.gz
+ * modprobe: ERROR: could not insert 'nvidia': Unknown symbol in module,
+ * or unknown parameter (see dmesg)
+ *
+ * [ 22.236809] nvidia: Unknown symbol mtrr_del (err 0)
+ * [ 22.237073] nvidia: Unknown symbol mtrr_add (err 0)
+ * /

/**
* mtrr_del - delete a memory type region
 
Old 07-17-2016, 05:37 PM   #14
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
you should copy the generic one instead of huge kernel's config
 
Old 07-17-2016, 08:09 PM   #15
vivanguarda
Member
 
Registered: Sep 2008
Location: RJ-Brazil
Distribution: Slackware
Posts: 181

Rep: Reputation: 5
Itīs only a Linuxquestion post mistake. Sorry!

I run this copy correctly during system procedures.



I tried it again and used another nvidia-driver ( 340.88) and my nvidia-installer.log shows:

ERROR: Kernel configuration is invalid
; and
include/generated/autoconf.h or include/config/auto.conf are missing



Disabling kernel driverīs install and reading nvidia.ko

And after trying

make prepare; and
make bzImage

returned cpu-kernel erros

Last edited by vivanguarda; 07-17-2016 at 08:32 PM. Reason: And after trying a make prepare option, make bzImage returned cpu-kernel error
 
  


Reply



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 64Bit 304.131 Driver unable to build kernel module - help please Mobile1 Slackware 4 06-09-2016 06:02 PM
[SOLVED] Failure to insert nVidia 304.131 module with kernel 4.4.0 on Slackware-current allend Slackware 9 01-18-2016 09:12 AM
[SOLVED] browser and X crash with pipelight, nvidia 340.17, kernel 3.15.5 mostlyharmless Slackware 1 09-08-2014 09:48 AM
[SOLVED] New -current kernel and Nvidia 304.xx driver issue Lenard Spencer Slackware 18 04-11-2013 07:49 AM
module loading to kernel 2.6.xxx bohemistanbul Linux - General 2 07-03-2007 06:50 AM

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

All times are GMT -5. The time now is 08:00 PM.

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