nVidia Nouveau Driver

  • The Nvidia GeForce 6100 and 7300LE are supported well by the nouveau driver in the kernel under Linux is my experience. I am planning to build LibreELEC with a kernel including this nouveau driver.

  • chewitt Thanks for the link, I expect it will be helpful

    To add the nouveau driver you can add "nouveau" to the line in the file /home/john/LibreELEC.tv/config/graphic
    GRAPHIC_DRIVERS="crocus i915 iris r300 r600 radeonsi nvidia nvidia-legacy nvidia-ng vmware virtio vc4"

    As I can remember during installation of the proprietary Nvidia driver, a file will be written and you have to delete it if you want to revert to the nouveau driver. I choose to remove nvidia:

    GRAPHIC_DRIVERS="crocus i915 iris r300 r600 radeonsi nouveau vmware virtio vc4"

    In my case I want to optimize it to one system. I assume I can reduce it to:

    GRAPHIC_DRIVERS="nouveau"

    I don't know the effect, but I looked on forehand into the file /home/john/LibreELEC.tv/projects/Generic/linux/linux.x86_64.conf

    and saw the nouveau driver has not been set. Should it be necessary to manually set the nouveau driver by "make menuconfig" also?

  • Reducing the number of drivers being inluded reduces image size and build time, that's no problem. And yes, you'll need to enable the kernel driver in projects/Generic/linux/linux.x86_64.conf - the PR that I linked only adds the userspace Xorg bits.

  • mglae Thanks for mentioning the use of package.mk.

    I found more about changing of the code in files and adding files, see

    add nouveau - opensource nvidia driver by ToKe79 · Pull Request #5917 · LibreELEC/LibreELEC.tv
    I am not sure if it is relevant for LibreELEC, but maybe for the Generic (non-legacy) image. I did not test the legacy image, as I don't have nvidia card,…
    github.com

    After I have bought 2x2GB RAM, I expect to be able to compile and build LibreELEC on a x86_64 system (for cross-compiling my RPi4 and probably my RPi5 have not sufficient memory).

  • The changes from the link in my previous post I have applied to the source code. Next to this I changed the following:
    -replacing "false" into "disabled" and "true " into "enabled" in the file packages/graphics/libdrm/package.mk (they changed it for other entries).
    -for the statement in the file config/graphic
    if [ "${GRAPHIC_DRIVERS}" = "all" ]; then
       GRAPHIC_DRIVERS="crocus i915 iris r300 r600 radeonsi nvidia nvidia-legacy nvidia-ng vmware virtio vc4"
     fi
    I reduced the second line to GRAPHIC_DRIVERS="nouveau". However during building LibreELEC I saw in the configuration:
    Graphic Drivers: crocus i915 iris r300 r600 radeonsi virtio vmware
    Removal of the first and third line of the statement resulted in:
    Graphic Drivers: nouveau

    After building the image I copied it to a hard disk. Booting from this hard disk I could install LibreELEC on a pen drive successfully. Booting from this pen drive stops at a certain moment without starting Kodi. I can reboot my computer by ctr-alt-delete.

    After replacing "quiet" by "ssh textmode" at the end of APPEND in the file syslinux.cfg I got a LibrELEC prompt after booting. I can also access the computer by ssh.

    In dmesg the word "nouveau" can not be found. There is also no kernel module nouveau available. Despite of the changes made in the source code, the nouveau driver seems not have been set in the config file for the kernel.

    I downloaded the kernel version that is mentioned in project/Generic/linux/linux.x86_64.conf and copied this file to .config, make menuconfig and wrote .config back to linux.x86_64.conf. I built a new image and now the nouveau driver has been included. Also during booting nouveau kicks in (font becomes smaller). The splash screen with the logo of LibreELEC has never been shown.

    However the booting stops at
    [ok] Reached target kodi.target

    pastekodi https://paste.libreelec.tv/sharp-penguin.log and

    pastecrash https://paste.libreelec.tv/grand-sculpin.log show

    /usr/lib/kodi/kodi.bin: error while loading shared libraries: libva.so.2: cannot open shared object file: No such file or directory

    I can find it in /$HOME/LibreELEC.tv/build.LibreELEC-Generic.x86_64-12.0-devel/build/libva-2.20.0 and it compiles fine. However, via ssh I can see it is missing.

    How could I add this missing library? See RE: Adding package to image

    Edited 7 times, last by Johpin: Added link about adding packages to image (January 15, 2025 at 2:00 PM).

  • In .libreelec/options I have put ADDITIONAL_PACKAGES="$ADDITIONAL_PACKAGES libva". This included the missing libva in the image. New error:

    NEW LOADER: failed to open nouveau: /usr/lib/dri/nouveau_dri.so: cannot open shared object file: no such file or directory
    Similar error for kms_swrast_dri.so and swrast_dri.so

    Adding "x86-driver-nouveau" to .libreelec/options gives an error during building:
    Exception: Invalid package reference: dependency x86-video-nouveau in package misc-packages::PKG_DEPENDS_TARGET is not valid

    In /$HOME/LibreELEC.tv/packages/x11/driver/xf86-video-nouveau/package.mk can be found:
    PKG_DEPENDS_TARGET="toolchain libXcomposite libXxf86vm libXdamage libdrm util-macros systemd xorg-server"
    All depending packages can be found /$HOME/LibreELEC.tv/packages/

    The file /$HOME/LibreELEC.tv/packages/virtual/misc-packages/package.mk contains a line with:
    PKG_DEPENDS_TARGET="toolchain ${ADDITIONAL_PACKAGES}"

    How could I include x86-driver-nouveau to the image?

    Edited 2 times, last by Johpin (January 15, 2025 at 2:39 PM).

  • See if this works: https://chewitt.libreelec.tv/testing/LibreE…-12.80.1.img.gz

    If yes, these were the buildsystem changes: https://github.com/chewitt/LibreELEC.tv/commits/nouveau

    The only tweaks I made from the original PR were updating the libdrm change to use enabled/disabled not true/false, and I bumped the xf86-video-nouveau version to latest. The image was built with PROJECT=Generic DEVICE=Nouveau ARCH=x86_64 make image

    I think most of your issues stemp from not declaring GRAPHICS_DRIVERS correctly. You've modified config/graphic to force one part of the overal buildsystem config but that variable is used in many places so "nouveau" must be set in the device options file.

  • chewitt Thanks for providing an image. I see the splash screen, but it stops booting at [ok] Reached target kodi.target. After some time the shutdown procedure starts automatically.

    In textmode I executed kodi.bin. This gives a segmentation fault (core dumped).

    Running in textmode in pastecrash https://paste.libreelec.tv/funky-chigger.log i found
    LibreELEC kernel: kodi.bin[1041]: segfault at 0 ip 00007f68316fdf86 sp 00007ffd48764c70 error 6 in libgallium-24.3.3.so[74af86,7f6830fb3000+10e0000] likely on CPU 0 (core 0, socket 0)

  • Please add "ssh" to boot params so the daemon is forced to start on boot and you can access the console without using textmode, which also disables a bunch of stuff in the OS and probably prevents Kodi from running. Then "pastekodi" to get the system boot and current Kodi log or Kodi crash log, if any?

    NB: I suspect OpenGL ES support for nv40 cards might be rather lacking, so I'll tweak the image to use OpenGL instead.

  • Geforce 9400GT with first image: stops at kodi.target and reboots automatically.
    pastekodi https://paste.libreelec.tv/funny-gobbler.log

    Jan 16 10:01:51.942679 LibreELEC kodi.sh[998]: terminate called after throwing an instance of 'std::runtime_error'
    Jan 16 10:01:51.943229 LibreELEC kodi.sh[998]: what(): eglSwapBuffers failed
    Jan 16 10:01:52.633882 LibreELEC kodi.sh[994]: Aborted (core dumped)
    Jan 16 10:01:54.104714 LibreELEC kodi.sh[994]: Crash report available at /storage/.kodi/temp/kodi_crashlog_20250116100152.log
    J

    Geforce 7300LE with second image gives message:
    Starting xorg.
    is your GPU supported?

    https://paste.libreelec.tv/arriving-pelican.log
    Jan 16 10:36:06.986565 LibreELEC systemd[1]: xorg.service: Failed with result 'protocol'.
    Jan 16 10:36:06.987475 LibreELEC systemd[1]: Failed to start xorg.service.
    Jan 16 10:36:06.993941 LibreELEC systemd[1]: Dependency failed for windowmanager.service.
    Jan 16 10:36:06.997960 LibreELEC systemd[1]: windowmanager.service: Job windowmanager.service/start failed with result 'dependency'.

    Jan 16 10:36:07.207205 LibreELEC (kodi.sh)[1010]: kodi.service: Referenced but unset environment variable evaluates to an empty string: KODI_DEBUG
    Jan 16 10:36:08.888983 LibreELEC kodi.sh[1014]: ERROR: Unable to create GUI. Exiting

    On Slackware64 15.0 both video cards are supported well.

    Applying the change from https://github.com/chewitt/LibreE…d9031af39e5d39a gives for me an error during building: ../gbm/options: No such file or directory

  • Code
    Section "Device"
        Identifier "Nvidia card"
        Driver "nouveau"
    EndSection

    In the Xorg image, create /storage/.config/xorg.conf with ^

    Code
    XORG_DEBUG="-logverbose 6 -verbose 6"

    Also create /run/libreelec/debug/xorg.conf with this ^ and then systemctl restart xorg.service to get debug output.

    Also run journalctl -xe windowmanager.service to perhaps see more about what the failing dependency is?

  • Applying systemctl restart xorg.service gives:
    Job for xorg.service failed because the service did not take the steps required by its unit configuration.
    See "systemctl status xorg.service" and "journalctl -xeu xorg.service" for details.

    Applying systemctl status xorg.service gives as output:

    ● xorg.service - Xorg Server
    Loaded: loaded (/usr/lib/systemd/system/xorg.service; disabled; preset: disabled)
    Active: activating (start) since Thu 2025-01-16 16:43:14 UTC; 33s ago
    Job: 5789
    Invocation: 72837b417c24488c96778565ebba4267
    Main PID: 3108 (xorg-launch)
    Tasks: 2 (limit: 3058)
    Memory: 416K (peak: 1020K)
    CPU: 207ms
    CGroup: /system.slice/xorg.service
    ├─3108 /bin/sh /usr/bin/xorg-launch -nolisten tcp vt01 -logverbose 6 -verbose 6
    └─3153 sleep 30

    Jan 16 16:43:16 LibreELEC systemd[1]: xorg.service: Scheduled restart job, restart counter is at 12.
    Jan 16 16:43:16 LibreELEC systemd[1]: Starting xorg.service...

    Applying journalctl -xeu xorg.service shows the x-server retries starting:

    Jan 16 16:25:13 LibreELEC systemd[1]: xorg.service: Scheduled restart job, restart counter is at 7.
    Jan 16 16:25:13 LibreELEC systemd[1]: Starting xorg.service...
    Jan 16 16:25:13 LibreELEC (g-launch)[1388]: xorg.service: Referenced but unset environment variable evaluates to an empty string: XORG_DEBUG
    Jan 16 16:25:54 LibreELEC systemd[1]: xorg.service: Failed with result 'protocol'.
    Jan 16 16:25:54 LibreELEC systemd[1]: Failed to start xorg.service.

  • Xorg is logging to /var/log/Xorg.0.log


    Johpin You are using live mode with tmpfs mounted on /storage not allowing persistent configuration. Please switch to run mode at boot.

    The reboot is caused by activating LE safe mode after five kodi crashes, but is useless in live configuration.

    After switching to run disable safe mode with

    Code
    touch /storage/.config/safemode.disable
  • After switching to run for the image with GL support, disabling safe mode and adding the two xorg.conf files the ouput of the commands systemctl restart xorg.service , systemctl status xorg.service and journalctl -xeu xorg.service were similar to the ones mentioned in my previous post RE: nVidia Nouveau Driver. The file /var/log/Xorg.0.log was absent.

    During making the adaptations I have seen as output on the screen:
    [FAILED] Failed to start xorg.service
    [DEPEND] Dependency failed for windowmanager.service
    Later on i didn't see these anymore.

    Another message on the screen is: Job xorg server/start running ( "time"s/"time").

    Edited once, last by Johpin (January 16, 2025 at 9:14 PM).

  • If you created the /run xorg.conf and restarted the service the journal log should show Xorg starting in debug mode, which will generate a load more output and it would be useful to see that.

    I updated the image in the share (Xorg based) to include a couple of things .. but I'm making random guesses.