Add nvidia driver rolling package

I see. So you want also an nvidia-latest package (or mhwd profile maybe)

Basically. Maybe a mhwd profile for the nvidia driver without a specific version, which always contains the lastest version, could do it.

So current we have packages like
linux59-nvidia450
linux59-nvidia455

And a possible solution may be to add a profile / package like
linux59-nvidia
which installs the lastest version, so currently 455, but will change when a new version comes out.

This should also be compatible with the kernel metapackages (linux-latest, linux-lts),
for example by adding something like a
linux-latest-nvidia
package.

1 Like

You basically want it like how it’s done on Arch. They have a nvidia package, that gets updated with the newest version whenever it’s released.

1 Like

On the other hand it will have a bad experience for users who use older GPUs that are not supported by the latest nvidia drivers. When it comes to user friendliness auto recognition of the hardware and loading the correct driver is 100% necessary because of the policy of nvidia. So if a meta package like latest-nvidia will be supported, then it have to use the latest nvida driver that supports the the GPU.

Second point would be stability. With new driver versions the stability could be decreased. There are a lot of aspects which need to be considered. So in my opinion it would be much better, since nvidia is proprietary, to choose the version myself and test it before running it.

“manjaro settings” has notifications, but in my opinion and experience, it is badly implemented. At least on XFCE. It checks if a new kernel version is out or new language packages, but not nvidia drivers. When i get a new notification of kernel update for example, it just show me that something has been updated, but not what. It would be nice if the indicator there would have a context menu, when you can click “update nvidia driver” and will remove the old one and install the new one. Same thing for languages packages. Kernel notifications are really not needed, since it becomes updated with pamac.

So i would suggest to improve the manjaro settings, to make it more user friendly with some minor implementations so that it is more visible for a DAU (Dumbest assumed user). Automating things like creating a packages for the latest driver is good, but could have disadvantages for users with older GPUs and really don’t solve the problem of not knowing that there is a update for nvidia.

So :+1: for better notifications :slight_smile:

1 Like

Not really. The user has to manually install the nvidia-latest package if/once it exists. Just like how linux-latest for kernels isn’t preinstalled. The user has to install it manually.

Arch already does a rolling package. But seems non-optional since it’s tied to the nvidia package, unlike what is being requested here.

Ok for clarification: I mean if the new iso will use this meta package ‘nvidia-latest’. Sorry didn’t mention that. However, if you have to choose it manually, then it is ok.

But i remember this here recently:

The meta packages:

linux-rt-lts-manjaro
linux-rt-lts-manjaro-bbswitch
linux-rt-lts-manjaro-nvidia-430xx
linux-rt-lts-manjaro-r8168

were the reason of a problem that a GUI User can’t remove the old nvidia driver. mhwd couldn’t handle this. If now this package ‘latest-nvidia’ will come, then i beleve there will come problems from DAUs…

Yeah … but those are definitely not used by default … its both LTS and most importantly Real-Time.
(our mhwd profile for 5.4-rt isnt even marked LTS funny enough)
It wouldnt be available in mhwd at all, and certainly were packages specifically installed by the user.

This is a perfect example of my explanation above, and why its simply a misunderstanding or misuse of mhwd and/or packages.

If they had followed this kind of setup (all through mhwd, and not going outside of it manually installing packages without understanding), that is to say select 5.4-rt and nvidia-bumblebee-430xx in mhwd…
Then that wouldnt have been an issue at all. They could just select 450 instead if it was available.

There won’t be more problems. If he only wanted to remove the driver completely (without updating) he won’t have to uninstall more, since, when my proposal is used, linuxXX-nvidia would be there instead of linuxXX-430. So it won’t get worse, but stay the same.

On the other side, since he wanted to uninstall it to install a newer driver afterwards, my proposal would even solve this issue.
Because if he would use a mhwd config just called “nvidia” without a version number in it, he wouldn’t need to remove an older driver first and switch mhwd profiles for updating. MHWD wouldn’t have to do anything in this case, which would just vanish the problem with updating the nvidia driver while linux-lts or linux-latest metapackages are installed.

  1. I’m not talking about removing the older nvidia driver versions here. This could be a topic for another thread, since for very old hardware, the open source driver may be better anyway, but like I said, this is not the topic of this thread.
    The older nvidia driver version would stay in the repos, so anyone who needs them could just continue using them.

  2. A meta package which installs this old legacy drivers wouldn’t be useful because they don’t get updates anymore. So it would be a package pointing to another fixed package forever. This doesn’t help anyone.
    So I think a metapackage (and mhwd profile) just for the very latest nvidia driver would be enough.

Have you every had problems with the newest nvidia driver? I nevery had. Until now it was always the opposite, that the older drivers were causing problems because of incompatibilities with newer software.
In very most cases there shouldn’t be a need (and want) to use an older nvidia driver.

But yeah, a simple mhwd profile and metapackage wouldn’t remove the older drivers, so the option to use them would still be there, if you want to.

Better notifications could help a little. But not much.

  1. Casual users are used to just click away any popups / notifications. Many won’t know that they need to manually update there driver, even if there was a notification.

This is also part of why there is a linux-latest metapackage now, which gets automatically installed if a someone uses an EOL kernel.

  1. This would not fix the problem of having to do the updating of the driver manually. See my main post:
1 Like

Manjaro is a semi-rolling distribution because it has periodic sets of updates so it makes sense that drivers and kernels are also not rolling so they do not break when used in the sets of updates. I think the only way to get a true rolling package is to use a true rolling distribution.

I wrote a little script from scratch that would work in a pacman hook:

Are you looking for something like that?

Nice thanks for your effort,
but

this is not exactly what I’m looking for.

I want to be able to automatically update the nvidia driver, without having to uninstall packages and install new ones.
The package should stay the same, only the driver version contained should update. This way there are no package operations needed.
This would have the pros of:

  • Not needing to uninstall everything depending on nvidia
  • Not having to download a newer build of the older driver branch before switching to the new driver branch

My best idea for a solution is to have one “video-nvidia” mhwd profile, which uses one package per kernel (“linuxXX-nvidia”) which stays always installed and gets updated always to the newest driver.
This way we won’t have to uninstall stuff and reinstall it after. The installed package list will stay the same, only the version of the one package itself changes.
So just like it was in the old days, when there were not all the different nvidia driver versions in the repo but just one at a time (and per supported gpus).

Example:
Currently we have packages like
linux59-nvidia-450xx
linux59-nvidia-455xx

Now there would be an additional mhwd profile and package:
linux59-nvidia // (or maybe linux59-nvidia-latest)

This package would contain currently driver version 455.
But when for example driver 460 comes out, this exact package (linux59-nvidia) would become driver 460. Without changing its name. Without having to uninstall an old package and install a new one. It would stay the same, but contain the newer driver.
This would be optimal.

2 Likes

this cannot be apply because :

  • many laptop use older nvidia version
  • each compilation kernel require a passe for each driver nvidia

what will be done if latest goes for 440 series to 450 series ?
see
[Stable Update] 2020-08-22 - Kernels, Deepin, KDE-git, Firefox, Pamac, Nvidia 450, KDE Apps 20.08
https://forum.manjaro.org/t/stable-update-2020-08-28-kernels-systemd-pam-pambase-kde-git-deepin-pamac-nvidia-450-66-libreoffice-7-0/
how many help we get since 440 series to 450 series may go wrong ?

It can. We already have proven it in the past, when Manjaro used this exact approach.
Also Arch does the same and some other distros. So it is definitely possible.

Yeah, fine. They can continue to do so. There would be only an additional mhwd profile + package. I’m not talking about removing the existing one. So no harm is done here.

Yes, this is already the case for all the different driver versions and mhwd profiles which are currently in the repo. Adding one more shouldn’t be a problem.

Users using the mhwd profile for latest nvidia driver would get updated from 440 to 450 series.
This will keep their systems fully functional, since using older driver versions often break things because they are not compatible in combination with all the other new packages (cuda, ffmpeg nvenc, others using nvidia apis…)

Well, people can ask here in the forum. But I doubt this will happen often. Nvidia driver are usually well tested in my experience.
At least people have usually more problems when staying on older version compared to the latest anyway.
But in case they do have problems, they can just stay on the older version, as this new profile I suggest is only an addition to the existing ones.

@philm @aragorn @megavolt
we have found a candidate for testing hybrid cards

2 Likes

Ok understand… what you are looking for is then exclude mhwd and use a meta package like arch. Using a config “latest-yx” is not really useful in mhwd. That means extra packages that need to be managed and therefore extra work.

Anyway… the packages are already there. The script i mention above do what you expect, but it doesn’t overwrite it, but rather remove the old ones and install the new ones. I see no real benefit of your idea now… only a preference.

I still prefer the mhwd profile over a metapackage or pacman hook.

The downsides of just a metapackage:

  • There is no mhwd support. Updating the kernel means having to manually uninstall the metapackage for the driver first, update kernel with mhwd, afterwards installing the metapackage manually again for the new kernel. This are the manual steps I wan’t to avoid.

The downsides of the pacman hook:

  • On system update, it will first install the newest version of the old (currently installed) nvidia driver branch before downloading and installing the newer driver branch.
    This means we have to download unnecessary packages which will get uninstalled soon after installation again.
    If you have a fast internet connection this may be fine. But as in some locations in Germany here, I would really like to avoid any unnecessary downloads.
  • It needs to uninstall the old driver version first (before installing the new one), which is not possible if you have packages installed depending on nvidia (for example cuda and nvtop).
    So we have to manually uninstall and remember those packages to be able to update the driver, then afterwards manually install these packages again.
    These manual steps is what I try to avoid and the reason why I started this forum thread.

What I want is a fully automatic driver update. Without manual steps or unnecessary downloads.

You may say these manual steps are easy.
Well to that I can say yes, maybe for me. I know how to handle metapackages and update the driver. Maybe only noobs won’t.
But since I have to do this on multiple machines it is really annoying. So it should be fully automatic.

The goal here is that only running normal system updates is enough to keep nvidia driver up to date.
No unnecessary downloads, no manual package uninstalls/installs.
As far as I know, this is currently only possible with an additional (rolling) mhwd profile.

Both points are eligible and yes i understand this view. I believe that can be done in 2 pacman hocks in theory.

Lets say:

  1. a new mhwd profile will be installed: nvidia-450 is installed… new one is nvidia-455
  2. If the hock detects a newer profile before upgrading it will delete the current driver
  3. Then after installing the new profile, mhwd will with a second hook install the new driver
  4. dependencies like cuda or nvtop need then to be installed with “–asexplicit” so that it won’t bother, that can also be done with the first hock

I see also here: README.md · master · Applications / mhwd · GitLab that a similar idea is on the todolist:

  • don’t remove packages on reinstallation…

Feel free to contribute there :wink:

just my first thoughts… guess this won’t be possible because you have to do system updates first to update mhwd for the new profile of the new driver to be even available to install. So detecting new nvidia drivers before system update is not possible.

Second thing is:
Will this be installable in an easy way for everyone? How do you tell noobs on how to install pacman hooks?
Also, how will they be updated, in case somthing in the logic changes?

I would still prefer an official, obvious way. Like another mhwd profile for a rolling driver.
Especially since I’m not the only one struggling with this.
See threads / quotes like this:

ok let’t get more productive. So you expect something like this, right?

The MHWDCONFIG looks like this for 455xx:

$ cat /var/lib/mhwd/db/pci/graphic_drivers/nvidia-latest/MHWDCONFIG 
# mhwd Driver Config

NAME="video-nvidia-latest"
INFO="Closed source NVIDIA drivers for linux."
VERSION="2020.10.04"
FREEDRIVER="false"
PRIORITY="10"

CLASSIDS="0300 0302"
VENDORIDS="10de"
DEVICEIDS=">/var/lib/mhwd/ids/pci/nvidia-latest.ids"

# Conflicts
CONFLICTS="nvidia-340xx-utils nvidia-390xx-utils nvidia-418xx-utils nvidia-430xx-utils nvidia-435xx-utils nvidia-440xx-utils nvidia-450xx-utils"
CONFLICTS_64="lib32-nvidia-340xx-utils lib32-nvidia-390xx-utils lib32-nvidia-418xx-utils lib32-nvidia-430xx-utils lib32-nvidia-435xx-utils lib32-nvidia-440xx-utils lib32-nvidia-450xx-utils"
CONKMOD="nvidia-340xx nvidia-390xx nvidia-418xx nvidia-430xx nvidia-435xx nvidia-440xx nvidia-450xx"

# Conflicts with other mhwd configs
MHWDCONFLICTS="video*nvidia-*"

# Dependencies
DEPENDS="nvidia-455xx-utils"
DEPENDS_64="lib32-nvidia-455xx-utils"
DEPKMOD="nvidia-455xx"

XORGFILE="/etc/X11/mhwd.d/nvidia.conf"
MHWDGPU_BLCKLSTNVIDIA="/etc/modprobe.d/mhwd-gpu.conf"
MHWDGPU_MODLDNVIDIA="/etc/modules-load.d/mhwd-gpu.conf"

fix_screen_flickering()
{
	sed -i /'Section "Device"'/,/'EndSection'/s/'EndSection'/"\tOption \"RegistryDwords\" \"PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x2; PowerMizerDefaultAC=0x1\"\nEndSection"/g "${XORGFILE}"
}

post_install()
{
	nvidia-xconfig -o "${XORGFILE}" --composite &>/dev/null
	MHWD_ADD_BACKSPACE "${XORGFILE}"

	# Remove logo
	sed -i /'Section "Device"'/,/'EndSection'/s/'EndSection'/"\tOption \"NoLogo\" \"1\"\nEndSection"/g "${XORGFILE}"

	# Fix screen flickering for some nvidia devices
	MHWD_FUNC_ON_MATCH 0300 10de "0400 0401 0402 0403 0407 0409 0425" fix_screen_flickering

	mhwd-gpu --setmod nvidia --setxorg "${XORGFILE}"

	# Without this 'glxgears' don't work in live-session
	MODULES_LOAD="/etc/modules-load.d"
	echo "nvidia-drm" >> "${MODULES_LOAD}/mhwd-gpu.conf"
	if [ ! "$(pgrep X)" ];	then
		modprobe nvidia-drm
	fi
}



post_remove()
{
	if [ -e "${XORGFILE}" ]; then
		rm "${XORGFILE}"
	fi

	if [ -f "${MHWDGPU_BLCKLSTNVIDIA}" ]; then
		sed -i '/^blacklist nouveau/d' "${MHWDGPU_BLCKLSTNVIDIA}"
		sed -i '/^blacklist ttm/d' "${MHWDGPU_BLCKLSTNVIDIA}"
		sed -i '/^blacklist drm_kms_helper/d' "${MHWDGPU_BLCKLSTNVIDIA}"
		sed -i '/^blacklist drm/d' "${MHWDGPU_BLCKLSTNVIDIA}"
	fi

	if [ -f "${MHWDGPU_MODLDNVIDIA}" ]; then
		sed -i '/^nvidia/d' "${MHWDGPU_MODLDNVIDIA}"
	fi

	mhwd-gpu --check
}

This is the mhwd database:

$ cat /var/lib/mhwd/ids/pci/nvidia-latest.ids
# List generated by mhwd. Do not edit manually.
0fc0 0fc1 0fc2 0fc6 0fc8 0fc9 0ff3 0ff9 0ffa 0ffd 0ffe 0fff 1001 1004 1005 1007 1008 100a 100c 1021 1022 1023 1024 1026 1027 1028 1029 102a 102d 103a 103c 1180 1183 1184 1185 1187 1188 1189 118a 118e 118f 1193 1194 1195 11b4 11ba 11c0 11c2 11c3 11c4 11c5 11c6 11c8 11cb 11fa 1280 1281 1282 1284 1286 1287 1288 1289 128b 1340 1341 1344 1346 1347 1348 1349 134b 134d 134e 134f 137b 1380 1381 1382 1390 1391 1392 1393 1398 1399 139a 139b 139c 139d 13b0 13b1 13b2 13b3 13b4 13b6 13b9 13ba 13bb 13bc 13c0 13c2 13d7 13d8 13d9 13da 13f0 13f1 13f2 13f3 13f8 13f9 13fa 13fb 1401 1402 1406 1407 1427 1430 1431 1436 15f0 15f7 15f8 15f9 1617 1618 1619 161a 1667 174d 174e 179c 17c2 17c8 17f0 17f1 17fd 1b00 1b02 1b06 1b30 1b38 1b80 1b81 1b82 1b83 1b84 1b87 1ba0 1ba1 1ba2 1bb0 1bb1 1bb3 1bb4 1bb5 1bb6 1bb7 1bb8 1bb9 1bbb 1bc7 1be0 1be1 1c02 1c03 1c04 1c06 1c07 1c09 1c20 1c21 1c22 1c23 1c30 1c31 1c60 1c61 1c62 1c81 1c82 1c83 1c8c 1c8d 1c8f 1c90 1c91 1c92 1c94 1c96 1cb1 1cb2 1cb3 1cb6 1cba 1cbb 1cbc 1cbd 1cfa 1cfb 1d01 1d10 1d11 1d12 1d13 1d16 1d33 1d34 1d52 1d81 1db1 1db3 1db4 1db5 1db6 1db7 1db8 1dba 1df0 1df2 1df5 1df6 1e02 1e04 1e07 1e30 1e36 1e81 1e82 1e84 1e87 1e89 1e90 1e91 1e93 1eb0 1eb1 1eb5 1eb6 1eb8 1ec2 1ec7 1ed0 1ed1 1ed3 1ef5 1f02 1f06 1f07 1f08 1f09 1f0a 1f10 1f11 1f12 1f14 1f15 1f36 1f42 1f47 1f50 1f51 1f54 1f55 1f76 1f82 1f91 1f95 1f96 1f97 1f98 1f99 1f9c 1fb8 1fb9 1ff9 20b0 2182 2184 2187 2188 2191 2192 21c4 21d1 2204 2206 1140 11a0 11b60

Et voila… that is mhwd with video-nvidia-latest :smiley:

Now the maintainer needs to fill this everytime with the latest driver… but this wont be updated to next version… it will stuck on 455… now create a meta package with the 455xx driver with a name video-nvidia-latest.

If you need this i can create a AUR package at least… xD

PS: The conflicts needs an update… at least some meta packages must be added in my opinion.

2 Likes