Tiny Core Linux

Tiny Core Base => Corepure64 => Topic started by: CardealRusso on May 01, 2023, 07:51:43 AM

Title: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 01, 2023, 07:51:43 AM
Hello, everyone. Since the nouveau driver works but is not enough, I decided to try installing the nvidia proprietary driver.
I am currently being filtered by the TinyCore kernel. As I don't have much experience with Linus or TinyCore, I ask for help.

Here is my failed attempt:

I downloaded all equivalent packages present here (http://tinycorelinux.net/14.x/x86_64/release/src/toolchain/) and the kernel source (http://tinycorelinux.net/14.x/x86_64/release/src/kernel/)

I tried to follow the steps mentioned by Juanito

No, you don't need linux-kernel-sources-env to compile kernel modules - it was a way of making things easier, but no longer works due to changes in linux-5.x

This will prepare the kernel source:
Code: [Select]
$ cd linux-5.10.3
$ make mrproper
$ cp ../config-5.10.3-tinycore64 .config
$ make oldconfig
$ make prepare
$ make modules_prepare

But i got a lot of errors
For 14.x x86_64
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: Juanito on May 01, 2023, 08:03:17 AM
You can use the compiletc meta extension to download/load all that is commonly required to compile on tinycore.

To prepare the CorePure64-14.x kernel source:
Code: [Select]
tce-load -i compiletc perl5 elfutils-dev ncursesw-dev bc
wget http://tinycorelinux.net/14.x/x86_64/release/src/kernel/linux-6.1.2-patched.txz
tar xf linux-6.1.2-patched.txz
wget http://tinycorelinux.net/14.x/x86_64/release/src/kernel/config-6.1.2-tinycore64
cd linux-6.1.2
make mrproper
cp ../config-6.1.2-tinycore64 .config
make oldconfig
make prepare
make modules_prepare
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 01, 2023, 11:58:06 AM
You can use the compiletc meta extension to download/load all that is commonly required to compile on tinycore.

Hello and thank you, juanito.


I followed all the steps you suggested and was successful. Everything worked.

I just needed to drop multiple copies of the file Module.symvers-6.1.2-tinycore64.gz (http://tinycorelinux.net/14.x/x86_64/release/src/kernel/Module.symvers-6.1.2-tinycore64.gz) for the installer to work.

Unfortunately it wasn't enough. The nvidia driver, despite supposedly having compiled successfully, it fails to install.

It's very frustrating that the 410 driver (the last one available in the TCL repository, thanks to coreplayer2) was released just a few months, maybe even days, before my video card became compatible.

Command used
Code: [Select]
sudo /mnt/sdc1/downloads/NVIDIA-Linux-x86_64-525.116.03.run --no-x-check --no-cc-version-check --kernel-source-path /home/tc/Downloads/linux-6.1.2/
log
Code: [Select]
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 device(s), or no NVIDIA device installed in this system is supported by this NVIDIA Linux graphics driver release.

I've tried everything, including several different versions of the installer. nothing works, google results are not very informative and the error itself is very generic and uninformative.
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 01, 2023, 12:58:26 PM
I also tried this new nvidia open source driver, which is supposedly much easier to install. however, this also generates uninformative errors

https://github.com/NVIDIA/open-gpu-kernel-modules
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: Rich on May 01, 2023, 07:49:35 PM
Hi CardealRusso
Based on the error message:
... log
Code: [Select]
ERROR: Unable to load the kernel module 'nvidia.ko'.  This happens most frequently when
That part of the message makes it sound like  nvidia.ko  got built.

Quote
Code: [Select]
this kernel module was built against the wrong or improperly configured kernel sources
That seems unlikely. Juanito gave you instructions for TC14.x x86_64.

Quote
Code: [Select]
with a version of gcc that differs from the one used to build the target kernel
I don't think that's it.

Quote
Code: [Select]
or if another driver, such as nouveau, is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA device(s)
This sounds like a possibility. Was Xorg running when you ran this?
Were any of the following drivers loaded:
nv_drv.so, nouveau_drv.so, nouveau.ko.gz

Quote
Code: [Select]
or no NVIDIA device installed in this system is supported by this NVIDIA Linux graphics driver release.
According to the nVidia website, your board is supported by this driver.
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 02, 2023, 04:38:04 AM
This sounds like a possibility. Was Xorg running when you ran this?
Were any of the following drivers loaded:
nv_drv.so, nouveau_drv.so, nouveau.ko.gz

i tried to install in textmode and nouveau was not installed

about the open kernel drivers. it fails when tried to find something on /lib/modules/6.1.2

Code: [Select]
make -C kernel-open modules_install
make[1]: Entering directory '/home/tc/open-gpu-kernel-modules/kernel-open'
make[2]: Entering directory '/home/tc/open-gpu-kernel-modules/kernel-open'
make[2]: *** /lib/modules/6.1.2-tinycore64/build: No such file or directory.  Stop.
make[2]: Leaving directory '/home/tc/open-gpu-kernel-modules/kernel-open'
make[1]: *** [Makefile:82: modules_install] Error 2
make[1]: Leaving directory '/home/tc/open-gpu-kernel-modules/kernel-open'
make: *** [Makefile:67: modules_install] Error 2
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: Rich on May 02, 2023, 07:20:32 AM
Hi CardealRusso
Maybe you need to install  linux-6.1_api_headers.tcz ?
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: Juanito on May 02, 2023, 08:59:17 AM
You need to create a symlink in /lib/modules/KERNEL named build that points to your prepared kernel source
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 04, 2023, 01:18:27 PM
You need to create a symlink in /lib/modules/KERNEL named build that points to your prepared kernel source
Hi CardealRusso
Maybe you need to install  linux-6.1_api_headers.tcz ?

Thank you for your help. Unfortunately, all attempts were unsuccessful.

I however give up with one last desperate move, which I'll leave here in case it works for someone else in the future.
While the proprietary drivers were successfully compiling, just not installing, I simply extracted nvidia-390.116-4.19.10-tinycore64.tcz and updated all files and information. I leave this file here:

nvidia-525.116.03-6.1.2-tinycore64.zip (https://drive.google.com/file/d/1veeBh3peuUn_lU1GLZV_fybBYno20eap/view)
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 04, 2023, 01:34:00 PM
nvidia-525.116.03-6.1.2-tinycore64.zip (https://drive.google.com/file/d/1veeBh3peuUn_lU1GLZV_fybBYno20eap/view)

Here is the result of this file
Code: [Select]
Graphics:
  Device-1: NVIDIA vendor: ASUSTeK driver: nvidia v: 525.116.03 arch: Turing
    pcie: speed: 2.5 GT/s lanes: 4 bus-ID: 03:00.0 chip-ID: 10de:1f82
    class-ID: 0300
  Display: server: X.Org v: 1.21.1.6 driver: X: loaded: N/A failed: nvidia
    dri: swrast gpu: nvidia note: X driver n/a display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1440x900 s-dpi: 75 s-size: 488x305mm (19.21x12.01")
    s-diag: 575mm (22.66")
  Monitor-1: HDMI-0 res: 1440x900 hz: 60 dpi: 64
    size: 575x323mm (22.64x12.72") diag: 660mm (25.96") modes: N/A
  API: OpenGL v: 4.5 Mesa 22.3.7 renderer: llvmpipe (LLVM 15.0.7 256 bits)
    direct-render: Yes

it actually looks like its working? but missing glx modules.

Code: [Select]
[    21.408] (II) Module nvidia: vendor="NVIDIA Corporation"
[    21.408] compiled for 1.6.99.901, module version = 1.0.0
[    21.408] Module class: X.Org Video Driver
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 04, 2023, 02:27:37 PM
I have some good news

Code: [Select]
Graphics:
  Device-1: NVIDIA vendor: ASUSTeK driver: nvidia v: 525.116.03 arch: Turing
    pcie: speed: 2.5 GT/s lanes: 4 bus-ID: 03:00.0 chip-ID: 10de:1f82
    class-ID: 0300
  Display: server: X.Org v: 1.21.1.6 driver: X: loaded: nvidia gpu: nvidia
    display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1440x900 s-dpi: 75 s-size: 488x305mm (19.21x12.01")
    s-diag: 575mm (22.66")
  Monitor-1: HDMI-0 res: 1440x900 hz: 60 dpi: 64
    size: 575x323mm (22.64x12.72") diag: 660mm (25.96") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 525.116.03 renderer: NVIDIA GeForce GTX
    1650/PCIe/SSE2 direct-render: Yes

The driver was loaded. I managed to install with the installer with this package, i just had to exit the x server to prompt.

glxgears
Code: [Select]
tc@box:~$ env vblank_mode=0 __GL_SYNC_TO_VBLANK=0 glxgears
'76236 frames in 5.0 seconds = 15247.050 FPS
76302 frames in 5.0 seconds = 15260.339 FPS
76522 frames in 5.0 seconds = 15304.348 FPS
77164 frames in 5.0 seconds = 15432.640 FPS
76728 frames in 5.0 seconds = 15345.563 FPS
76911 frames in 5.0 seconds = 15382.092 FPS
76850 frames in 5.0 seconds = 15369.840 FPS
76995 frames in 5.0 seconds = 15398.824 FPS
77072 frames in 5.0 seconds = 15414.350 FPS

Compared to no drivers
Code: [Select]
tc@box:~$ glxgears
1895 frames in 5.0 seconds = 378.986 FPS
1878 frames in 5.0 seconds = 375.515 FPS
2035 frames in 5.0 seconds = 406.945 FPS

And nouveau

Code: [Select]
tc@box:~$ vblank_mode=0 glxgears
ATTENTION: default value of option vblank_mode overridden by environment.
9274 frames in 5.0 seconds = 1854.556 FPS
9430 frames in 5.0 seconds = 1885.883 FPS
9569 frames in 5.0 seconds = 1913.663 FPS

Had to run the installer of the same version of package for the drivers to load. I dont know what im missing.

Can i get some help to get this  persistent.
I think the only difference is that I am now loading the graphics-KERNEL.tcz. It seems that the lack of this prevented the driver from being installed
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 04, 2023, 03:14:16 PM
nvidia-525.116.03-6.1.2-tinycore64.zip (https://drive.google.com/file/d/1veeBh3peuUn_lU1GLZV_fybBYno20eap/view)

i got it
there are many missing files on /usr/lib. i just updated the kernel files

i`ll try to fix and maybe try to submit to tcz repo

everything is working nicely, i just need to pack it all
(https://i.imgur.com/il044dA.png)
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: aus9 on May 04, 2023, 06:48:20 PM
hi CardealRusso

before you submit, some suggestions for you.

post 9 xorg log
Quote
ACPI: failed to connect to the ACPI event daemon

try installing  acpid and start the daemon....exit to prompt then go back in and check if Xorg log has that message disappear?

post 11 screenshot of terminal....
it looks like you might need to add hicolor-icon-theme.tcz to your dep file.

XDG_RUNTIME_DIR...for sway I set this to a /run/user dir but /tmp can be used like this

Code: [Select]
export XDG_RUNTIME_DIR=/tmp
env | grep tmp
# result...XDG_RUNTIME_DIR=/tmp

Is nvidia-settings an elf file?
if so you can run a dependency check on it like this
Code: [Select]
readelf -d /usr/local/bin/nvidia-settings | grep 'NEEDED'
here is example of my research for dep entries
http://tinycorelinux.net/14.x/x86_64/tcz/src/feh/build-feh.sh
later builds I have remove the junk of 0x0000000000000001 (NEEDED) Shared library:
but you can see that I used searchtce against libX11 found it was a dep of  libXext and that was a dep of imlib2
which worked out well as libpng gave a similar result

then what I do...is search my local TCEs for each entry.
some are TCB....you won't get a hit.....I can see your terminal has libz* and  if you open Apps and use the "provides" search for libz.so.1
you won't get a hit....meaning its not coming from a TCE so its TCB

gnuser and others use search scripts that search the TC repos.
I lack that skill and thoroughness....instead I search for only locally installed TCEs...be they private or not yet submitted etc TCEs like this

Code: [Select]
cat $HOME/.local/bin/searchtce # gap added by me

#!/bin/sh
read -p "input TCE without dot tcz please
" INPUT
grep -l $INPUT.tcz /etc/sysconfig/tcedir/optional/*.dep | cut -d/ -f6


make it executable too please
Good luck

Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: curaga on May 04, 2023, 10:39:05 PM
Acpid is not related to nvidia in any way. That with xorg is for stuff like blanking the display when you close the laptop screen etc.
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 05, 2023, 05:14:12 AM

Thank you for your attention.

Currently, as I mentioned earlier, I am able to successfully install and load the nvidia drivers. Everything works perfectly.

My current difficulty is creating the nvidia tcz. I'm currently trying to keep track of all files created/moved by the installer but it's been an almost impossible task.

I am currently including the file
nvidia-525.116.03-6.1.2-tinycore64.zip (https://drive.google.com/file/d/1veeBh3peuUn_lU1GLZV_fybBYno20eap/view)
on boot. This file doesn't have much use other than blocking any other video drivers that tinycore tries to load.

After that I can exit to the prompt and very easily run the nvidia installer. I'll leave here the nvidia installer with the pre-compiled tinycore kernel (6.1.2-tinycore64 only)
NVIDIA-Linux-x86_64-470.182.03-no-compat32-custom.run (https://drive.google.com/file/d/1ytWn5duDaD9AjrgHgSAxWB-X2XWRNVgc/view)

onboot:
Code: [Select]
...
firmware-nvidia.tcz (this is from 13.x repo)
graphics-6.1.2-tinycore64.tcz
nvidia-525.116.03-6.1.2-tinycore64.tcz
zip.tcz
compiletc.tcz
elfutils-dev.tcz
ncursesw-dev.tcz
bc.tcz

I also preferred to use the 470 driver (https://www.nvidia.com/Download/driverResults.aspx/200634/en-us/) as it has a significant performance gain.
Code: [Select]
110632 frames in 5.0 seconds = 22126.268 FPS
111820 frames in 5.0 seconds = 22363.906 FPS
111232 frames in 5.0 seconds = 22246.252 FPS

Compared to driver 525:
Code: [Select]
76236 frames in 5.0 seconds = 15247.050 FPS
76302 frames in 5.0 seconds = 15260.339 FPS
76522 frames in 5.0 seconds = 15304.348 FPS

Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: Juanito on May 05, 2023, 08:40:20 AM
My current difficulty is creating the nvidia tcz. I'm currently trying to keep track of all files created/moved by the installer but it's been an almost impossible task.

You could check if nvidia supports the $DESTDIR install method.

..failing that, then:
Code: [Select]
touch mymarker
sudo make install
sudo find / -not -type 'd' -cnewer mymarker | grep -v "\/proc\/" | grep -v "^\/sys\/" | tee files.txt
vi files.txt
..there will be a few files in files.txt that are obviously not needed and can de removed from the list.
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on May 05, 2023, 06:45:29 PM
Again, I'd like to thank you for your help, juanito. Not only yours but also everyone present in this topic, as

The efforts were not in vain. I confess that I had already given up, but when I finally managed to shoot, I dedicated myself.

Today I skipped going to the beach with my friends and dedicated my whole day to doing everything right. I thoroughly analyzed the coreplayer2 nvidia tcz. It took me hours with a headache until I finally discovered that the driver would not load simply because the info file was not in tce.installed. Also many problems regarding file permissions, directories (there are more than 4 directory options for the same file) and so on. tcl x11 tries to load the settings in a totally inappropriate location.

After all, I was successful.

Here it is, the proprietary nvidia driver properly working perfectly. It is possible to upgrade and add to the TCL 14.x repository. Everything is perfect!


nvidia-470.182.03-6.1.2-tinycore64.tcz (https://drive.google.com/file/d/1kKLC6M2cb2UpHups9VklT6Koip6IIEgg/view?usp=share_link)

(https://i.imgur.com/xWQ05QZ.png)

About the 5xx driver version. I found it very disrespectful of nvidia. The 525 driver, in addition to being almost twice the size, has a loss of almost half in performance. I think you should use the 525 driver only if it's really necessary.

The 470 driver received its last update in March of this year and will probably not receive any more updates regarding support for new cards, it should only receive security updates.

The only advantage over the 525 driver would be that it is compatible with RTX 40 and onwards video cards.

It took me several days to do something that today I am able to do from scratch in just a few minutes. It is very easy to install and make the tcz, but it still takes a lot of manual work.
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on June 13, 2023, 12:42:50 PM
I will leave driver 525 here for public interest.

I was able to resolve 90% of the driver issues by moving the /usr/lib folder to /usr/local/lib as many Xorg 3d dependencies overlap these nvidia files.

The coreplayer2 driver used /usr/lib (which is default in the installer) and it manually deleted the files created by Xorg 3d via tce.installed, however there are many files, not just 1 file (1 file, 2 symlinks of the same file ) as he used it.

So I found that it would be much easier to move to /usr/local/lib and I had no problems, quite the contrary, many problems were solved.
One of them was DRI2 (DRI2: failed to authenticate (caused on mpv, nvidia-settings and others)) which gave priority to libEGL from /usr/local/lib created by the libEGL.tcz package.

Also the vulkan support is working correctly, in the previous 475 driver it doesn't work because I forgot to embed 4 miserable jsons that are created in /etc by the installer. These files I moved to /usr/local/etc and with that vulkan through the GPU worked perfectly again.

The order of packages is very important, the driver must be placed before Xorg 3D.
Here is the onboot.lst needed for everything to work correctly:
Code: [Select]
...
graphics-6.1.2-tinycore64.tcz
nvidia-525.116.04-6.1.2-tinycore64.tcz
vulkan-tools.tcz

firmware-nvidia.tcz is not required (at least for me)
vulkan-tools.tcz has Xorg 3d as a dependency, so it's unnecessary to mention it

nvidia-525.116.04-6.1.2-tinycore64.tcz (https://drive.google.com/file/d/1f9fz-uiQmhMOlqLQp7tzvhp3SgZ3ID3a/view?usp=sharing)

(https://i.imgur.com/DgYFEWA.png)
(https://i.imgur.com/1IddQJR.png)
Title: Re: Getting kernel files ready for nvidia proprietary drivers installer
Post by: CardealRusso on August 03, 2023, 08:35:53 AM
Driver version 535.86.05 here: https://drive.google.com/file/d/1foocZjgid_Tt1bJFrCWa8tagelWRFq55/view?usp=drive_link

It was a little painful to get it working because the proprietary kernel refuses to compile in the current version of TinyCore, so the best solution was to use the open source version: https://github.com/NVIDIA/open-gpu-kernel-modules

To work correctly, you need to add nvidia.NVreg_OpenRmEnableUnsupportedGpus=1 in the boot options in grub.cfg, otherwise it won't work.

(https://i.imgur.com/nLxSO5C.png)

To get nvenc to work on ffmpeg is also pretty easy, you just need to make & sudo make install  https://github.com/FFmpeg/nv-codec-headers and compile current ffmpeg without anything special, as it will be enabled when detected  https://github.com/FFmpeg/FFmpeg/

The first run needs to be with sudo in ffmpeg, otherwise it will return an error. subsequent ones don't need sudo.

(https://i.imgur.com/aQozgbs.png)