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

Post tutorials, HOWTO's and other useful resources here.
i3slkiller
Contributor
Contributor
Posts: 110
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

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

Post#166 by i3slkiller » 24 Sep 2024, 19:58

:hi:
Maybe try add this

Code: Select all

Section "ServerFlags"
    Option         "IgnoreABI" "1" 
EndSection
to xorg.conf next to porteusbuild and build it again. If this won't work, I have no other ideas (at least for 6.8.10 kernel).

Eventually get kernel for Porteus 5.0 (000-kernel, 06-crippled_sources-5.18.8-64bit.xzm, vmlinuz) https://linux.rz.rub.de/porteus/x86_64/ ... .0/kernel/
put (replace if exist) 000-kernel to porteus/base
06-crippled_sources* to porteus/modules
vmlinuz to boot/syslinux
reboot and build it again

* - if it will be activated before starting porteusbuild, then it can be wherever

DarthNihilus
White ninja
White ninja
Posts: 4
Joined: 24 Sep 2024, 13:35
Distribution: Porteus 5.01

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

Post#167 by DarthNihilus » 03 Oct 2024, 14:20

The add to the xorg.conf file didn't help.
Following your suggestion, I tried bulding it with a fresh Porteus 5.0, and while the compilation did go threw, no GUI works with the module after reboot. The only thing that catched my eyes during the build was those lines :

Code: Select all

make[1]: Entering directory '/usr/src/linux-5.18.8'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (		\
echo >&2;							\
echo >&2 "  ERROR: Kernel configuration is invalid.";		\
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";	\
echo >&2 ;							\
/bin/false)
Not sure if it's normal or not. The rest of the output was similar to the one shared previously as far as I could tell.

i3slkiller
Contributor
Contributor
Posts: 110
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

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

Post#168 by i3slkiller » 03 Oct 2024, 16:12

Logs would be useful, such as /var/log/Xorg.* files and dmesg command output.
For now I can only suggest try build without nvidia-uvm kmod (modified script is in 08-nvidia-340xx-fix branch)

Code: Select all

$ git diff 08-nvidia..08-nvidia-340xx-fix
diff --git a/porteus/5.01/08-nvidia/08-nvidia.PorteusBuild b/porteus/5.01/08-nvidia/08-nvidia.PorteusBuild
index b077991..fa8c302 100755
--- a/porteus/5.01/08-nvidia/08-nvidia.PorteusBuild
+++ b/porteus/5.01/08-nvidia/08-nvidia.PorteusBuild
@@ -191,13 +191,14 @@ else
   if [ $MAJORVER -le 340 ]; then
     cd kernel
     make -j$(nproc) module
-    cd uvm
-    make -j$(nproc) module
+#     cd uvm
+#     make -j$(nproc) module
 
-    cd ../..
+#     cd ..
+    cd ..
 
     install -D -m0644 kernel/nvidia.ko -t "$PKG/lib/modules/$KERNELVER/kernel/drivers/video"
-    install -D -m0644 kernel/uvm/nvidia-uvm.ko -t "$PKG/lib/modules/$KERNELVER/kernel/drivers/video"
+#     install -D -m0644 kernel/uvm/nvidia-uvm.ko -t "$PKG/lib/modules/$KERNELVER/kernel/drivers/video"
   else
     cd kernel
     make -j$(nproc) module
If this won't work, then we will check pre-patched installer https://sourceforge.net/projects/nvidia ... s/340.108/ although it will require further modifying this script (delete patching code, handle downloading/extracting valid installer based on running kernel version, etc...)

By the way I remembered that Rava had made nvidia 340.108 module without nvidia-uvm kmod inside, apparently it worked for him, but it was for 5.4.30 kernel, and Porteus 5.0rc1/2 (and have no 32-bit libs which may cause problems if eg. you want to play 32-bit 3D windows game on wine). I have both this module and suitable kernel for it, so I can share them, but only when anything else fails.
DarthNihilus wrote:
03 Oct 2024, 14:20
The only thing that catched my eyes during the build was those lines :
For me it looks like it prints exact command that will be executed, in this case

Code: Select all

test -e include/generated/autoconf.h -a -e include/config/auto.conf
checks if include/generated/autoconf.h and include/config/auto.conf files exists in /usr/src/linux-5.18.8 (and that's the case here), otherwise ( || - two pipes ) it prints "ERROR: Kernel configuration is invalid" message to stderr and triggers failure (/bin/false)

DarthNihilus
White ninja
White ninja
Posts: 4
Joined: 24 Sep 2024, 13:35
Distribution: Porteus 5.01

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

Post#169 by DarthNihilus » 07 Oct 2024, 16:16

i3slkiller wrote:
03 Oct 2024, 16:12
For me it looks like it prints exact command that will be executed, in this case
Yes my bad, I tunneled vision on the "ERROR" without reading the previous line :fool:

No more luck without nvidia-uvm.

For the logs, here the last two Xorg :
https://pastebin.com/gzuQKs3v
https://pastebin.com/A2fkRc6L

And for the dmesg, I made it while on Always Fresh mode, tell me if I need to make them in a different mode (on text mode while trying to use the nv driver ? or after compilation ?)
https://pastebin.com/5rdHkpUa

Because I'm questionning myself more and more, here is what I'm doing when trying to compile and run. I'm beginning to think that I'm missing steps.
- dowload the driver, either directly from nv website, or with download.sh in a Porteus instance with a network connection (I tried both) ;
- boot Porteus in Text mode (safe), with root user ;
- run 08-nvidia.PorteusBuild ;
- cp the created xzm file inside porteus/modules/ ;
- reboot in Graphics mode.

I'll add that Porteus is running on a USB stick in NTFS, and I'm directing TMP and OUTPUT on a ext4 partition inside the internal drive.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 4114
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

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

Post#170 by ncmprhnsbl » 07 Oct 2024, 23:03

DarthNihilus wrote:
07 Oct 2024, 16:16
- boot Porteus in Text mode (safe), with root user ;
just to point out: with i3slkiller's script this isn't necessary, it will work in X with nouveau running.
looking at the xorg logs, looks like nouveau isn't being blacklisted .. check if the module includes /etc/modprobe.d/nvidia-installer-disable-nouveau.conf ..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8601
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

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

Post#171 by Ed_P » 08 Oct 2024, 06:38

DarthNihilus wrote:
07 Oct 2024, 16:16
I'll add that Porteus is running on a USB stick in NTFS
FWIW I recommend exFAT for the USB stick. Less overhead, less wear. faster to dismount.

DarthNihilus
White ninja
White ninja
Posts: 4
Joined: 24 Sep 2024, 13:35
Distribution: Porteus 5.01

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

Post#172 by DarthNihilus » 08 Oct 2024, 12:06

ncmprhnsbl wrote:
07 Oct 2024, 23:03
looking at the xorg logs, looks like nouveau isn't being blacklisted .. check if the module includes /etc/modprobe.d/nvidia-installer-disable-nouveau.conf ..
It does, but I could only get xorg logs while on Always fresh mode (so without NV driver running, and with nouveau active). When I try to boot with the NV module : in Graphic mode, it crashes (so I can't cp any logs), and in Text mode, I didn't find any xorg logs.
Ed_P wrote:
08 Oct 2024, 06:38
DarthNihilus wrote:
07 Oct 2024, 16:16
I'll add that Porteus is running on a USB stick in NTFS
FWIW I recommend exFAT for the USB stick. Less overhead, less wear. faster to dismount.
Will do, thanks :)

i3slkiller
Contributor
Contributor
Posts: 110
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

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

Post#173 by i3slkiller » 10 Oct 2024, 11:01

i3slkiller wrote:
03 Oct 2024, 16:12
If this won't work, then we will check pre-patched installer https://sourceforge.net/projects/nvidia ... s/340.108/ although it will require further modifying this script (delete patching code, handle downloading/extracting valid installer based on running kernel version, etc...)
I checked the patched drivers (or at least that's what they are called), and it turned out that they are not fully patched (checked on 5.18.8 and 6.8.10 kernels on which driver failed to build), a waste of time.

Post Reply