-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flatpak downloads every nvidia driver from flathub at every update #42
Comments
So currently the What we need is for it to somehow detect if only a new version was added and only export those. Maybe @barthalion has a clever idea for this. Just a thought: The script could get a list of nvidia packages in flathub already and compare that to our list of versions. It could also possibly check a git diff of the current commit to see if only data files were changed and nothing else. |
I've thought about this before. A potential problem I see is what would happen if URLs for older releases change or get removed. (It hasn't happened yet but could in the future.) Rebuilding releases on each commit guarantees that the older releases still exist and work on the latest version of Flatpak. There are definitely better ways to combat this problem, though. |
There are potentially fancy things would could do like maybe indicate partial or full builds from the commit messages... Getting into a bit of work but I think update churn is bad enough that its worth it. |
Do you remove your old drivers from your flatpak installation when you upgrade to a new driver series? I don't think |
Still have this ussie in 1.14.0 on Ubuntu 22.04.
|
Someone can correct me if I'm wrong, but you can probably prevent a re-install by simply 'masking' the drivers, e.g.
You check your masked apps/runtimes with:
|
I think this will be a good workaround because it will prevent the redundant updates that come from the sane nvidia driver being rebuilt for no reason just because another drier got added. However this could become problematic in the future should an actual change happen to the Flathub package that needs to be downloaded for an already-installed driver. Nvidia updates from Flathub are definitely very "cry wolf" until this bug gets fixed for real. It's been over two years since this issue was opened. It's the build.sh script that builds every version? How does it get called? What sort of state and/or data persists between builds? |
Yes.
See arguments assignments at https://github.com/flathub/org.freedesktop.Platform.GL.nvidia/blob/master/build.sh#L5
None. You can query available refs with flatpak CLI in build.sh. |
It seems to help |
Probably same downloaded driver can be cached? |
Is there any way to prevent the nvidia driver from updating at all, as long as a fresh version is not required as dep? something like hold? |
@Flashwalker EDIT: Well this was already covered above... |
Why on earth would flatpak install Nvidia drivers? Using Ubuntu 22.04, two software stores? FIne. Now, this? I even cannot update Nvidia drivers from the system app software and update anymore and all is greyed. Consider uninstalling fatpak. |
@joezhouchenye It doesn't have to. Ubuntu could package the drivers for flatpak. No idea what else you are ranting about. You can run |
Having read through this and found it helpful, I just wanted to summarize the step I took to fix it. flatpak uninstall --unused
flatpak list --runtime Look for the nvidia version in use. I got something along the lines of:
you are going to use this line:
You then mask the appropriate packages
now run your updates
Is there a place I could put this in the documentation? |
It seems repeated download happen only after updating kernel |
Same problem. |
how did you do it? |
@poltpolt That's not a valid package name, it's missing the driver version on it. Here's an example if you're using version
To avoid having to figure out the driver version manually, you can use something like this to mask the current driver version:
|
so it is not a mask but in fact an exclusion for particular package... for me a mask is something that covers more then one particular identifier but a bit broader |
Well, you could technically do something like |
I wrote a bash script you want to run after you upgrade your host system nvidia driver:
#!/bin/bash
oldver="$(flatpak list | grep -oP 'org.freedesktop.Platform.GL.nvidia-(\d|-)+')"; oldver="${oldver#*-}"; oldver2="${oldver%-*}"; oldver2="${oldver2//-/}"
newver="$(cat /sys/module/nvidia/version 2>/dev/null | tr '.' '-')"
function echover {
echo "flatpak nvidia driver: ${oldver}"
echo "host nvidia driver: ${newver}"
}
function update {
echover
echo 'Updating...'
sudo flatpak install org.freedesktop.Platform.GL.nvidia-"${newver}" &&
sudo flatpak mask org.freedesktop.Platform.GL{,32}.nvidia-"${newver}"
sudo flatpak mask --remove org.freedesktop.Platform.GL{,32}.nvidia-"${oldver}"
sudo flatpak remove org.freedesktop.Platform.GL{,32}.nvidia-"${oldver}"
exit
}
# If host driver version older than flatpak one
if [[ ${newver//-/} -gt ${oldver//-/} ]]; then
update
elif [[ "$(echo -n ${newver//-/} | wc -c)" -eq "$(echo -n ${oldver2} | wc -c)" ]] && [[ ${newver//-/} -gt ${oldver2} ]]; then
update
# If both tha same
elif [[ ${newver//-/} -eq ${oldver//-/} ]]; then
echover
echo 'same. do nothing.'
exit
else
echover
exit
fi
|
This is helpful but results in "unary operator expected" errors in lines 12 and 21. Easily fixed by double brackets instead of single one's. However it then ends in "error: No current masked pattern matching org.freedesktop.Platform.GL.nvidia-" which I assume is part of the removal part of the previous runtime. |
Thnx, fixed
Perhaps regexp for oldver is not working for you. Try running it and see if it works: flatpak list | sed -rn 's/org.freedesktop.Platform.GL.nvidia-([-[:digit:]]+)[[:space:]]+.*$/\1/p' | sed -rn 's/^.*[[:space:]]+([-[:digit:]]+)/\1/p' output should be like: 545-29-06 |
sigh.... the morons did it again and released a hotfix version willy nilly and now no flatpaks will run anymore and once again I probably have to wait a month for someone to fix it. Output is nvidia-550-54-14 which is the most current flatpak version..... driver version is nvidia-550-54-15. However runtimes also also installed are nvidia-525-125-06, nvidia-525-147-05 and nvidia-545-23-08. For some reason DDM refuses to uninstall 525 so technically I have multiple drivers installed which in itself confuses the system.... I also cannot manually downgrade or uninstall 525 because of dependency problems which is a separate issue. |
@rambo919 |
No I mean on system level 525 is still installed as well as the latest one the corresponding flatpaks. I blame nvidia for simply not caring about anyone other than AI farmers at this point. Unlike in windows you cannot downgrade the driver if you need to if you use the nvidia repo, you are forced to upgrade unless you remember to force freeze the version. It took me far too long to realize what their moron ceo meant by "buying more and more often is buying cheaper".... he obviously considers the common consumer an irritation at this point. But back to the point, people have commented that if they force remove old driver flatpak runtimes.... they just automatically reinstall next time. |
flatpak only auto installs the version that matches your host. The next major release of flatpak will also auto-remove versions that dont match. |
You can run this sudo apt-get install nvidia-compute-utils-550 nvidia-dkms-550 nvidia-kernel-common-550 nvidia-driver-550 nvidia-utils-550 xserver-xorg-video-nvidia-550 libnvidia-gl-550 libnvidia-compute-550 libnvidia-decode-550 libnvidia-encode-550 libnvidia-extra-550 libnvidia-cfg1-550 libnvidia-fbc1-550 libnvidia-common-550 libnvidia-gl-550:i386 libnvidia-compute-550:i386 libnvidia-decode-550:i386 libnvidia-encode-550:i386 libnvidia-fbc1-550:i386 libnvidia-compute-550 nvidia-compute-utils-550 nvidia-dkms-550 nvidia-kernel-common-550 nvidia-firmware-550-* and remove all nvidia 525 sudo apt-get purge nvidia-compute-utils-525 nvidia-dkms-525 nvidia-kernel-common-525 nvidia-driver-525 nvidia-utils-525 xserver-xorg-video-nvidia-525 libnvidia-gl-525 libnvidia-compute-525 libnvidia-decode-525 libnvidia-encode-525 libnvidia-extra-525 libnvidia-cfg1-525 libnvidia-fbc1-525 libnvidia-common-525 libnvidia-gl-525:i386 libnvidia-compute-525:i386 libnvidia-decode-525:i386 libnvidia-encode-525:i386 libnvidia-fbc1-525:i386 libnvidia-compute-525 nvidia-compute-utils-525 nvidia-dkms-525 nvidia-kernel-common-525 nvidia-firmware-525-* |
I tried something like that when i tried to force downgrade had to do a timeshift because I lost the ability to boot.... those specific packages don't actually show up for me in apt anyway.... something to do with how MX Linux tweaks Debian probably or just a Debian problem I dunno. Though oddly now that I checked a few all of the old driver flatpaks complain that heroic launcher and only heroic launcher needs them..... using Warehouse uninstalled that, then the old driver flatpaks..... now it does not redownload them. I still have the problem of the mystery dual driver setup system side but it seems like the main problem flatpak wise might have been heroic blocking things. At least this time the flatpak driver hotfix issue was solved quicker this time and it updated to the right one today.... which bodes well for the future. |
This package using the 32bit drivers (note |
@poltpolt flatpak mask "org.freedesktop.Platform.GL.nvidia*" I don't know how safe it is, but I don't care too much; everything works. |
@FlameSoulis Flatpak downloads the driver straight from NVIDIA servers, while most apps are downloaded from Flathub servers. That's why you're seeing that difference in download speeds. Though I personally never had slow speeds while downloading from NVIDIA servers either, so YMMV. |
Issue moved from here: flatpak/flatpak#3750
Linux distribution and version
Ubuntu 20.04
Flatpak version
1.6.3
Description of the problem
Every time a new nvidia driver gets released I need to update the flatpaks and this already slow process(with SSD and very fast internet) becomes slower because it redownloads every driver again. This happened three times so far. Now it downloaded every driver from 430.xy to 450.xy.
Steps to reproduce
Run
flatpak update
when there is a new nvidia driver available.The text was updated successfully, but these errors were encountered: