nVidia Nouveau Driver

  • LibreELEC:/run/libreelec/debug # cat xorg.conf returns XORG_DEBUG="-logverbose 6 -verbose 6" .

    systemctl status xorg.service shows a line with /bin/sh /usr/bin/xorg-launch -nolisten tcp vt01 -logverbose 6 -verbose 6.

    journalctl -xeu xorg.service has as output:
    Jan 17 08:02:53 LibreELEC systemd[1]: Starting xorg.service...
    Jan 17 08:02:53 LibreELEC (g-launch)[899]: xorg.service: Referenced but unset environment variable evaluates to an empty string: XORG_DEBUG
    Jan 17 08:03:33 LibreELEC systemd[1]: xorg.service: Failed with result 'protocol'.
    Jan 17 08:03:33 LibreELEC systemd[1]: Failed to start xorg.service.
    Jan 17 08:03:35 LibreELEC systemd[1]: xorg.service: Scheduled restart job, restart counter is at 1.

    LibreELEC:/var/log # ls returns README    btmp      lastlog   log.nmbd  log.smbd  private   wtmp => Xorg.0.log is missing.

    I am surprised about the [DEPEND] Dependency failed for windowmanager.service I have seen one time. I did not expect gbm needs an X-server and the X-server needs a window manager (or maybe a display manager?).

    I also should expect Kodi should be compiled against gl instead of gles.

  • I am surprised about the [DEPEND] Dependency failed for windowmanager.service I have seen one time. I did not expect gbm needs an X-server and the X-server needs a window manager (or maybe a display manager?).

    I also should expect Kodi should be compiled against gl instead of gles.

    The first image I shared was GBM based but after having suspicions on GLES support I switched to X11/GL, and we use fluxbox as a minimal window manager (Xorg requires there to be one).

    If you stop xorg.service and manually run /usr/bin/xorg-launch -nolisten tcp vt01 -logverbose 6 -verbose 6 what output do you get on the console?

  • LibreELEC:~ # systemctl stop xorg.service
    LibreELEC:~ # /usr/bin/xorg-launch -nolisten tcp vt01 -logverbose 6 -verbose 6
    LibreELEC:~ # 

    No output.

    Did you configure Kodi with -DCORE_PLATFORM_NAME=gbm -DAPP_RENDER_SYSTEM=gl before compiling for your second image? I expect this should work.

    On Slackware64 I configured Kodi by -DCORE_PLATFORM_NAME="gbm x11" -DAPP_RENDER_SYSTEM=gl and it resulted in a Kodi running in a tty and under x11 (with the Nouveau driver).

    Edited once, last by Johpin (January 17, 2025 at 7:09 PM).

  • Just two thoughts.

    The xorg configuration is not implemented for nouveau. xorg-configure is not called from udev.


    Another issue fot both GBM and X11 may be the missing VAAPI configuration when building nouveau driver alone. Try adding VAAPI_SUPPORT="yes" here.

  • I'm not seeing errors or warnings in the Xorg log and if you're seeing a mouse pointer that suggests Xorg is up/running. The Q is then why Kodi isn't rendering the GUI to the windowmanager?

    At mglae suggestion I've made another VAAPI change, so please do the following:

    a) Download the latest .tar file from my test share to /storage/.update

    b) Create /storage/.kodi/userdata/advancedsettings.xml with this content to enable debug logging

    XML
    <?xml version="1.0" encoding="utf-8" ?>
    <advancedsettings version="1.0">
      <!-- enable debug logging -->
      <loglevel hide="false">1</loglevel>
    </advancedsettings>

    c) Reboot to initiate the update, then run "pastekodi" to share the system log and Kodi log.

  • chewitt Great, I'll continue on github.


    Johpin Now xorg did start but kodi is in a fail/restart loop. pastekodi is needed - or pastecrash if there is a crash log below /storage/.kodi/temp.

    Few notes to improve testing workflow:

    1. There is no need to install any new image, you can update on reboot with keeping the configuration:
      wget -P /storage/.update <url>
    2. For keyboard reboot first switch the console: ctrl-alt-F2 then ctrl-alt-delete.
    3. While testing it is helpful to disable xorg and kodi restart. Create /storage/.config/system.d/xorg.service.d/norestart.conf and /storage/.config/system.d/kodi.service.d/norestart.conf with:
    Code: norestart.conf
    [Service]
    Restart=no
  • The fourth image, the one from today, I downloaded and copied to another hard disk. I added the xorg.conf files, the safemode.disable and the norestart.conf files. Next time I will make use of .update.

    pastekodi: https://paste.libreelec.tv/amazing-satyr.log

    In /storage/.kodi/temp there is a kodi.log, but no file with "crash" in the name.

    Shutting down procedure stops at certain moment: problem unmounting /run/shutdown/mounts/"something" Device of resource busy

    Edited once, last by Johpin (January 18, 2025 at 4:17 PM).

  • Code
    Jan 18 15:38:34.552496 LibreELEC kodi.sh[840]: libEGL warning: egl: failed to create dri2 screen
    Jan 18 15:38:34.562281 LibreELEC kodi.sh[840]: glx: failed to create drisw screen
    Jan 18 15:38:34.581328 LibreELEC kodi.sh[840]: ERROR: Can not initialize OpenGL context. Exiting
    Jan 18 15:38:34.581482 LibreELEC kodi.sh[840]: ERROR: Unable to create GUI. Exiting

    ^ from logs, but I'm not seeing the error/issue. It's a looong time since I poke Xorg stuff though.

    Latest image in the share (update from .tar again) has this change per mglae suggestion:

    DRIVER=="nouveau", ENV{xorg_driver}="nouveau", TAG+="systemd", ENV{SYSTEMD_WANTS}+="[email protected]"

    For kicks, also add video=HDMI-A-1:1920x1080M@60 to kernel boot params in syslinux.cfg

  • Code
    Jan 18 15:38:34.552496 LibreELEC kodi.sh[840]: libEGL warning: egl: failed to create dri2 screen
    Jan 18 15:38:34.562281 LibreELEC kodi.sh[840]: glx: failed to create drisw screen
    Jan 18 15:38:34.581328 LibreELEC kodi.sh[840]: ERROR: Can not initialize OpenGL context. Exiting
    Jan 18 15:38:34.581482 LibreELEC kodi.sh[840]: ERROR: Unable to create GUI. Exiting

    This is exactly the error I'm currently seeing with Generic-legacy on Intel HW. We may fight against some mesa issue.

    It may be worth to test the changes on top of LE12 (maybe an exercise for Johpin ?)

  • mglae Providing me tar files to test is no problem. For other things I think I need more instructions.

    I am trying the gbm/gl way and have applied changes to the file projects/Generic/devices/gbm/options:
    OPENGL="mesa" and OPENGLES="no" and added GRAPHIC_DRIVERS="nouveau".

    In step 246 from 297 steps the following error is shown: ../meson.build:21:9: ERROR: Dependency "gl" not found, tried pkgconfig and system and FAILURE: scripts/install glu:target has failed!

    How to proceed (adding gl)?

  • Johpin LE is building GBM with gles, I'm not sure if using GL is possible.

    The idea is to port chewitt work to LE 12:

    Code
    git remote add chewitt https://github.com/chewitt/LibreELEC.tv.git
    git fetch chewitt
    git checkout libreelec-12.0 
    git pull
    git checkout -b le12_nouveau
    git cherry-pick chewitt/nouveau 

    But the last line result into two conflicts. I've fixed them and you can use:

    Code
    git checkout libreelec-12.0 
    git pull
    git checkout -b le12_nouveau
    wget -O - https://paste.libreelec.tv/peaceful-alien.log|git am

    Then build with PROJECT=Generic DEVICE=nouveau (untested).

  • mglae On Slackware64 15.0 I have built Kodi successfully with gbm/gl. I should like to try it for LE.

    0. Undone my changes by git reset --hard
    1. git checkout libreelec-12.0  => fine
    2. git pull => fine
    3. git checkout -b le12_nouveau => fatal: a branch named 'le12_nouveau' already exists => has been done earlier by me
    4a git config --global user.name "Jophin1"
    4b wget -O - https://paste.libreelec.tv/peaceful-alien.log|git am

    PROJECT=Generic DEVICE=Nouveau ARCH=x86_64 make image

    Unfortunately it seems not to be a rebuild, but a build from scratch: it will take 28 hours to finish the building on an Intel E6300 CPU (Duo Core 2 2x1,87 GHz) ...

  • With a distribution like Slackware64 you do have any lib available. With The JEOS LE only the required libs are build, therefore you have to change configuration to build the new lib.

    fatal: a branch named 'le12_nouveau' already exists

    New generated branches can have any name.

    it will take 28 hours to finish the building

    You are really patient.

  • With The JEOS LE only the required libs are build, therefore you have to change configuration to build the new lib.

    Slackware is using mesa for opengl, see https://www.linuxquestions.org/questions/slac…03/#post6361995 . I have the impression LE is using the same (graphics/mesa/package.mk). I see in the configuration part of graphics/mesa/package.mk -Dopengl=true .

    Unfortunately the building stopped at step 183 from 288 steps with the following error:
    ../meson.build:448:3: ERROR: Feature egl cannot be enabled: EGL requires DRI, Haiku, Windows or Android
    A full log can be found at /home/john/LibreELEC.tv/build.LibreELEC-Nouveau.x86_64-12.0-devel/build/mesa-24.0.9/.x86_64-libreelec-linux-gnu/meson-logs/meson-log.txt

    meson-log.txt shows the first message at the end of the file and can be found in: https://paste.kodi.tv/eyakicejuv.kodi

    I found in https://wiki.libreelec.tv/configuration/…or-syslinux.cfg some boot parameters. Where could I find all boot parameters? I am looking for something like "from=/my_dir" for /storage/my_dir. I have the plan to test dual boot on a hard disk with a fresh installed OS to test, but I don't want all these directories from LE in my root directory "/" of Slackware.

    Edited 3 times, last by Johpin (January 20, 2025 at 9:25 AM).

  • In syslinux.cfg you can set "boot=/dev/sda1 disk=/dev/sda2" where /dev/sda1 is the /flash (boot) partition, and /dev/sda2 will be used for the /storage. You can also mount using disk labels, e.g. "boot=LABEL=LIBREELEC" or UUIDs. The full list of boot flags is a mix of LE specific things (read the 'init' script which is in the initramfs, see in the busybox package) and kernel things, which will be covered by kernel documentation on boot params. I would recommend configuring the PC to boot from USB and leave it that way until something works.

    Back on-topic:

    The fact we see some variant of failing to create an EGL surface under both display environments perhaps hints to something in-common between them. LE uses OpenGL-ES for Generic (GBM) and OpenGL for Generic-Legacy (X11) images. Both environments leverage mesa, but in different ways. I know mglae is already thinking about a mesa bug, and I'm starting to wonder the same.

    I pushed changes to the patch so "Nouveau" is now GBM, and I added "Nouveau-Legacy" which uses X11 (as you've been testing). I'm currently building both, which is normally around 40 mins/image for me.

    EDIT: I pushed both images here: https://chewitt.libreelec.tv/testing