Support for legacy driver for dietpi bullseye - NVIDIA-Linux-x86_64-340.108.run

Creating a bug report/issue

Required Information

  • DietPi Version:
G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=17
G_DIETPI_VERSION_RC=2
G_GITBRANCH='master'
G_GITOWNER='MichaIng'
G_LIVE_PATCH_STATUS[0]='applied'
G_LIVE_PATCH_STATUS[1]='not applicable'
  • Distro version : bullseye
  • Kernel version: Linux DietPi 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64 GNU/Linux
  • Architecture: amd64
  • SBC model: Native PC (x86_64)

Additional Information (if applicable)

  • Software title: nvidia legacy 340 driver
  • Was the software title installed freshly or updated/migrated: nvidia Driver NOT SUPPORTED out of the box
  • Can this issue be replicated on a fresh installation of DietPi? YES see bellow build compil error
  • Bug report ID: 152b8cda-489a-42ea-a6d9-1500c519ba1a

Steps to reproduce

I used some hints from this dietpi post

  1. uninstalled nvidia installed programs/
#uninstall gfx drivers from dietpi-config
apt-get remove --purge nvidia-legacy-check
apt-get remove --purge nvidia-installer-cleanup
  1. Installed kernel header.
apt install linux-headers-$(uname -r)
  1. Download supported driver for my nvidia card (confirmed driver for my card and working ok in slackware 14.1 current)
https://www.nvidia.com/Download/driverResults.aspx/156163/en-us/
  1. Run the installer.
bash /NVIDIA-Linux-x86_64-340.108.run

Expected behaviour


  • Compile and install driver on dietpi for kernel 5.10.0-23-amd64

Actual behaviour


  • I got this compilation error:
   In file included from /tmp/selfgz1268/NVIDIA-Linux-x86_64-340.108/kernel/nv.c:13:
   /tmp/selfgz1268/NVIDIA-Linux-x86_64-340.108/kernel/nv-linux.h: At top level:
   /tmp/selfgz1268/NVIDIA-Linux-x86_64-340.108/kernel/nv-linux.h:139:10: fatal error: linux/ioctl32.h: No such file or directory
     139 | #include <linux/ioctl32.h>          /* register_ioctl32_conversion()    */
         |          ^~~~~~~~~~~~~~~~~
   compilation terminated.
   make[3]: *** [/usr/src/linux-headers-5.10.0-23-common/scripts/Makefile.build:291: /tmp/selfgz1268/NVIDIA-Linux-x86_64-340.108/kernel/nv.o] Error 1
   make[2]: *** [/usr/src/linux-headers-5.10.0-23-common/Makefile:1852: /tmp/selfgz1268/NVIDIA-Linux-x86_64-340.108/kernel] Error 2
   make[2]: Leaving directory '/usr/src/linux-headers-5.10.0-23-amd64'
   make[1]: *** [Makefile:192: __sub-make] Error 2
   make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-23-common'
   NVIDIA: left KBUILD.
   nvidia.ko failed to build!

Extra details

It seems there is no Debian 340 driver on bullseye. There is a sid option but I did not want to mix repositories.

There is a driver in Debian 10 buster.
Is it possible to downgrade dietpi and keep it updated in debian buster?

Thanks for your advice and guidance.

|Software Element|Min Requirement|Check With...|
|---|---|---|
|binutils|2.9.5|size --version|
|GNU make|3.77|make --version|
|gcc|2.91.66|gcc --version|

http://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/README/minimumrequirements.html

see if you have this installed as well
sudo apt install build-essential

Also saw this about DKMS module
http://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/README/installdriver.html#InstallingTheKe997db

It is not DietPi that would need to be downgrade as DietPi is just a set of bash script. It would be Debian that would need to be downgraded :wink:

We don’t support Stretch anymore. As well Buster is on it’s way out. Anyway, I don’t think it would be possible to downgrade Debian as it would require all apt packages to be reinstall with Buster version.

Thank you @WarHawk for your response

Yes, build-essential is installed.

https://wiki.debian.org/NvidiaGraphicsDrivers#Version_340.108

States that unfortunately there is a driver only up to buster and sid, not on bullseye.

I tested sid nvidia legacy 340 driver install procedure from that link. Driver builds ok, but X env does not start.

I did it on current dietpi and on dev dietpi bookworm

I have this PC working ok, with debian 10 buster (kanotix) (2GB RAM pentium 4 dual core). I like the small dietpi memory footprint including desktop environment, that is why I wanted to use it on this box.

Is there any chance of having dietpi on buster? I just want this PC to browse the internet for desktop use.

I started loving DietPi and I see an space oportunity for old PCs, not a full support of course, but at least have some LTS dietpi versions and leave as-is old version supported by Debian with sec patches. Savvy users can maintain Debian installs in that case (respectful suggestion).

Again, thanks for helping me.

Francisco

For this use case nouveau should be enough.

2 Likes

Thanks @pulpe. Good point, but my problem is that the original install did not started my desktop (I assume using nouveau driver). I am going to repeat the install and check this carefully.

What is the state of that driver? Failing for what kind of tasks? I have seen a bad fame for it but is it worth to test it to revive this PC.

Rgds, Fco

Thanks @joulinar. The best option is Debian Buster. Is there a chance to have the original script used by DietPi for Debian Buster?. In this case I can reinstall Buster in a dedicated partition an run DietPI script on it to “optimize” that install and I can maintain that install while Debian release security patches for Buster. I love DietPi small memory footprint in favor of my old PC. Thanks for your advice.

Well 3D (games etc.) are no go.

I myself am using nouveau on my desktop PC (debian) for browsing the web, youtube, office etc. just basic PC stuff and it works great.

1 Like

You mean DietPi installation script? Theoretically it should work to install plain Debian Buster netinst on a new partition and run our install script afterwards.

You mean DietPi installation script? Theoretically it should work to install plain Debian Buster netinst on a new partition and run our install script afterwards.

Yes @Joulinar, I installed buster netinst and then DietPiinstall script to convert plain Debian into DietPi, as you adviced here.

I did it yesterday for bullseye and bookworm. It seems the only 2 options currently supported. I did not find an older script.

Thanks for your help and advice.

Francisco.

I see, you might need to download the script and add Buster option manually into this line

1 Like

@Joulinar I downloaded the referred script and added a buster line as advised

# Distro selection
		DISTRO_LIST_ARRAY=(
			'5' ': Buster (old stable release, testing)'
			'6' ': Bullseye (current stable release, recommended)'
			'7' ': Bookworm (testing, if you want to live on bleeding edge)'
		)

dietpi conversion was running ok and stopped with this error message:

Details:

  • Date | Sat May 27 00:19:59 CDT 2023
  • DietPi version | v8.17.2 (MichaIng/master)
  • Image creator |
  • Pre-image |
  • Hardware | (ID=21)
  • Kernel version | Linux voyager 4.19.0-24-amd64 #1 SMP Debian 4.19.282-1 (2023-04-29) x86_64 GNU/Linux
  • Distro | buster (ID=5,RASPBIAN=0)
  • Command | apt-get -y --allow-change-held-packages install apt bash-completion bzip2 ca-certificates cron curl fdisk gnupg htop iputils-ping locales nano p7zip parted procps psmisc sudo systemd-sysv tzdata udev unzip wget whiptail e2fsprogs dosfstools console-setup ethtool fake-hwclock ifupdown isc-dhcp-client kmod rfkill systemd-timesyncd usbutils haveged dropbear-run hdparm firmware-linux-free firmware-misc-nonfree firmware-realtek
  • Exit code | 100
  • Software title | DietPi-Installer
Reading package lists...
Building dependency tree...
Reading state information...
apt is already the newest version (1.8.2.3).
bash-completion is already the newest version (1:2.8-6).
ca-certificates is already the newest version (20200601~deb10u2).
console-setup is already the newest version (1.193~deb10u1).
cron is already the newest version (3.0pl1-134+deb10u1).
e2fsprogs is already the newest version (1.44.5-1+deb10u3).
firmware-linux-free is already the newest version (3.4).
hdparm is already the newest version (9.58+ds-1).
ifupdown is already the newest version (0.8.35).
iputils-ping is already the newest version (3:20180629-2+deb10u2).
kmod is already the newest version (26-1).
nano is already the newest version (3.2-3).
whiptail is already the newest version (0.52.20-8).
procps is already the newest version (2:3.3.15-2).
usbutils is already the newest version (1:010-3).
fdisk is already the newest version (2.33.1-0.1).
wget is already the newest version (1.20.1-1.1).
bzip2 is already the newest version (1.0.6-9.2~deb10u2).
curl is already the newest version (7.64.0-4+deb10u6).
locales is already the newest version (2.28-10+deb10u2).
isc-dhcp-client is already the newest version (4.4.1-2+deb10u3).
systemd-sysv is already the newest version (241-7~deb10u9).
udev is already the newest version (241-7~deb10u9).
tzdata is already the newest version (2021a-0+deb10u11).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 systemd-timesyncd : Depends: systemd (= 247.3-6~bpo10+1) but 241-7~deb10u9 is to be installed
                     Breaks: systemd (< 245.4-2~) but 241-7~deb10u9 is to be installed
E: Unable to correct problems, you have held broken packages.

What do you think? Stopped on that point.

Thanks again for your advice and guidance.

Francisco

Poking around
apt install nvidia-legacy-340xx-driver
https://wiki.debian.org/NvidiaGraphicsDrivers#stretch-340xx
https://wiki.debian.org/NvidiaGraphicsDrivers#Version_418.152_.28via_stretch-backports.29

Hope this helps

Thanks for this info, WarHawk.

nvidia 340 legacy driver is supported up to buster and sid. My expectation was to use Dietpi on this 2GB RAM box with 340-nvidia driver. I was testing running dietpi installation script on buster as @Joulinar advised above, but it seems there are broken packages. Unfortunatelly only bookworm and bullseye has support currently by DietPi.

It seems I will end up installing bullseye netinst+dietPI script to see performance with nouveau driver. I will give it a try as @pulpe advised above.

Rgds, Fco

The Buster option has been removed from dietpi-installer since it is EOL from Debian end and DietPi itself will soon drop support for it as well.

That legacy Nvidia driver obviously does not build anymore on recent (well 5.10, also old already) Linux versions, at least not without patches, which is likely also the reason why Debian removed it with Bullseye. You could try the package from Sid but it might not work with this kernel either. What is the problem with nouveau?

Thanks @MichaIng for your response and for this spectacular product I am starting to love.

Yes, it seems I just have one option with nouveau driver.
Steps:

  1. Installed bullseye netinstall. nouvea driver was loaded ok.
  2. run dietpi-installer. Run flawlessly.
  3. Respectul Suggestions:
    3.1. Installer reports that there is no gfx installed and brings user to dietpi-config where there is an option for nvidia (it should contains an option to verify loaded gfx drivers). It seems it loads a generic nvidia driver that does not detect my legacy card. DO NOT USE THIS OPTION just continue. Installer, in this case, should detect loaded nouveau driver to avoid this option. Additionally dietpi-config should check dmesg messages to check if that nvidia driver detected gfx card ok and provide an option to install nouveau driver.
    3.2. Loaded mate Desktop Env. shortcuts in SYSTEM to dietpi-software, and other should have a “sudo” before command to run. A normal user can be confused as this scripts require root priviledges.

So far I tested xfce and mate Desktop environments with 300MB memory used footprint, after loading (less than a half of a normal debian install). This is good!.

I wanted to install nvidia driver because I used that box to watch HLS streams delivered over HTTPS with Full HD resolution and internet browsing. mpv blames about slow hardware… streams are slow motion. That is the downside (not dietpi fault), but in general DietPI comes very well for my OLD and lovely PC. RPis boxes are not easy to buy nowaday…

Tested lxde, lxqt, xfce but I could not start gnustep as there is no gnustep-session- lxde just uses 210Mb. I like xfce.

Finally @MichaIng ,I see dietpi requires, as a good practice, minimum user intervention installing sw or tweeking config files. What areas are “red lines” to avoid and not affect Dietpi?

Thanks again to DietPI Team for this very good product.

Regards, Francisco.

You could try to enable non-free repos in /etc/apt/sources.list and install firmware-linux as it will install some nvidia firmware blobs that are used by nouveau.

1 Like

This firmware is installed OOTB.

The driver is preinstalled (Debian kernel module) and loaded automatically if a matching GPU is detected, along with the matching firmware. The only thing that could be additionally done is installing the nouveau DDX driver for X 2D/desktop acceleration:

apt install xserver-xorg-video-nouveau

But actually, I’m wondering if this gives any benefits over the generic modesetting DDX. It provides hardware acceleration as well via glamor (instead of EXA).

The shortcuts which do require root permissions are not installed on non-root desktops. When you run those scripts as non-root user, the error message should tell you that you need to call them with sudo. For pre-installing them with sudo included, we’d need to know which unprivileged user is actually aimed to do those tasks, and has sudo permissions. I think this is something the admin can better do manually, knowing which user is used for which tasks. Note that the dietpi user is about to be removed (from new DietPi images) and replaced with a prompt for optional user creation on first boot.

1 Like

If you enable non-free repos, with firmware-linux it will install firmware-linux-nonfree and it is not installed on clean debian by default.

On DietPi, the non-free component is enabled OOTB and the firmware-misc-nonfree (yours is a meta package for it + AMD firmware) preinstalled.

2 Likes