Add some driver version-selection logic#184
Add some driver version-selection logic#184ulucs wants to merge 5 commits intonix-community:mainfrom
Conversation
|
@ulucs I ended up finding another source for drivers, not sure if that solves the instigating problem, see nixGL/known_drivers/mk-nvidia-drivers.py Line 24 in 3ee94e1 |
|
I think many people are struggling with their NVIDIA driver minor version not being found on the download site, this seems to fix it for me. Could this be merged into main, as it seems to be a good fix? |
|
Well, even the links on NVIDIA's developer site seems to be broken now, just tested with the latest driver. So maybe this still no quite fixes it, unless NVIDIA is willing and able to provide working links for their drivers with some stability and consistency. |
dyfrgi
left a comment
There was a problem hiding this comment.
Looks good to me. Is this complex enough to deserve a test?
nvidiaVersions.nix
Outdated
| ]; | ||
| # We match for the leading [1-9] because our nixpkgs dependency doesn't yet have toIntBase10 | ||
| # so version numbers like 06 are interpreted as octals and raise errors | ||
| splitToNums = a: builtins.map lib.toInt (lib.flatten (builtins.filter builtins.isList (builtins.split "([1-9][0-9]+)" a))); |
There was a problem hiding this comment.
Do these version numbers work with builtins.compareVersions?
There was a problem hiding this comment.
yes, apparently they do; I switched to the builtin implementation
Fixes #170, which stemmed from Nvidia not hosting every single minor driver version.
This PR adds a somewhat smart driver version selection logic (first one released after the device's driver) to keep the nix and device drivers as close as possible while trying to download an existing one.
Currently the list is hard-coded, collected with the following script:
copy($$('a').map(e=>e.innerText).filter(e=>e.match(/[0-9]/)).map(e=>e.substring(0, e.length-1)).map(s=>`"${s}"`).join("\n"))from https://download.nvidia.com/XFree86/Linux-x86_64If/when #131 gets merged, the driver selection logic can be modified to select from existing drivers