[HOWTO] make a xzm module driver for NVIDIA video card

Post tutorials, HOWTO's and other useful resources here.
User avatar
chromer
Black ninja
Black ninja
Posts: 31
Joined: 13 Jan 2019, 18:00
Distribution: APorteus Cinnamon 64bit
Location: Turkey

[HOWTO] make a xzm module driver for NVIDIA video card

Post#76 by chromer » 19 Mar 2020, 09:21

@rava @fulalas
Hi , i try to generate a module for latest NVIDIA-Linux-x86_64-440.64.run , kernel module compiles successfully according to 'nvidia-installer.log' :
-> Kernel module compilation complete.
but ending with error :
ERROR: Unable to load the kernel module 'nvidia.ko'. This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources, with a version of gcc that differs from the one used to build the target kernel, or if another driver, such as nouveau, is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA GPU(s), or no NVIDIA GPU installed in this system is supported by this NVIDIA Linux graphics driver release.
and thats because :
-> Kernel module load error: Operation not permitted
-> Kernel messages:
[ 129.349835] Lockdown: nvidia-installe: unsigned module loading is restricted; see man kernel_lockdown.7
ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.
i'm using kernels generated by Neko.

Any workaround other than disabling kernel lockdown ???

User avatar
Blaze
DEV Team
DEV Team
Posts: 3869
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

[HOWTO] make a xzm module driver for NVIDIA video card

Post#77 by Blaze » 19 Mar 2020, 15:55

Hi chromer.
Try to use my build of kernel 5.5.10 (builded under gcc-9.2.0-x86_64) and replace 05-devel.xzm (gcc-9.2.0-x86_64) too.
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] make a xzm module driver for NVIDIA video card

Post#78 by Rava » 21 Mar 2020, 10:39

Blaze wrote:
19 Mar 2020, 15:55
Try to use my build of kernel 5.5.10 (builded under gcc-9.2.0-x86_64) and replace 05-devel.xzm (gcc-9.2.0-x86_64) too.
Do you have the md5sum for the 05-devel.xzm?
Cheers!
Yours Rava

User avatar
Blaze
DEV Team
DEV Team
Posts: 3869
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

[HOWTO] make a xzm module driver for NVIDIA video card

Post#79 by Blaze » 21 Mar 2020, 11:21

Rava,

Code: Select all

c5d7f41fcec22bd450a488029ce0f9b1
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

S4m4n
Black ninja
Black ninja
Posts: 34
Joined: 25 Mar 2020, 18:18
Distribution: Porteus4 X64 Mate,Trying 5 rc1

[HOWTO] make a xzm module driver for NVIDIA video card

Post#80 by S4m4n » 27 Mar 2020, 18:05

Rava wrote:
23 Dec 2018, 23:51
- 05-devel.xzm (i586)
- crippled_sources.xzm (i586)

or 64 Bit architecture :

- 05-devel.xzm (x86_64)
- crippled_sources.xzm (x86_64)
Hi Rava!

Could you please check 05-devel.xzm (64 bit architecture). The module is not functioning here is an example:

Code: Select all

deb2xzm speedify_9.6.0-8358_amd64.deb 
Checking required libraries ...

/usr/bin/deb2xzm: line 14: ldconfig: command not found
 ############################# 
 #     Missing library       # 
 ############################# 

You are missing libbfd. Please
activate 05_devel or run the
 command: getpkg binutils 
and installpkg the file.
I have already activated devel.xzm and also got binutils installed aswell but the issue persists. Even I tried with another deb but the error is the same.

Please advise!

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] make a xzm module driver for NVIDIA video card

Post#81 by Rava » 27 Mar 2020, 22:52

Hi S4m4n,
S4m4n wrote:
27 Mar 2020, 18:05
Could you please check 05-devel.xzm (64 bit architecture). The module is not functioning
[…]
I have already activated devel.xzm and also got binutils installed aswell but the issue persists. Even I tried with another deb but the error is the same.
What kind of kernel are you using?
Usually you need a newer kernel than the one that got bundled with older Porteus.
E.g. I needed to upgrade from the standard kernel of porteus 5.0rc1 to 5.4.19-porteus to be able to compile the driver for "nvidia-340.108".

Cave! 05-devel.xzm is dependant on what kernel you are using. If you use a different kernel, you also need the correct 05-devel.xzm for that kernel.

In my example:

Code: Select all

# tar -tf 64bit-ALL-kernel5.4.19.tar
000-kernel.xzm
06-crippled_sources-5.4.19-64bit.xzm
vmlinuz
As you can see, the kernel tar archive only contains 000-kernel.xzm 06-crippled_sources-5.4.19-64bit.xzm and vmlinuz but lacks 05-devel.xzm.

Sometimes a kernel got compiled using a different (usually newer) gcc version. You then need to use the correct 05-devel.xzm that also contains the very same gcc version.

As example Blaze explained above:
Blaze wrote:
19 Mar 2020, 15:55
Try to use my build of kernel 5.5.10 (build under gcc-9.2.0-x86_64) and replace 05-devel.xzm (gcc-9.2.0-x86_64) too.
HTH!
Cheers!
Yours Rava

fulalas
DEV Team
DEV Team
Posts: 2050
Joined: 26 Oct 2016, 15:34
Distribution: Porteus
Location: Brazil

[HOWTO] make a xzm module driver for NVIDIA video card

Post#82 by fulalas » 27 Mar 2020, 23:08

Just to point out that I'm failing to build Nvidia drivers using Blaze kernel 5.5.11 together with the most recent devel module -- both use GCC 9.30. I see the following error:

Image

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] make a xzm module driver for NVIDIA video card

Post#83 by Rava » 27 Mar 2020, 23:15

@fulalas
Sorry to say but I lack hardware that could use a 440.64 driver.

I either need 340.108 or 304.x, so unfortunately I cannot help you there.

I know it is said that the 340 or 304 driver branch have issues with 5.5 kernel, but I thought that was not the case with 440.64 driver.
Cheers!
Yours Rava

S4m4n
Black ninja
Black ninja
Posts: 34
Joined: 25 Mar 2020, 18:18
Distribution: Porteus4 X64 Mate,Trying 5 rc1

[HOWTO] make a xzm module driver for NVIDIA video card

Post#84 by S4m4n » 28 Mar 2020, 17:48

@Rava Thanks for your attention.

Per @Blaze suggestion on my another post (Steam Client), Today I have just migrated to Porteus 5.0rc1 x86-64 KDE. So I have stock kernel which is: 5.1.5-porteus.
Since I was about to compile the driver for nvidia-340.108 just like you, I tried to get the 5.4.19-porteus & Vmlinuz and its respective 05-devel.xzm from neko's Porteus Kernel Builder then I found out that you had difficulties with sound on that kernel. So I changed my mind and per Blaze suggestion above, tried with kernel 5.5.10:
Blaze wrote:
19 Mar 2020, 15:55
Try to use my build of kernel 5.5.10 (build under gcc-9.2.0-x86_64) and replace 05-devel.xzm (gcc-9.2.0-x86_64) too.
Although Blaze's kernel 5.5.10 was downloadable but its 05-devel.xzm was gone missing. (@Blaze please advise)
So I put my step a little further and got Blaze's latest kernel 5.5.11 and its 05-devel.xzm and replaced the files on my stock porteus on USB and followed 1st post of this thread steps to compile NVIDIA driver. But I faced error on the beginning indicating that the glibc is not matching (Sorry I cant remember the exact error and dont know how to take screenshot from screen on runlevel 3) so I could either continue or abort and I aborted the progress. :%)

I really appreciate if you could help me find the right requirements to compile NVIDIA driver so I could finally reply back to Blaze on: Steam Client

Keep safe
Last edited by Rava on 14 Apr 2020, 14:24, edited 1 time in total.
Reason: Quote about kernel ("Try to use my build of kernel 5.5.10 […]") was by Blaze not by Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] make a xzm module driver for NVIDIA video card

Post#85 by Rava » 28 Mar 2020, 20:40

S4m4n wrote:
28 Mar 2020, 17:48
Since I was about to compile the driver for nvidia-340.108 just like you, I tried to get the 5.4.19-porteus & Vmlinuz and its respective 05-devel.xzm from neko's Porteus Kernel Builder then I found out that you had difficulties with sound on that kernel.
No, I had issues with 5.4.18 kernel. 5.4.19 works like a charm.
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] make a xzm module driver for NVIDIA video card

Post#86 by Rava » 29 Mar 2020, 13:53

I tried to compile 304.137 for a machine that has an even older NVidia card, so far to no prevail.

I upgraded the Porteus system to 5.0rc1 (pre-rc2) XFCE with 5.4.19 kernel, the very same one where I was able to create a working 010-nvidia-340.108-k.5.4.19-porteus-v5.0-x86_64_rava.xzm module.

Unfortunately 5.4.19 kernel and Nvidia driver 304.137 do not work together.
Hopefully one has a solution to the issue.

Here is the complete compiler log:

Code: Select all

nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Sun Mar 29 12:45:07 2020
installer version: 304.137

PATH: /usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/porteus-scripts

nvidia-installer command line:
    ./nvidia-installer

Using: nvidia-installer ncurses v6 user interface
-> License accepted.
-> Installing NVIDIA driver version 304.137.
-> Performing CC sanity check with CC="cc".
-> Performing CC version check with CC="cc".
-> Kernel source path: '/lib/modules/5.4.19-porteus/source'
-> Kernel output path: '/lib/modules/5.4.19-porteus/build'
-> Performing rivafb check.
-> Performing nvidiafb check.
-> Performing Xen check.
-> Cleaning kernel module build directory.
   executing: 'cd ./kernel; make clean'...
-> Building kernel module:
   executing: 'cd ./kernel; make module SYSSRC=/lib/modules/5.4.19-porteus/source SYSOUT=/lib/modules/5.4.19-porteus/build'...
   NVIDIA: calling KBUILD...
   make -f ./Makefile syncconfig
   make -f ./scripts/Makefile.build obj=scripts/basic
     gcc -Wp,-MD,scripts/basic/.fixdep.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89         -o scripts/basic/fixdep scripts/basic/fixdep.c   
   rm -f .tmp_quiet_recordmcount
   make -f ./scripts/Makefile.build obj=scripts/kconfig syncconfig
     gcc -Wp,-MD,scripts/kconfig/.conf.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89       -c -o scripts/kconfig/conf.o scripts/kconfig/conf.c
     gcc -Wp,-MD,scripts/kconfig/.confdata.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89       -c -o scripts/kconfig/confdata.o scripts/kconfig/confdata.c
     gcc -Wp,-MD,scripts/kconfig/.expr.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89       -c -o scripts/kconfig/expr.o scripts/kconfig/expr.c
     gcc -Wp,-MD,scripts/kconfig/.lexer.lex.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89      -I ./scripts/kconfig -c -o scripts/kconfig/lexer.lex.o scripts/kconfig/lexer.lex.c
     gcc -Wp,-MD,scripts/kconfig/.parser.tab.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89      -I ./scripts/kconfig -c -o scripts/kconfig/parser.tab.o scripts/kconfig/parser.tab.c
     gcc -Wp,-MD,scripts/kconfig/.preprocess.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89       -c -o scripts/kconfig/preprocess.o scripts/kconfig/preprocess.c
     gcc -Wp,-MD,scripts/kconfig/.symbol.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89       -c -o scripts/kconfig/symbol.o scripts/kconfig/symbol.c
     gcc   -o scripts/kconfig/conf scripts/kconfig/conf.o scripts/kconfig/confdata.o scripts/kconfig/expr.o scripts/kconfig/lexer.lex.o scripts/kconfig/parser.tab.o scripts/kconfig/preprocess.o scripts/kconfig/symbol.o   
   scripts/kconfig/conf  --syncconfig Kconfig
   make[4]: *** [scripts/kconfig/Makefile:73: syncconfig] Segmentation fault
   make[3]: *** [Makefile:567: syncconfig] Error 2
   make[2]: *** [Makefile:678: include/config/auto.conf.cmd] Error 2
   make[2]: *** [include/config/auto.conf.cmd] Deleting file 'include/config/tristate.conf'
   NVIDIA: left KBUILD.
   nvidia.ko failed to build!
   make[1]: *** [Makefile:261: module] Error 1
   make: *** [makefile:59: module] Error 2
-> Error.
ERROR: Unable to build the NVIDIA kernel module.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.
can

Code: Select all

make[4]: *** [scripts/kconfig/Makefile:73: syncconfig] Segmentation fault
hinting towards incompatibility between the kernel and the source code?
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

[HOWTO] make a xzm module driver for NVIDIA video card

Post#87 by donald » 29 Mar 2020, 18:44

The 304 driver is out of support.
AFAIK it is not possible getting it to run on a system since xorg-server 1.20
Porteus 4 with xorg 1.19 will be the last one.
--------------------------------------------------------------------------------------------------------

nvidia-304.137-kernel 4.16.3-x86_64 (porteus 4)
(built without the 32-bit libraries.)
http://filehorst.de/d/cjsidhnG

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] make a xzm module driver for NVIDIA video card

Post#88 by Rava » 29 Mar 2020, 19:14

donald wrote:
29 Mar 2020, 18:44
The 304 driver is out of support.
AFAIK it is not possible getting it to run on a system since xorg-server 1.20
Porteus 4 with xorg 1.19 will be the last one.
That is a sad thing, the card is a quite good one, of course it is some years ago when I bought the card for that PC… but still, unable to use capable hardware due to out of support drivers is quite a disappointment.
Cheers!
Yours Rava

S4m4n
Black ninja
Black ninja
Posts: 34
Joined: 25 Mar 2020, 18:18
Distribution: Porteus4 X64 Mate,Trying 5 rc1

[HOWTO] make a xzm module driver for NVIDIA video card

Post#89 by S4m4n » 31 Mar 2020, 10:13

Day #5 NVIDIA driver compile report: :wall:
Here is the report on 5.4.19 kernel group files experience:
stock files and modules were replaced with mdsum provedn kernel files and proceed with instructions provided on 1st thread. As I ran the NVIDIA-Linux-x86_64-340.108.run I received the following error:

Code: Select all

The CC version check failed:
Could not compile gcc-version-check.c Please be sure you have your Linux distributions libc development package installed and usr/bin/cc is a valid C compiler name.

If you know what you are doing you can either ignore the CC version check and continue installation, or abort installation, set the CC environment variable to the name of the compiler used to compile your kernel, and restart installation.
I was given two choices:
1. Ignore CC version check 2. Abort installation
I chose 1st option and I got the following error:

Code: Select all

ERROR: Unable to build the NVIDIA kernel module.
then ended with the following error:

Code: Select all

ERROR: Installation has failed. Please see the file var/log/Nvidia-installer.log for details. you may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.
As it seems the libc within the provided kernel is not compatible with other
I have no clue what is going wrong. Thanks for your kind support.

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOWTO] make a xzm module driver for NVIDIA video card

Post#90 by Rava » 31 Mar 2020, 14:33

S4m4n wrote:
31 Mar 2020, 10:13
Here is the report on 5.4.19 kernel group files experience:
stock files and modules were replaced with mdsum proved kernel files and proceed with instructions provided on 1st thread. As I ran the NVIDIA-Linux-x86_64-340.108.run
I thought you wanted to compile a different driver.

If its the 340.108 for Kernel 5.4.19 go right here:
Porteus 5.0rc1 NVidia 340.108 driver for older hardware for kernel 5.4.19 (Post by Rava #76178)

Post Reply