diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-13 22:21:26 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-13 22:21:26 -0500 |
| commit | f997c3ee588099e4f43e9ec845935868e3e60b8e (patch) | |
| tree | 07f0967cda575ee2edf2d62ed8c0f67855ae6bd3 /x11-drivers | |
| parent | b589bc93e15b300c3e5318fe97241d57e464bea1 (diff) | |
| download | baldeagleos-repo-f997c3ee588099e4f43e9ec845935868e3e60b8e.tar.gz baldeagleos-repo-f997c3ee588099e4f43e9ec845935868e3e60b8e.tar.xz baldeagleos-repo-f997c3ee588099e4f43e9ec845935868e3e60b8e.zip | |
Adding metadata
Diffstat (limited to 'x11-drivers')
28 files changed, 4372 insertions, 1289 deletions
diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest index 50997c19ace2..61638b995c6a 100644 --- a/x11-drivers/nvidia-drivers/Manifest +++ b/x11-drivers/nvidia-drivers/Manifest @@ -1,63 +1,110 @@ +DIST NVIDIA-Linux-aarch64-525.147.05.run 262738232 BLAKE2B 742feded05f659fa9965b2eebcc6a269b0355d08b6f2a686dad47c1acf2c20a359f9a9c33184ab2d51044b8823535bd7606180e31d348f362a016fad74cf476b SHA512 d1d9e49e16ee6cc69340a3458566f89fee7b63effdd8cae3e55e40cdfbd35d1e87b958769fd3b2ce5ab29596d88c3ac68189232d7a1dad8c16773faedcf5b568 DIST NVIDIA-Linux-aarch64-535.309.01.run 270033799 BLAKE2B 3f5ce5f024d0bb35707034f41211d0c60a3711643dbae8d8f29830c9029c9c66a1e232651c9a5b9c1fb699078ab6aef0c3f2df476a14eee7cd1258e0c8141971 SHA512 ee2f59716d06652dc9083376d758a1f1ba60a11139534d67c39d8b6a4abd2290017d97cc2c8b1ed8bf5ef659e075ccd1a546125a3ce57b6ddd61ada5ba7e6cf2 +DIST NVIDIA-Linux-aarch64-550.163.01.run 236409124 BLAKE2B 21c79346f6b739f44d7ed2d4955129613f51e1329ff15948ef50a9a06b82975ad890d6142e5dfb163e7b0da19bf5c26029cf507d120037f8a76abc177a286403 SHA512 0ef4ab4aae308ec0cfb5458cef34a1503ac1a85f0e1d0c9f061d8e28f939b15784e3862d96d83e93123d9eb56807a6804318ce230ee68917fb75e363011f8304 +DIST NVIDIA-Linux-aarch64-555.58.02.run 236745104 BLAKE2B 342f5b99aeea0a569974b62322608138a845f197d7ab08fc2e37314187861814f3c1d8d017be07744816aa9d691e8161a60980e1d005701e3f67ab3a07fa03ae SHA512 9c4d78ec381bb6163c6591309a9a40f1dfdb5f3d6b983e1728c17383c5f0871bf3879b32f93c7892d33577a9dacf2dcb1d14639bcc4ca510104f33cb54e83df0 +DIST NVIDIA-Linux-aarch64-560.35.03.run 251160249 BLAKE2B 3ad8c6757b980668f6483d8867f247857519636a3ea464107e90620557ecdbbfc3437cadb7916655b14e6a85e5929db1f03387494df7daa9169d8fe6b2de1849 SHA512 8df331104f3d63d4aaeeace412a986a93355be3ce69a968fbc12b7d0b21a34e71cdf37758c23a392c358a1c3ba1da21115002f55017c2a829c7bb4d41536e543 +DIST NVIDIA-Linux-aarch64-565.77.run 253994527 BLAKE2B 3fb41a7958c58742817eaf3c7bab9dc5620cdaea7244918d963cc54b0708572ae22de30866671d77474c2c61413797865efa1a6ef4e53e4fbdcd283e0324a4b5 SHA512 89be8b0b1fd645fe2ae1ea5d1af787b21e665a7f0b0d911acb749b545ccc70770bc42f8842f2c0cf1b965a980e4260fe025e2aa8a678de2036c3aeef49b7f336 +DIST NVIDIA-Linux-aarch64-570.211.01.run 290912556 BLAKE2B 4335d6a6b7a55bc7d2717071c6be968b63c90932592534be8eff28290a8bf98614b37bb52b4ee0f9563a6f0fdacf6b0e8a04b8eedbe8081587962f3599209a88 SHA512 22816d8f798d6ce141ff2ce750b5df1ca4fef9b1ba79762157fd7f93c1ea905c74f421dc6ac2b7bf5b383192d2baa735d7a7d240523be815defb68be54c4a6be +DIST NVIDIA-Linux-aarch64-575.64.05.run 304943447 BLAKE2B 277aed01ab2be1cbbfe7780c4cb9dcbfaebc69824ba4b5a620113829f713d5407829769c7fab224f183656408944d9d6c4dcf6400a333c1116a89d072eb79223 SHA512 0b9b9c6b3316723fba4549fcd346215e5315a7b4c80196f0cd9ada9ecd6a23e8fc1691ae8bda5b246a3c44519cc7f503116023ff5427718fbffb67fe49a12a75 DIST NVIDIA-Linux-aarch64-580.159.03.run 314175977 BLAKE2B 20b0446d8870c2a667f25d9d68c906bbe159bd5f2095c975fba468e1407448052467c32a9b6eb96e9073d3f2121420be4e3ff1173d26816d862dd026249baf2e SHA512 0213dff7afc53733ef0ec9d8d24b20f8f577aa3225470fa2b86bf74939075683eefa9cd12aef94b8239ba8366aacdec605ee13b8259da9a1393761d853c3e453 DIST NVIDIA-Linux-aarch64-580.159.04.run 313659746 BLAKE2B be22824e065d565301435cdb8d22139ae1a52654830c1350cf9bb43d1bb14294cf3e37e05fb4cc2c8e121cfd860b0221943b85ae4a96cff293803c0ec4c6b214 SHA512 2c23269305b59563924dfae85d4eb49a88bf391b77d5edf05026d33f4ff1b504b51847cae0404c6885dc543303889ae665e1c08258fc52737b7b610ec5135521 +DIST NVIDIA-Linux-aarch64-590.48.01.run 319634379 BLAKE2B ff1b0641f8d4dfc834d9627fa934c5491bddcb9e6f5396a07d6d7831c15e2ab396614ff1ab6b5af4a69b42b8c6a022215cc1e3531eca7ca177c9d940f52281ea SHA512 ec81da1a11dd9609427e40434cba69d7c0426e4d60cb5c078c66ec992b6dd44483df2c9dfe02deb4db3a815a4c801b3c42f6ac2b08f0506327f1cdfe5446211d DIST NVIDIA-Linux-aarch64-595.71.05.run 316744636 BLAKE2B 8a3c0179701342ef649cc9d247688cd6ae3a6be88920830ca8f81dd7b2e1862e497164698acf484bb145b04002e3903b1aa8116abd4530c7200f0d9ae525159c SHA512 a2d4ee2c260e34c16b7e04e9dbbe3a8ca486279e7743fb2b95ffa02cedb5e42ad7c5dc4c26fead86cd3a7d7ccf7467439d93691e0e0ce66e8425e622a07bf050 -DIST NVIDIA-Linux-aarch64-595.80.run 317098210 BLAKE2B b7857052b4d03b7e041f2dc364c3a257bef711f2e6c094be441236449f1b0f9a099002024437521ecf0b4299997ed816b096f22ee78ec25f8a60222a2255ba08 SHA512 2d5a7b21199223f7b5f41a64c05155586cda9e54e9444c2602c742442bfb278653db8f282e705dddd5f5774e25b5e4e3ff4b24acd5137d9e28ce4f569a1d63dc DIST NVIDIA-Linux-aarch64-610.43.02.run 354603118 BLAKE2B 2db0cb1fb486d3919edccf0047d1db4f0feb8258103016995aac8314dcb1408807cd029bcdb33570ac729c9c23a984f94ad17fa894ef48554a7e6f273011de02 SHA512 fe44af192ec259793b2f05e53da25481fae5a9fe01131b3b4f7893858c9f788b5d031cd83b7439bf3f1ee1be48c629548d61d8f611153324ba5b46583846a1a4 -DIST NVIDIA-Linux-x86-390.157.run 49417041 BLAKE2B 435b5e0e60468cc74b41cc5d9b5bb0105d29c11a2d408457835212a96519c9334ecf19278b36749d3ff7f498f5b0ae45a2efae2d428703dac21245c62f1efebe SHA512 dae9ac2c12f9ad90f7441e00e01a984147c577892421911d7f67f6a31e616ac1cb7d434bc9c7f58fbd9b8ae909521b5bece607a63c79588c0bb9d99c6bad5fb0 -DIST NVIDIA-Linux-x86_64-390.157.run 85835541 BLAKE2B 44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b SHA512 4780503a4cff0180b1b1f37d20a6ba3438dd78b51fa7f69b98d35521835e5d61099129746929d51d63afa2d47b672b3e145e1e1897584dc3799e7f822c5b3a0a -DIST NVIDIA-Linux-x86_64-470.256.02.run 272850014 BLAKE2B 0fdc867f92b82b2a60810c3b43751cad7ac2c39928c92c6c343c0c6044f4d7d923d93b8599db3f7c999c0ee7d16940e65d991a61cbb30e1d9e49c5639ac6bdc8 SHA512 a837946dd24d7945c1962a695f1f31965f3ceb6927f52cd08fd51b8db138b7a888bbeab69243f5c8468a7bd7ccd47f5dbdb48a1ca81264866c1ebb7d88628f88 +DIST NVIDIA-Linux-x86_64-495.46.run 280886811 BLAKE2B 156917245f37a5da9121cf570616d6367eec66998a50136f1db0c521fc725e68db27acd5741a9fc3e3d502a2c7e90ccde68a7e56346cb8f5fc65ea419c2f0576 SHA512 859548fa81478acb994b40434fc85824976b1f83bc15846290898854db84ea3c6550586a1d7e89ff3afa248310d2bcf4d2d52d5d8e91cf74e3f7e4108a7002ad +DIST NVIDIA-Linux-x86_64-525.147.05.run 414135234 BLAKE2B 77a12905771772804a5e5cf36df3e5032fe0160ac7c8a1b4ea002f65dac3732d9c900c1787a3e26d08b951a8de4893467cc7a80d424e017990d12669354d4191 SHA512 0c7b31715fce6a7bd77a2d9f9a3dca54a929a7790d748051576f62cdaeaeb6a9d0f3fbb13f0b20a51966bdb9470acdbc9ee529a9e84f38a9c834a1bd28d81773 DIST NVIDIA-Linux-x86_64-535.309.01.run 341945818 BLAKE2B dc7bca19eee348648ed6ded096ed9eedc953d7e5be84bb812baf98230096c9f3a92421abb9adfcd0c257dc63a31d9f4fe4a02c7bdc4be65975229941fc39fa5a SHA512 16a505fb053d514b98bed816559279cbe2962eef8a3d64cce7aaf859b2d27602ac9018bb099a56ab4223532f70e00984e5468a4ba9c2914dc68dcbe0d8b2d64d +DIST NVIDIA-Linux-x86_64-550.163.01.run 307143336 BLAKE2B 256106bcd3bace402289e60aca4cd3b447d0fd8ec3dabd50e2bb303c5e866f8da5c28f9b578d95775bf69158f100d68a91d20d9a91426285a8e799817f21db6b SHA512 676b1de35d21e80091528a49080c114e0870ea90b3f3721265ae8071abbc2183c851e6f11ba96a332c743fedfaf4ec9a014ad6ceed586fdbb03d94d33405e356 +DIST NVIDIA-Linux-x86_64-555.58.02.run 304107617 BLAKE2B df9774e6b33e3600e7425734c91f49ba40956f28391df47d946f7612e28984812fbf0f4d95ffc06d1cb545dd9001b5b956c5816eda50de77063cbafe866835ae SHA512 7a8c84c15d87d2cf5f6261b12d3d683e0a7a1847d7c5461b3995f78b8dd862272fd11be07018593a8d5ef5d8274040f15b9e6fe92e9212dcd7a97be668852433 +DIST NVIDIA-Linux-x86_64-560.35.03.run 322523941 BLAKE2B e84819e6c6b75dbe75212b695ee1e7793c16091b1861250b406cdf570a8cae2a8114627f64bdefc8538f12dd6da8d80d3d62d41deeb7211cfaf159f853feba08 SHA512 97137160b64928ff84fd6145a0ebc209c045d6a07ccc53ec6df6ba1fda2ad72038eda7ecdc0a0178a2628aa4e18819a9b3ff3b693b22bdc9de543be0a968f8aa +DIST NVIDIA-Linux-x86_64-565.77.run 339246825 BLAKE2B 6c3c57048b6ac25f08a4d493123816c534ed310197aef532ebfbe7f9327897020506fa892b80bb150e6edb953a74ad8d649d743ce7d33d2117850d3308470a0a SHA512 62a85223b1cbc00b65113235642a4a39eb8e78e085845e4c7d12abf916ea2c1d86030849040bba118ba6af56a1d0da073d4a96791674fc18d7154e55a3587b63 +DIST NVIDIA-Linux-x86_64-570.211.01.run 376192072 BLAKE2B 56a135681eba576377106b5ee4bad4e0ec7e41e512db8e32297fbafe03455ee4e9e0dafe782588dd3832fde74ecfd9ee5858ec662f3dc2ef3f1e1dab7a9c909d SHA512 3e751d90a8f126e369c5167e2d5ba8b218dd306ccf00907290ae70fb1c3f752f0ad0b973ce356a1a24cd0f19c31a07169cfd5705613a6bbb5918881635650839 +DIST NVIDIA-Linux-x86_64-575.64.05.run 386961985 BLAKE2B d8b5e5cdff3d2166c4fdf8328ae22bc4419509144ad0427b17636696e7398240a3601ded850893412198fc0d4ba76e72a64ed31d6ceaf58149d83a741ad62a05 SHA512 1f5ea98478c913b044cccb25934e12d58561643b83074e5967d84126baac9a5ddc092a6ea017956957abae174520718d747415d09c6fb2da110de51629df98a2 DIST NVIDIA-Linux-x86_64-580.159.03.run 398016015 BLAKE2B 6ac3bb48c17bdd9a143fd3483913784d14cc7fb7120b20c0d74de7aebb9569c945d693af4e7c2e2f50fca97e67c26ac91e4943d21ff636a30e372888cff02d94 SHA512 658c7bee6289f9e3d4d04fabc9fee5692ec2a61242d05dddbad61d5d667fbc47ea2cb57802079b6f139c240d9119da4b462548a79a03483dfac53de797ffb5cf DIST NVIDIA-Linux-x86_64-580.159.04.run 397162548 BLAKE2B ee0dd051341955d8eab23a12b4a1b81a4977346b2324db175522c07e252ac6c9cea179810ba1535095796ad89ccd92826506dc73954496130249b1c355cb4288 SHA512 50cc5f58ef733f8f196c71dd7b7756fc1e2f163533d9333af4341aa1379b4b68fe5a4afc5698494b2e0928fc970e902d32e6e3f8f6795d03657842c1c6434fe4 -DIST NVIDIA-Linux-x86_64-595.44.09.run 423549686 BLAKE2B eb3f959b4103895db808743f6986036a275689fabadeb16be5f9e496ccc7a963447568c8d8b248ca9bd2e8843e32c676a4e63d360dcfbde5df7a32405284b59b SHA512 835f22e562d0ac362473cd6425a9065a05a360d6c9d85e4973d34e2005468b75e177283cac8140c725f5146db3e748065eb9b93787936692fd54a8ab80939f9b +DIST NVIDIA-Linux-x86_64-590.48.01.run 416273526 BLAKE2B 57bc232f3d5cc52b3ba7c097e5c04b0e128947b34f75c8c7a75135ebbdda565dd9ae829f3707cfef35a9b8b554f2b46a50756f6b256a0f0280c22cf9ecefb2e1 SHA512 31fd82af707dbe9a6d3848766925386f5e91c5fae0a605819450eb8e5a5a52eaab3ae5cff50b4dd36bc5c32fe1aabc29a6a79438d6614988c7b08f509ef0da6d DIST NVIDIA-Linux-x86_64-595.71.05.run 423133031 BLAKE2B 770af0e6228c300de069b2e87467d030d199dcd9f9c6e32c583291eaac7196974f72f1e25902b8e38056897cff99f845adf73e3eab6dedfce8339b21b76b1042 SHA512 75d22994ba963223300d3c57fdc05803ddf7d8630fb5aee3ba92017d6f614e4a7019dc09f0f02b02ec28d6d5607e284d4e6de2cd506eeda604f75a2d4177028a -DIST NVIDIA-Linux-x86_64-595.80.run 423049323 BLAKE2B 8713689690a3e8144f82e83bfb1df0db7b4a4276b5580ddf47c970590b2a211dfd7171f3fdb3eaa66e16b56e87667ceb48a8549d832518874a99d9ab45425879 SHA512 2294c8e1f2d6a3bbc116bf6b2a4c84b26c23c4c1f413ff86259c2aff1ac2f0f66a44350b0c796dd66438b0013b3e8f3a8f15d3513f4876c104a6d570b68b649a DIST NVIDIA-Linux-x86_64-610.43.02.run 461616501 BLAKE2B 9b55b3e7fd756c1979ce86901654bab5cb05680b7ea525c7fc3c22f2d200cd3fdbec1eaac435cfb9cbe036e6659a97e4edcac79275de8b3803dcd673f20f0110 SHA512 aa626828964bd9b68dffd07865d2fb05de09b0fe944d6ff8af20412601fc72459186eee580e290c379e1a2b74f8e88c6ee406016814850952cf9330e64ab3032 +DIST NVIDIA-kernel-module-source-525.147.05.tar.xz 10140684 BLAKE2B a8ce7c1d1047be9154fd67366c5bfa13a19f03c883f24ee35043d17d517e83303420449750f9e7adc7142f61564dd5d8e5a19884dbe540514979df6381ff7f1f SHA512 58920b26081a68e05178176edb0ce8ac4a5d365492adf51d6ffe57102385ff08abc5e14741e0500419e62a752441c97051d60939245eea64b039cc7efca15b7d DIST NVIDIA-kernel-module-source-535.309.01.tar.xz 12537052 BLAKE2B 2bff6a129c7c407de95d140fefefd50c266c7c8dcf938a71690545cff65b3502872645e79d47f9091deac54b7e140bd93a321b18af0b9cb24ca958f033461c53 SHA512 5bd08038823f3f9c39307b441cadc6231d71195adf1835f33e5af794df24be8abed83d3b246edbf5cbaae2379b52ecdd5c975c722001e19fc96054528bada773 +DIST NVIDIA-kernel-module-source-550.163.01.tar.xz 13552400 BLAKE2B e1fd753127d10097c5f1d3c90d95c7eb0934c0d5e1df0a371aed2a0d7669960b67c46eed20eec3c42ca41c0f34bf6d7d3d2a77a94308c9f86d4f5d831da19363 SHA512 c9f4ce2890db3fdc66dd080da4d6802a8bc3b18feba96be5d33641b02cca637b1bcd2a3748f36f93a32f26ba57eb352156314f139688b0d3a102efdfde6c32ba +DIST NVIDIA-kernel-module-source-555.58.02.tar.xz 13676856 BLAKE2B f3bdda7afe0726c65947fb86898bfe56dbd5378112db6b292649690ef9fbc822745291c2050ce8d16c312950f0486cb54597c41ca14e1dce151b9eaa55bc5745 SHA512 28b7dd07f31a39eb3aeb1ef51872f5f7d2e9e4ffa4573244f979992014e5e04454227ee5c556d41663e0e2175e7f5cac4cdd740f441a96e3dda49303c2dc8df5 +DIST NVIDIA-kernel-module-source-560.35.03.tar.xz 15023144 BLAKE2B d56ea634dd76c3031372e4be283f0348d95e87d088025aaf59ed342a550144f3a8cda22b4c56db4cc2a4c2eb5ef2563251b1aeba75c2a35bad7a4a24c2f5e4d9 SHA512 eec3263d09cc809afc4c2c9eed6e0ec1bd2fed71d43f96d2f56c5b507aead96d93c6de93d37b649fc97f1d849aed64942afeae6e0c2be399d39b1ee416c6b863 +DIST NVIDIA-kernel-module-source-565.77.tar.xz 15374480 BLAKE2B 0ca329dd09db37e283c8066722718182e43beee77fc5f3f3e2a06f74a8a6d481beb4ad90260afd3b93a45b1dc462dadcec6e11919c535cdbc4af950836e5af3f SHA512 dcc5d7a53e1c67d42dc0d4bff8ac8181fac15bb05ccd0990e50d4675c94a54a3ed5d56c60cc7f65a958b0d9f2075620a79add51c5ba443869eb47c9c414da586 +DIST NVIDIA-kernel-module-source-570.211.01.tar.xz 17951900 BLAKE2B d40d2c1b4a92dfe8da95e1000413dfb484c9c96ad232dd5db14246378f6df8e73f04706592a536025c3d5512d5e663e7841de8bda782e3611b4b594b9b107ad4 SHA512 c988270d3aaa707310c3924de83eb5f5bdc4d022d1666eb3f41ed46eff35e98a765d4d6d34c22c02ac507016bed3c34af1da2e1befc285ec9158031a4a1447e4 +DIST NVIDIA-kernel-module-source-575.64.05.tar.xz 18198316 BLAKE2B 622781dfa93ab11993a4cabf14e2104ae7fffa0a16ca504a1257ab9eedd832128dfe73a0b9567a4401bbcf83416305794861cd18c393797ab8d43af0c26cbcc7 SHA512 4cbe2e2d78eab84a8a0153f68ab6b1fefa75225c145b3bd9db4fab9d0cb212a4202a89d0e6d0f2d0dedb5663389f7c9ed6cadb6a656eb32dbde0cf0f806652e2 DIST NVIDIA-kernel-module-source-580.159.03.tar.xz 22253960 BLAKE2B 31245291564c734c5facc49e866b345f92d4fc08baabda4a9d49ea2073e62fbcbae9f4a39dfb430533ed0bef2acbf36d4546d9cce3a3da582b2cfbaed0ddfbce SHA512 8deb20e9d5b65cc9d701cacf1470187dd72765a291ff6c7ed3b6c6dda32287271befbb88d0bb6cab736958eca96b4e093182848274ca2cfd901ae65bcac06abf DIST NVIDIA-kernel-module-source-580.159.04.tar.xz 22255440 BLAKE2B b293f941ead331674b235a6d75961b13eb488c306e22a2afb50cfaa965e65fc0768cb9642fc82a16ce1b6383ccf7c252b729ec305a39db3dec38284e4fb7191b SHA512 f0ef07705510aad25344b51129c2a62d6a36a0eac02e5a60b36dc47c88cfb91d875e0298369c3bca97208deccd3f2f0d1a595abf9e01b6433bf194c778f134e9 +DIST NVIDIA-kernel-module-source-590.48.01.tar.xz 22530000 BLAKE2B eae57ceccc78f0730fc4962b20f08f270bd21960e84ad5985433590e5229403a74bfc2518540f9e2ef07d319d9cb2288edfbe0d5f7a27cc7e0903aa61fed388c SHA512 6fe32d5d1a84df0baeaaecd4a847ba73a89bcd1b51d5f9c7525efd2af891f6d5512c1ac97c8b766ba1d1103312c53e5406653589e22684df9260fd75977591a6 DIST NVIDIA-kernel-module-source-595.71.05.tar.xz 23778996 BLAKE2B 45361ac9830c16c748688545501124647859c247c5cf7dc6ab4508fe614425715c7299cf88728a3da4111c7fbf6f9eab8a1c77b039ebd868dc7a6367b5e97ff8 SHA512 dc417fd79ac6fa388e8c66ecb55e8207ddf19f4f98b5a04a574aad9a100753e9930e29cae08c4d36721cf56863b107ace4695207c6c91f4a831ebc3f0108e1cf -DIST NVIDIA-kernel-module-source-595.80.tar.xz 23777372 BLAKE2B 1bfd80d07a12f5224b232e2cfcbc4b5ae04cbf1cbd6411d1e5c67ea71dca2c90b615355c9fd664ba94c11fd120b84340baf7ea68357c3faaec40f73e0d3f6668 SHA512 2ca3461e120af359abc1943ab5c64a71333586d45702db195697329834c6da9e11dd908a180f6bab4905b5492acdea42fb77cdd4126d25e67e0947c8e154fd60 DIST NVIDIA-kernel-module-source-610.43.02.tar.xz 26167288 BLAKE2B e87b46ff8f33cbe1262cd230012d0f2694194a7c16824a671817d212e1b93c8b3a31d35db75f9b0399693c1f2b6030b99f2f0af70d9c83c3ab9cd1c24e7d90f8 SHA512 a7bead484b396ffb34468d3d94dd87c9d9133a084b0219a275516d9c726a47550b66eb5f80ab71b04db27614c411f102402f66714d8a933fe234c2b3a2776b5e -DIST nvidia-installer-390.157.tar.bz2 150323 BLAKE2B 8058ca87a6dea956d564af9f7eab9b1fc82b1f2382bd5cb2f6d97cbe2e19292533522d5f8f2eacbeb16520372715fcb72f8f9b0998962af5d4e75522c8d74524 SHA512 93a7ece648602157496c8e27a88864ede341a100f5328a4c1a25faf8f0b94d252060e5e2f71d0c302fd0566c10773c30b76b3b5f431d8039b71c90a7969f7d7e -DIST nvidia-installer-470.256.02.tar.bz2 146269 BLAKE2B 4402e725c8fd0157eb84d4ec140a33f97e873014577487ef1e32fb8921cabe79c60ff46532e5bfaabb2b6ac894f7c80086dbab19e61906e2e27346fb85f98829 SHA512 c962dc17d9696256d1ebedcaeb3010994f2ce3895aedc47987599ebfec132a9b9a249d2ece6502b15bd4a93f9b0106aa13487a7da5f64199c274ce11eba27cfd +DIST nvidia-installer-495.46.tar.bz2 147041 BLAKE2B d54331a315afb1588507ed03058394a347be996c80d1531251d53d20a8c212e4ea53d67315649aa8991d6883914296e80cc47ece5fe1093e48ed0e119f2a6704 SHA512 1885289cc1cdc1e292658ec0e48a3dfede7ce7cd5a018a54e13e27a08ec9e3c8da1750dd7a4cd79379943e2bba86ffb5d864fd9eca9c2839ba83be2ea621e0ac +DIST nvidia-installer-525.147.05.tar.bz2 147986 BLAKE2B 982e1a95bc255b960913cba1e78675845db472534af6cae054c74ebf82b1e4407211166249b164299f0f81ec643b7c1190e5960ac3c7844322ca42c23dc0a90a SHA512 171f9c235b2bf41dc40a875576e8cad0f4c78ba574e72db3f1ff3644701f327916121ae493cea1aed93f4826d96ef1833e98502d2d4272f4f536bab03f20e5cb DIST nvidia-installer-535.309.01.tar.bz2 149086 BLAKE2B 14ed4eed4d3f998bf3c93d7cdcca8748bad9fa4751b81d193ce00dbd9694b9ae38fa865a2e82c5ec78ba58f10a73c0d5120b5aa2069cd418b9d423c3da592aab SHA512 e4a362fc0980e34c984be811570fac7b2b0ace3a7105643f8b3d15122cbc6fb9988d017e22a72659dba40588638b60eaf243bd228a386e8d2d12db0f50f42f0a +DIST nvidia-installer-550.163.01.tar.bz2 155861 BLAKE2B 662064b3ceb4aadebde419057d85c6b4e28b91944bd5bab241bcba9b3c9a105e507afc7651b17fff01e1cccb78d66fdc6789597ce059f882a6f322b08f28e832 SHA512 f8df7a0eccdecb7d4d4f47d96050cdbefff91289b29550b061358614845648451d4b161d9bdbfbf5a9a87ce650d272cb3b795e6d2ed4d0274844a56db097bd15 +DIST nvidia-installer-555.58.02.tar.bz2 158422 BLAKE2B 0f8da2790dcc398859ce7b2e4278b490542b5672e8005fe98b7ba095c8ff62fe3639907755630658f7241097e18f3e92196b1fba0e430da6bf697e8bbe9dc520 SHA512 ef1ce8ef4997858a053c4b6939496510605b0a5d2f1c93ab80f2002fabeae2333da2e877aeb665936ce618fdfed4a6b9a888f6426fd1fda289e6793febbedb37 +DIST nvidia-installer-560.35.03.tar.bz2 168904 BLAKE2B 81a1e4070cc36688c8a2e768c304cad4d680f56757addf137c0544aed93345a4587a65e8df5212f1853e1d4f5a882c457866818157f303148603d50a7152f21d SHA512 685cec94e01a0a0282bd013896a1a05d1a061226863431d39bafd31d78a3224879eceed24da5da65f2a6757faef40b999aad624cdbc86de53674d7595b4c763a +DIST nvidia-installer-565.77.tar.bz2 168880 BLAKE2B 646183592cf837d9d1521cd9e539d7009289dbfb4c13c894ee94f2613df4a7fab9fa26a9e4e88c16193052c15133f6d227719138d24eb7aae7af694fefdcc582 SHA512 e73d6215f5a3c2984b99232ca93fa8e795a59f559f207c8d4999a5ba48dbaf9082f74fa6304a0d6f186d4c4d9d6f67a991f0dde0a548f05149526759c903a16e +DIST nvidia-installer-570.211.01.tar.bz2 169330 BLAKE2B 100cdb3e0cccb19e3bbf69d4289d079a64cbca95fc20f4d48179190b5e61cfdcbfeb5b95c381c70824c185975356a70af4c89efb53ca0cbc5c61fc95d974ca77 SHA512 90efcd442feacd7f9d9bf25fddb77c521b2e7c79063703c320ce2bbd50a5cce950b0937ec926e89081634c6606c18861efda0e6288e24fab5ee31cd5d52d211f +DIST nvidia-installer-575.64.05.tar.bz2 169369 BLAKE2B ccff48e41296d6682c72f3d25eb7d7816dc83b4c6f279a4f5213db141353772d78d8ff3e23f2fb21ff8ce81a326443d12c3f05792fe1971b1fb54da764140065 SHA512 5033e40762b499e9b04a080942656a0c9b49e8f56c4a8236da38a587f8e13b3935f75e8c8dbdffbd0ef895c537a69f51ce6df7e6beca7be583aab09ed62faf09 DIST nvidia-installer-580.159.03.tar.bz2 169966 BLAKE2B 9f723b18796de0c34eef130e5bd854f55d310351fc13891041d01a55a0b79d2a69e4b36be9dc9d8216442819399b93ab7f4f2581a66ded2de2994b1a4e132018 SHA512 3da64f9039466b95910bc165473d5f6e39bd48ac5c8aef6ab3b196f6054cc177e2182aebc532a285f076b2d277982346cedcd952c3a5487a617bc85db2b351f5 DIST nvidia-installer-580.159.04.tar.bz2 169644 BLAKE2B f01f9da4e7e3ed6524f586706a7167746c88e7033d61d7ee459408748c0eaf75b236667e7177baae282c1e4ac0896abe9ab2e6796ba2638b2db6ad074646eff0 SHA512 00d11f80b8f410d8110a8450ea56a653a5a223bb1e728382e63312121d3926985c815019dc9cd0659ed97ce824f0c29d67d1188b41f1a3120e25881f1403ddce +DIST nvidia-installer-590.48.01.tar.bz2 170826 BLAKE2B 450bd298e6c574ae6dc085714c130984058f6e606c3de628c5adeefddbfde3bf2e025b1e422948311e9e028cfbc6e8d4c68a22a10d30a9a28466f3105aa7c13c SHA512 4c776ad602594a5d2ced2570fd26b51e5fdf5b7613c43263a7f647a5d3d550c6c35960a6cd8884766a71f0b34c397e7d8bd0507b84043cbbc1c04a82ec067932 DIST nvidia-installer-595.71.05.tar.bz2 172399 BLAKE2B fda7ec136805aa7e481162af171206c3e6dd8c641fc60910f1336895b87ec1e4ab7469456d3fe96ec18f763df3ab158e7c707edb89833a628fe24e69ad97080a SHA512 08ebd56a639cad608db8a82cccfc386cad4f2dadb7a01a7318f5cd70b0428e0d62fc51cf6c8fef16d567c226f5cc83c8905fb3bc36404abbc5a6bf36c0b26403 -DIST nvidia-installer-595.80.tar.bz2 172439 BLAKE2B 10b59538c6645a7a6c2ced03bf38f2fabec1cbbf8c6e915240551fcf3217333da0260fc4d50b9ba817a721c49dcf5902a3e32a1de261c1a9d20d2a2afe443bd1 SHA512 17ea2123805458470e463ceef2bc37cab5e22e55e43040ca6d6862acd036ae23c647c2c05fa9eab4eac5a8462fe38a9502648d6720bc3065f75a826fd5208ea5 DIST nvidia-installer-610.43.02.tar.bz2 171883 BLAKE2B 7de020021d83b8283c1603bd7351113ff11444db7922593d956589473bef46a0b408208b3aabdb08314880310637c3b0149d30b7547c9973d2fd806fa3d7b946 SHA512 26e43710517192883f41586fbd3806e71e5648bd3f9a531d27d3a4ffb114ee803940d6e1e05d86eb853f69217c4a158d00dc4b7b410828e25856c4ade5ef5bad -DIST nvidia-modprobe-390.157.tar.bz2 35306 BLAKE2B 80d202b39c2f95ec0f909712c2e101483af50124092c32efb33bd98ff58ddfb97b737ff07f1ddc941f688c1b4c26a15f392566d522e18506771f10422fcd571c SHA512 109bbe24a3758b568ea65fe1e9d78f69fae6108ec0497b796c885a3912825fe04ffd7389a3e22987f1a10a2926bf6eaa384faabc59478aa3ee244dd3ac91c6d3 -DIST nvidia-modprobe-470.256.02.tar.bz2 38769 BLAKE2B 0db444b09b0b6d24c04877fae95249e781d82b3141f90eb05d869b64d2b6e65ad00bf44c4e427c64dbd4765fa99a8699f80a1d95b00c66137a54dc878d7ea298 SHA512 c1cbfa6c8e188e5a5eb5d390b9a903406cbff103d212fc30e611e4023be3fde896ad84e8bb45b030beb5d1bcd8155c9e55a8f9636c45ce1e2a5c03f672989a31 +DIST nvidia-modprobe-495.46.tar.bz2 38386 BLAKE2B e278659a1d6581ca7f9bf04aab43241cd14d45ce5001ecf567dd7b7b2134f10820d208c91a4b1803b3b871e36a48ec6ee53c93501b6655a99a185a4a336f19c7 SHA512 d01097088b0372ee3151413b0cf5685514e1e76e75f4b4a66bb9600da61ccb1686bd09c6daf5afd3b7cd2a6c09648041366f57a78990650f84bb57c105c8321a +DIST nvidia-modprobe-525.147.05.tar.bz2 40439 BLAKE2B 3029d39cce928b3f6a6baeb57391ddd412a35e36d880b3036dedf083b6df979ec531360421bdd347aa223821006ae3610b115277804c22614a221258944ea37f SHA512 25939b278bd2354ff787f1d10771d19baa6c691c5243bc647a556e40c4f38c16f6a248b2ce0b4a328d80b768147a188cb2d8b54e39fbfa4cf436d1f3b1b6440f DIST nvidia-modprobe-535.309.01.tar.bz2 40756 BLAKE2B 4c8d41c3f8d811155aad952e7120bed92e44d50e6af3551396f4be73f733f64b72d76d670676adc957efcf4c0e05df6473ca50a7cd378e56a0da52f8dfb2246e SHA512 b39f282034320836cc4424901d0230b5bdeb72050f18e0d024715a89b0085fe5a420ca82425ded4218a25ee3f7e8f6fa1abb37ac37843eb1b9e35aa8a2657a66 +DIST nvidia-modprobe-550.163.01.tar.bz2 41448 BLAKE2B 23e567d612e669ec6ae9f389651c9e1cebe7ba59ee95bb5961e5071952697860df77f02026040e29135338eb7cf96bba0015b3d94548297235fb5214f35bec48 SHA512 0f5b59468a6e5e95dcdef1d938ea78f4ce09a0c9784e3c70d83f1c3b1bd52e8055b6b332147316445c3be714abab3629320d6117878d50aa7a2d7d2d9b9b6485 +DIST nvidia-modprobe-555.58.02.tar.bz2 41721 BLAKE2B 01e83365c1fa1d5ce172f31d180e0735e5d74a49e59c7fdec78ad26f1f70efa981f2a2429e1c815582d3200defe09389d9b84a2a8e4c2f46e1d4528779eb4305 SHA512 5fabde2e8bf534cf6ec8dafe7318c76ef560f336bdb3343d71b784713076a05d063c2e65eb8f965b0776cb02e67f8eed363d8eaea67fd92798d1bd1b74571ec7 +DIST nvidia-modprobe-560.35.03.tar.bz2 41637 BLAKE2B 4a72161e3569af5b53a6372da51d6980ab6a428207db0ef2c20b87a9abe569a136ece0a332954004e24f4381889826e50fce42c0c362c749adcb0152035e8862 SHA512 ed592cfba5512fde34e1d9b3dfcf3463df447202eb99d1d792f87d0a68c73193d141f82835e9272d315f3de9e973e7d9f64b06a9cb1e6485dd7adce3e9c360f0 +DIST nvidia-modprobe-565.77.tar.bz2 41644 BLAKE2B 6eccaf62ba02cd68bb3547266df65cdd6514e925748043ab4089f7b1d6f73d36e6d167293a1bc1c6339ab42cf76ea65e06676180563ad89484bc8d71c64293c5 SHA512 f9cc72d0e07e53541cb3eb6811d4fc6783a82d7a0c6fed2693885fdaa8ea5ff25d6f63a72e99e7fae9fc0e2b337bb1a28cb935768ed283fe9d8f62e2eea374f1 +DIST nvidia-modprobe-570.211.01.tar.bz2 41631 BLAKE2B 953113337b742ea246bf24a47cbe679f03d89ecfa48a655f179b0913dd7d9c1742f4b1bd765c4d4263c9d45c352de87bff9f0a5a2c3aa48c86f221177cd5d1fb SHA512 c1bbba303b587f18e824cd2dd9a74341d5a03ee56c6adff67bb33c4f65ed16742f094dca9457a04d68b676c3671756e47d996090523827f42c8780329988e3fb +DIST nvidia-modprobe-575.64.05.tar.bz2 41721 BLAKE2B 9b8a6dda556389abe0c2bd81ed3edfa8142f773832b7d955385119b5fd525cbcfd3c01401f471ccf5dc7ce61100ba6a3c4504b8eaf86ea5b378d20a6046ff7ce SHA512 221a0469a974c7db3f3c489f2637b6eef68e614c5ccd3e94c8cbe1b8841a6e9a4f0e2f05642b6c9f7113efe3c211076ac31578e9587df26b76148a198d21cd49 DIST nvidia-modprobe-580.159.03.tar.bz2 41685 BLAKE2B b8df703c509987538e979ed1d65131004dfd2eea3b4d4a9a98c2784a13523f8ea55fda24fb9d3f04a1bcad04d8726ffceb4f5abe9eb19f50fee5c91f8f1db99c SHA512 09d4d1b0474bb35a0e64f6a6b550096b7e5c18bc1746300211d829bc6ef503b301b2ca8909057cbfcd8585a9969ea807ab746bc253ccf2f5f2cc5ec263a989d6 DIST nvidia-modprobe-580.159.04.tar.bz2 41688 BLAKE2B 4600a5ec3428d0340e4268c7b191c5cc872680e3b7cfb2d3886c05b3d9706295b276cea6a957bc5263a21d7e9a60a18f8986efa1f88a9b13d9f22c3b2534bcff SHA512 9577d291a23e8044a1d8caedd5c9a7d900698b7d53f9a2373c9e38a313be0846d7e4965fdecb081d18144f01216159c4bcae7c0741d3210c7e9d8b0f42d91099 +DIST nvidia-modprobe-590.48.01.tar.bz2 41660 BLAKE2B 0780a1aa529d95323b37115efa529dab030cbea589a03ddc70460f4176e7aa88388401ce8508a093a2e9a0ad406589e9e94ff0391021307e879cbcacec8b6759 SHA512 805a70d5012fbc26af3787104e39b3626b2ed7d53a4989365d2fbf6926daf817eec1dc6b7cd50dfbfe29bbd71569ac3095f0a37cad2199994dbdaa76720d8fb0 DIST nvidia-modprobe-595.71.05.tar.bz2 41724 BLAKE2B 23a0fd55e50106341a4196af7bca568c96555c6b0583ae41b860ac73ed4cd6d5222709a88768662fd18a2e4f7686ff092e5603497af71ea7dcbebaf50235c54e SHA512 97fa81a96884f4c2fa6ecdb86d513121b00e8bc955b9bea0947c8ab34271a016458e405df451fb6340e4b8243572980b5e7a4f24af2775310d3cae35a1bcee0b -DIST nvidia-modprobe-595.80.tar.bz2 41701 BLAKE2B 68c12da5284a27a0c5bcdf96e7b791a16fd80e0c425ac51bb42c9b2172f215adc311844f7eec534af928bb25265a480c591d077aa8c2a5352739c8f27335814b SHA512 779c1dc3b4505c197cd6e667225c60445938c9fe6fc1f4914e50755c58c6e9ac7fef51be8b59c7b66d17fdf463b7d87379b48b40a5002604cab6a88e963369c7 DIST nvidia-modprobe-610.43.02.tar.bz2 41751 BLAKE2B 2fc6e0077633acba025ad9728f002f283dcaa4b3ff2802e63e53073f3fd54f4e955d62bea5e0677e9f8a4eef771f0bb35bc4d728e96eb0356eb335ecb9e0c9e5 SHA512 c94f4c820744c183b8584e1b74e2e6f50c752fde52ab133055999c1eedc5096e0d2788ee1bd7476b959c243df1ff6ebb5fae5c56e92f87b99573f2e52ec75ed5 -DIST nvidia-persistenced-390.157.tar.bz2 48654 BLAKE2B 2cf6c92da90acff55e8c180a06b0c6a29d48be9fd8ca3c541202fd14f0697220fba6b66452942aa7ae7cc8821f5c5eb9fa8f7a31d2248624e5f9141d83a176b8 SHA512 70f0707ed6f2b877e69ef90cf782f66cbc9d2071db53ca09ceb7b89427b0fe176708517340621fa251539b7d481b238adeeb60261674eed74de1f62db6dbb72e -DIST nvidia-persistenced-470.256.02.tar.bz2 46567 BLAKE2B 8f837322a3b88412fd2f6acf38721b49a6cb444fbd842d652519e5596f2e545d8f06bbdf017f46a22301ce87455f96147fab2829ca5fbf26131ec3e4a772e282 SHA512 4fd19258649b7d39945fb5c8578bf11ab118617dd14f3d11cdf15cb3fe77daf7b4719e4ae57af59031b1b809d02f4e8e8afed0ec60b9d0aed4d2488bd3013cd9 +DIST nvidia-persistenced-495.46.tar.bz2 46272 BLAKE2B d6f6147bdef59b1c56df6a313cf6bc00fd36b722b2c50d692a11d997e369daf3c84e20c3bca6bf4d11a4db8b1e3a37876837da85592b6d339253cc1091d6e194 SHA512 ed2b37803985d02df20ce0f2d5310393613c94310db934d4990ecde6eb84345104c42564937bdace5686c8eebd3154d84c0c7b28bf09016799b98621ca52f89b +DIST nvidia-persistenced-525.147.05.tar.bz2 48089 BLAKE2B a9cbf291fae9d7af50a9633fa5e197939674825e72150883b4e89e72165a512c164b4d79522f5b6c329e980e1145d958ba592202e5b73edfd32b149457714982 SHA512 e9685d330d32a5e9864b45a7e099e78ef873188972700747c158c3ab1fc95ea036726c793207fba33d4a50f17b92802366ce1ad38dd110b86ee923f48e622cfe DIST nvidia-persistenced-535.309.01.tar.bz2 48569 BLAKE2B 5756b1335d6a1932529babcc401de4f544ea18dd6da271fde258ba046c98584fc736f211e4c5ac485eab70a6d1717b5aac3cb15f818cbf9eda29a64151fbcdf1 SHA512 e49631fbbc1466820c87fe9a7538b7dfaed512690d1b14e4482bfb471c4e144c62d0f2df5bc8dd3aae443475278b0aa1ab9cbe27059a38fce9b82212477b87b1 +DIST nvidia-persistenced-550.163.01.tar.bz2 61450 BLAKE2B 1a11cb89981b88f8d14558227d9493f1f8a81ccb5502002c436e9311a38c9c8fe0402c65eac1517a2893985eec07699b2e7bc7a81aa14dc0d52198ac85a2cd1b SHA512 f17dbcafa917b5b450f7665f98fd24f06ad99e6bcd1fcf42ef95aa9337b55561b7b16eaad8fa408110d08ee7e6d812444792cccbb9c92865099891832da779ce +DIST nvidia-persistenced-555.58.02.tar.bz2 49877 BLAKE2B 8423f34ba517ecfbb782a648ca07f99f161cd153400bfa32e04ab98e8f72cea2afa60d11d2e05e1f31ce21ed33899cc6945fa56d6e313ed8af67aebf93467879 SHA512 16f7884a53007226206761e4d9fed8d672c6ca31ca59c70e8931bcd0d772d77f0b0078071505ab1bc198f713a94a12f132b7e3fee054f859db9ca6fe25404117 +DIST nvidia-persistenced-560.35.03.tar.bz2 49873 BLAKE2B 5b19e8bef623d3950948fcf2a57c097e451c846e1d3013344ce8f10b91e57d3f031c460a9a9e4d94940ed3035d4d5836e5ff672d25f0f132ea915eeac62b94de SHA512 65c12503f8b457de704c58e7f066c1938645d88cc8b986a2fa993dcc5c60f45b72b22950df9419577c37e815e65b6e3749d4ce551457ac1bd868e24093074fbe +DIST nvidia-persistenced-565.77.tar.bz2 49679 BLAKE2B 42cb002e207274b4e3100879d3a1dfb7f458f600d8ae82637771d38a0d06998cbc53061df1e84fec26d2a1b713a033bb96ae07e4a30307a7c3a9965033024682 SHA512 7268953c5e17891498bf75fd9b3fecdf27eaa1e9488eb390b939a08cab04568b1be5363a8cd788aa4491315ca0285a6edbde8a661a7fa1a2ad7ae7bcf5ff0e95 +DIST nvidia-persistenced-570.211.01.tar.bz2 61779 BLAKE2B 02ac6f53eb4c053ca894f79b49d2a4b1b1f8e9f1a349053794542e72112bf0fab87aa2ee317d486758aaf77811c929d0aa8fbbcef9de8cc59836445ef845cb7d SHA512 5cb8feb56bf245e8e51e65d3d6d31f2b588e7b84ca29330e564d3c27ab37ceb67df0f80f8b37dfafb49a9fe8d7fef6b26d6334c6403902737298e8f3b23d1cb3 +DIST nvidia-persistenced-575.64.05.tar.bz2 61961 BLAKE2B fa40aea873a30e7c500c2abe85a0ed7e278e4e1cceb2be9fe370752b3e44bccfd94e15e42df2f10237bc02015545b5b31ecdfbfd84b4f0400d56484a69ed96b8 SHA512 77a6fe5665bee6225433e383fe3016a667241e0772223d978ad42df40c8bc77207185c47961859ca9d334bebc7422d1a825ddf58e77d4caa630fcee1ecc5fa54 DIST nvidia-persistenced-580.159.03.tar.bz2 62211 BLAKE2B be8d6afa3cc3439ce1ff84b4f9100c81247e75572e15f12882f65763497628427b0ccc7b460b95b5c287d9b5170f1917989450277b5d33b1f221745806d4d3e4 SHA512 e81b6eeea182fea9b041d6e7e205332801926c810efd0c32cacbdb23a1d949ac127cb6646e9ac6119fde0a270a882ad3937b79fe0cf5e1cecb342d02e3ffd016 DIST nvidia-persistenced-580.159.04.tar.bz2 62225 BLAKE2B 2d3b4585c9fa0a9b367c73c204f5350088971690fe98019840405645fc90020c6c1a6e985049b191df796f07784604e97337ef9c39311554cfb05353c1429204 SHA512 057537c1641ef3a4d9f594371ee01c4a0fe821561969cd5c1557bdd8c6b4319aaee02cf6bc583f20e47102ecb8fed99666269c5398e31d17024aa0a299505830 +DIST nvidia-persistenced-590.48.01.tar.bz2 62193 BLAKE2B e6f03ce2f24f1ddc6b1dc9b7a8dd22de4541d5ec82f85c58943cf48f295e7f77555765b01edcce1c7f5ba67580c51273de8b8200d522c49e2321cffcfc8aeb6b SHA512 960f37355e58da20af92f0f0df091709623e32d9ef4eaba34d1f6b52f71227ac7c3a7f84aec64460952fa32986672f9373774ab1e65149ed426c59be47d7f2d8 DIST nvidia-persistenced-595.71.05.tar.bz2 62538 BLAKE2B ebf86357c81689d553d0f1f8a602932ec466781f81402a9bcfd1d4155de6ceaa795dec0ae0b9937b3e02ba2605cc11849bad36847df30aae673fbccb52bc2e3a SHA512 a3fa79468d7b3e8eccfab4f52a6e9240e3d65dec9454a10d350f45e5c27781922bc7ceffcbe6d40d9cf63694d84b4a7678c1f1268b72b821f08d22bbd05f7a78 -DIST nvidia-persistenced-595.80.tar.bz2 62512 BLAKE2B 854263b23e7445993eacfaffee7ffd40ab8681dabfb32706a8adb70d6fd66a2b2cdb8ce4947693617397b1e5347017d27bfb4c6ea059ad4ac3abd08d185407ce SHA512 aaad09d17534017a521120673f556a32b492884c8ba49cd5d6229be5e043e8a412699125692ba9d99a2e7a8fad44af4053a2b3bceca3af04c098bb7fec1a08f3 DIST nvidia-persistenced-610.43.02.tar.bz2 63333 BLAKE2B 5b844724f4eb06b23b4844915541f1ee9564d7a377801fdfcbec56b5fb2411b93a526f89a62057fb645d9cb9a45d0ad62fe72353dea818fc2259fec6fbcfed92 SHA512 63075e7ad5f7bd99ccbdc5f83044e977a5856a2a0e27c8342f15a2163c47d70378ddcca7a97641ac6cc43a13595a6a7c0cbb8bc610b4ca99e1c4592520482d19 -DIST nvidia-settings-390.157.tar.bz2 1108938 BLAKE2B d9ec1ab5d7f157d74627272adf752a671dd17e2ede02069437b6180b927fe315b15cc6416d584ab2f038b76fe01e5b64514a834f24d88ac16676e55205fdecdd SHA512 b16699009bf56a1ff3b623a528c58061c4f5a2c5c4a373756a07bcd667743a1df7c733a572d2d0baa835a904ac2fda8a5c85890dcc00c3a0f223e0467aea902d -DIST nvidia-settings-470.256.02.tar.bz2 1062273 BLAKE2B 8e66201e7861469b12932595ef8f9fd29d4cfd570c2576ae7fbb7383f61c55ac71fe721cc431e79d6d69f86d998b5b4c3cafe531b573f439e6b499b0fc047a19 SHA512 626e66118ae2e62eacfdf44e37529c409b945a6f33637b9690d74abd87a2afb581aaca5f90328d280da99ceb659959d0e5dc5c22ef8013b2205b2b1c72e08007 +DIST nvidia-settings-495.46.tar.bz2 1062670 BLAKE2B 0be63256dca858d3ecdf2f0e821299498db815af37abe2eec325453fcd24416e28db4f485f4255bce1d1667fdd91bfd9fcf39517312892be3496ebe25e098b8f SHA512 9ec633d571974dd3899a6cd32b40a0d6dd5987653c561554c58d125f9301a6e2ba4035002d782db7313ec043953a3782e97704c3b463940d5a1ae48618b98904 +DIST nvidia-settings-525.147.05.tar.bz2 1088088 BLAKE2B cea74a20ed8208f99cb586bd40fe2cafeec55ca2db19b2c0691d3bcabadc09941ff8288e940582e63f10d8f6cd7e8813e1c5776bf65cdc7b6ee291a8b3a7e28f SHA512 9c29a477b32db3f4324d7c6d28b8da9f3de5286e39f8c67bae88a93c3d3ee0c3f0a0f3e0c29c1fa8ba01b7311623569df27e349d6148ed70b3fd42ebd36f0dcd DIST nvidia-settings-535.309.01.tar.bz2 1094768 BLAKE2B 6a951e7e8e1ccd968a0727d2c8aa5008044d789dac5002f148930ba7ceb07cd3caa59f265c818392a7fd996bf0418729be349bbc1ea0b8870b1a38f5fa9470f1 SHA512 d0d62c3abffe52ad65585f6e88b894efa07cfb9918d2cb628b771d4d8a40149d9097ad7cb66b01a9bc0b4067e63540f2bd67412fe52105348bcca60955f228c8 +DIST nvidia-settings-550.163.01.tar.bz2 1099317 BLAKE2B 25419c1796deeea238b3e44fd8d648a8627272565be40cb0745132cef1c16e0c422242a1e6369745d577e674a68bf9dfc3c009e281a84ba58db5429d97ac9cff SHA512 5306ab05f284ba06852d7c96ff62ded7b8b615d3a002009cd5d781fdad716db37f53d1c8a43337ada60d524b4f7d183d98ad2673f40a5ca1ca4c5112bb913e74 +DIST nvidia-settings-555.58.02.tar.bz2 1100319 BLAKE2B eca06045a50d7d5963fa4f1fe9c9e4e1e693be392b42ccc069893443734a1725046803c8bd0ea06ff9b256f26b99184196a805c602710ead599e9cdb8ab1a223 SHA512 b86c4192f2b6cc5fae57bfe627b6ada0a9c936e90cd898baa448140627c7e9cdf3368021da2a94ec699ac1f5a08bb462766a573a028f81194361b9c642a1253c +DIST nvidia-settings-560.35.03.tar.bz2 1115724 BLAKE2B 937a3ea634e9bbc4b76f6c50fd20108c783a941e021a3fe1a9fd3288248fe14069f4e7b147cb3666e1d6bab91be2c0305daaeee57d338b9af546cefc79725be1 SHA512 7ed656ebe35ce55a0064dae57fdcc5c3eecc3c6db71bfc66f001dd60c4db764c6a2565af29f84ca1246280fbd573d8da4d09e21444b71210cedea5d1462b85f0 +DIST nvidia-settings-565.77.tar.bz2 1119070 BLAKE2B 74f3a0a68a9bf10d7a8cd96a5db9b6e11d70073de2f1e8494f5d40ed79fb88895f158797b3b70bc0656c9d65d9920f033ed5aa1f3c95f71cbfcf04a118478d9c SHA512 100560edbf1575a365e09394409333bbfc28bdd03761b13b89b6d052e195f65f94c9e47c9f0588f40a0f6d375a8e16b543ca84f82cc1a5a76ec37ea1941fae1f +DIST nvidia-settings-570.211.01.tar.bz2 1123957 BLAKE2B 7355319d29f96aeeada3cd1ffd08b053fa76a5f2f0dd35fac383ff5c1ffd4abba95d0a7f0f421fc4b74a11f2c94352c9e2db363034e5361a0d18017a321261f2 SHA512 8f29c02597eedd934531e703c617aaa7504effe836257de07c664145e07690b0b34b8c893c01e9e561bf90cb3c15b1b6c116e2a7a88ea1a733f2872490c10441 +DIST nvidia-settings-575.64.05.tar.bz2 1127714 BLAKE2B 935649b61361ff9b05f34ba9770704eb945134199edbb17d2581f74188f8b122009b6d4309b225c375fcb80f26fb6a82c9528bf22e5658c5856d1752bee309bb SHA512 3e3df016f1f6b34a802d872c67a9f1c0db6d38c8265343eb607c71c59bf5597c7378800641b1152af404ebc0515f8f79eff1ee0e81b87b84ff7a237c176526f6 DIST nvidia-settings-580.159.03.tar.bz2 1133196 BLAKE2B c36b3e8333eb325b74152a6fbb3f5e5d001b306ea1c6cf9ed9b8c61479f4d0d72b8fca4b7372cef1b66f06b94e7d20e5b69da61a2e0b16f918df504607a3e7dd SHA512 e50ff8850e4405ea7ad8f5725b4787b3c6166b90585b098270e277c45625f4540ae7ef00a460f1eb6da694fbfdd29fb9ec9ad82c797931106db5dfee40a3edd0 DIST nvidia-settings-580.159.04.tar.bz2 1133196 BLAKE2B ebe947f523301a612f3bc87c9d38659052158d6e421339e12a879b6e854f0778a6166b91e71d0e4638961d63eb983e0bd899b9cecc45433b51bd04d010c38319 SHA512 edb4def04272bc663a47ad117e67a91f0b6719bb3a8b6d0c85758275767b945bf430ea025828c9fd121550546f65d253b5c54792c2151090b6ad0e7ae9d02c75 +DIST nvidia-settings-590.48.01.tar.bz2 1134292 BLAKE2B 901a3bad03d4eaca3f78afc154539f72aa882ae19052b43b6bfb267a3be1ded4af607fbc05d1a379a8038a22fa5a9c19dd6c393f3436cda97cc7049820f1ec57 SHA512 c82737dc8894a35b7e87afd99fb98c0a4093ec8fd48590cc8e09154d55f948ceaf48fff31c7d015adcceab31a00c5ec4334fe1e90aec94c4bb076118b789dd4c DIST nvidia-settings-595.71.05.tar.bz2 1136100 BLAKE2B 8b0af1e7a81b63042c762794c2f8f3094b40c4a9fc845dae9c39b63c02c613ce6893cb2451806ba775df8128b498259435ad49dd4ea27dafccf0c6c7bfcfda6c SHA512 8f7286863e1306cb50860f83aca046bf4743d3c8c72ddb9e6461e240bb741aa7c03e795081d821808832923ba0e736a4676cf137c84adc8ea770c6d0a28d8dc5 -DIST nvidia-settings-595.80.tar.bz2 1136230 BLAKE2B de34d8594c1f5e888e7c941aab1a3222233b56f565559c7a3e96fd8c605390ffd4bba05f319ae9d584b216d7f032d63c86fffa320ebfe52756a986fe5a69ab28 SHA512 46529e60f24ee97f20eba30d242070bbb57599daa7b440c41d7477c8ec2047702367d1e771a722cb69d240185837e9f6b93171ad7013c6c55b691d9c411b8dbb DIST nvidia-settings-610.43.02.tar.bz2 1138293 BLAKE2B 4d0931334d14b60ed8cf113d1a74d321c12edd1fb2f62c23683f392931f7b65779c9539148e20a9e259d4e2f9d6a6fd2249265e93edf81e49bec25291e174d4b SHA512 e4a5a5ba6f5858f786c98d6bca4f416f0fb160beb0a5329b80d5d03378d68d623e69ed0fea29de81a16b7d819c9e57007d2e690b7dc890cccc04b6298c86f9b7 -DIST nvidia-xconfig-390.157.tar.bz2 107399 BLAKE2B 0cbb3b1ba508ddc3ba4a161c290b31bf7a67f67880bdbd01171a962c5fa97ca945b1ef17932403f8589309380743f1da632c728d8accb6d4e56dbd895e7486bb SHA512 50b390811c9bf091b14add41f886925b17496b41006b7d3981d2398caa65cf5db8a579c8cebed78278384bf3acc629befb07b54339c61abcc75852c0dcb8b8ca -DIST nvidia-xconfig-470.256.02.tar.bz2 108698 BLAKE2B e468574e4bc57e7279d4120e2b08a201671b50d408be0c530eabe5da7d45daaf21cbf5c7fa31410d0d732fe8ea1551cbfb21d1ae193c1b3f5b5c50c764c9e236 SHA512 9dcec1e0c2b56b4d38a5f2c76086302f8bc0860cc15012cce29c3a5062f801a48b6a2bb78344361b07a2717b58502783441a2daf402d9973a17526175b1f15ca +DIST nvidia-xconfig-495.46.tar.bz2 108955 BLAKE2B 1edd231bc06b66030e56a78b233b72c49ff5f3dc355e13964427b61e95a33a70a16ee1535ae91fbb806079a595eb763d0b3cdfaee7a3498fe617a9596db8da0f SHA512 d467b3f699f9f8794d0d136653620c56ba7b5273f532b7398ee1b5d85edd2ecd6b0cf666b2fc4f375b2ecf08ed19d53097574aa691c967a22cb2c9d1f665fde6 +DIST nvidia-xconfig-525.147.05.tar.bz2 110987 BLAKE2B 49116c8922b5c14eaa88b6230a824447609a885f7d97df28ed4f3b9a2e146a213f31f9f184aadd38c4c9f692f0a1476d0db0704b55947ce95cbbeebcb9a683da SHA512 4b7c02de6080924eee5ee9fe770e632404b380529e5ee40a8d0f259a5c96d6915e83c26113b3c65434ce461c959347b3651abc15de7c40def16c46bb3f6faeae DIST nvidia-xconfig-535.309.01.tar.bz2 111085 BLAKE2B 7a2f55989f93bbfecef0ae0c76113b42cc79c3fefce12f3becb2c3722978115b2408efefa63845ef2f9ef7563f9ce79c5a9cafcc3de4f70605f34aae44d485f5 SHA512 710f279b6e4ac143c39344c44cda5950777c613f193170a76fa948def5a13b5b9177b44651e3b46a2630e7f420a9189671042f76b88c14a31ba6f6dcd78fdb7d +DIST nvidia-xconfig-550.163.01.tar.bz2 111149 BLAKE2B d19ef0427e3432798e674dc66447090e8fb8fcb549ebe27aaee19aa38294cf178e175a067b2da5313342c93ea2aebef35861d05cc4cc0ee2c3eae955b3ddbbb3 SHA512 35f95d85928c82bc5de8e462ca5e90a6d8fe03e5b5367b9cdaadddc1e956f0d26b6dc42e716ae7c88512afdfb98cc841fe9b22846f6d6acc578c5dba4d0a16e1 +DIST nvidia-xconfig-555.58.02.tar.bz2 111182 BLAKE2B f51275158f02687e54e856f3f7e9f92b01c6c7aba423e5384cf3d4e692dc6d3fdc73ed0b25f26fb1206dc1219b6e0bffd54767e0f0f3b4b3a63875113d55236f SHA512 673bea01fe39687ba34e19b743c61898d2ed8f34710c3a1afc8f2e71e0903950f253408b0fcf0b6306a98ddc2438cacd92fafd1d1662136b18058017dfb783c4 +DIST nvidia-xconfig-560.35.03.tar.bz2 111203 BLAKE2B 347d4f80b9a16da54fbd7116d0ceafbb15b3b6e78aa1640b8505674b9ffc32056197925b67506d2cbb5d130054944c13246a592d9021f0bb2410ee6e8216df4e SHA512 1a68729b8aa1d3518b43392d4f9af163e2a084c635c08343b25ce761f835801aad203778fd03564ba050ad949a9d2df84fba4c8a48bb1a7afea5e72eb364eb58 +DIST nvidia-xconfig-565.77.tar.bz2 111235 BLAKE2B 75cc8a5ed9248f044159482940e6d4eead7b4cb8321b15883ce0c97230c85b260cacdd74cdad45ee8a8248271e081ae94623d195151840b07c8f747eea33a0e1 SHA512 641ca934b79d2a597be56309dfab968ab1b908bfc346c33fe69d9c13c56636e643388b6c1d83918bcc3fda70ecc2a34d6a305422539130424eafd973fc94c41e +DIST nvidia-xconfig-570.211.01.tar.bz2 111263 BLAKE2B 9d6e7e973156d91ce1a213a95aa31269d811024ebf358dfad42c0771cafc6c4f2d4257994d67e67ac637a1107527511d8f8219446e9a57560bab8ba7d4d2684c SHA512 8e8be1e95998fde590bdb5c0246764a426d623c8bf9e705e7bff649f1daebb86726cead4add570622e34aea9a38b697d31d11d7a2fc741dd91af2ccaaa024cd1 +DIST nvidia-xconfig-575.64.05.tar.bz2 111165 BLAKE2B 87b272e12b63e6d4a393b76e4ec4c47d1433caee1e73ab50c3da8b1b3cb4ece0d0adad3e6496df4a81c0efd8aff67f8afa5de192df24cbe4ae7f8a4b86d674ac SHA512 00dfe0cbf0fb1131391a38b2d1bd95e52ac90b77cf19b76cb6cd6d0a3ef83c5020ff5dd8e08f8d424a7b32338e7752675e1f700392df7efd2d9b96bbc8072541 DIST nvidia-xconfig-580.159.03.tar.bz2 111535 BLAKE2B 5ae167c6aae8596e89f1b254ed8cc4c21d20ca4d1ac4d238c79d64458324d5910e9d66b29d8079d9eaa771b2cdc15af3685ac224cf9d1f69dd471838edff783c SHA512 2d34928a5b5f419090742a6592e8c07bbcfc05b037af125c0f20d1267b8685e5a0d4bd8a039192c158579c39c08ac2c49e362d170009db02ba11835f1d8268d1 DIST nvidia-xconfig-580.159.04.tar.bz2 111540 BLAKE2B 95cfd0c4af5e2d171e39c1e53e225ec92cf5ac9ce3c9953c9e558f08a67e314030f5a2b4618706ffd6e598f314eab45b4d3087a8896222dcbf6c1a4b73a2debb SHA512 878a37240de42baf2f9a453cb3f5aaf0a6029cb1f00b3b1567c9e25175a2e1118b5266965163296eba0b39a9e01137b9d815ed29d4dd67f1ee43d5905b373d98 +DIST nvidia-xconfig-590.48.01.tar.bz2 110986 BLAKE2B 6ec7f5eee2ca4c4a96f0607ac94ec3d491137a0e8750a6ae4c46feddced61f7a8b1eb77aa333008a69ceab7ad071671b7449bb2ed9ba285359fd1cb991a9c9b2 SHA512 e85dbd9ba5e056fb6f8a4618df35fa1692d0037e50122a5659ebda043a9b380fdf72aaa56f82b64e5525c36f429ed9bbd7f0e319c608f7c50355d47ab3b24077 DIST nvidia-xconfig-595.71.05.tar.bz2 111096 BLAKE2B 8b6f7e043319577f0b21780cc88ce189b99123ee079a4e5188e7c12d7d2859776f5d47efc1625ba70542df300ba88bf555e8d4638816322966d04c9a316b5a56 SHA512 bf705b1916633d8dfd4742d94358607901bc843f1280954391d9ee7be98da36f0f895811057b8666f59ab3b850bc6e5bb2bf80a88923827497cf0b5a852db6fa -DIST nvidia-xconfig-595.80.tar.bz2 110917 BLAKE2B 93b78ac4de45b63ccc7fe16008631abbdaea30cc3e7b5958a2ae54e0a95ab1f492edd00c53af3d543895b3fb9a5f329013b6cb1abb091d778346ad0c1dd4bc0c SHA512 eb2a9221face01763807ee4ee6198f549e89b3f1c8faf37711c7c424503d0e4c8ff70bbf7d487264b9d745d75ed3e55af5d41001b783dedb3cafd8328b76d851 DIST nvidia-xconfig-610.43.02.tar.bz2 111123 BLAKE2B 5ade2f6525b4fc847a28c6d853dd5d829c434ed892cda9060ddb6f66566e440bc11d0f01a2930016000b8f1861bcd5be5c9ca168d4d7ecb91fdfb46e61b2c98f SHA512 c8975ea34bcff52fd19973c28b3c215e847567e0d153ca2dc3b867b55c3bb9325a52a7802e77986f65a0472cd0ac501b872bf2ed05ca9543413ef8dc26af2b2c -DIST open-gpu-kernel-modules-595.44.09.tar.gz 24805417 BLAKE2B 0281e825fb55982971499bc4a5284115fd0fdd24eb033bbff17010d1e7ace7c041dac56f98123cfbd5009f1f75b25332e3dfa68acc684c3f59ff740769cd291c SHA512 57a43e94740d31b84671cddb061825d954d1039fbdf82572875f8ca3f94309d7480ac19718e96cf062c9a78e8b2ef3598766928f03e9420fed90ab6f3ab65b7a diff --git a/x11-drivers/nvidia-drivers/files/nvidia-390.conf b/x11-drivers/nvidia-drivers/files/nvidia-390.conf index bf2eb3fb52e4..c873f00c462c 100644 --- a/x11-drivers/nvidia-drivers/files/nvidia-390.conf +++ b/x11-drivers/nvidia-drivers/files/nvidia-390.conf @@ -1,10 +1,9 @@ # NVIDIA drivers options # See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. -# nvidia-drivers and nouveau / nova cannot be used at same time. -# Comment out the following lines if you wish to allow either. +# nvidia-drivers and nouveau cannot be used at same time. +# Comment out the following line if you wish to allow nouveau. blacklist nouveau -blacklist nova_core # !!! Security Warning !!! # Do not change the DeviceFile options unless you know what you are doing. diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.conf b/x11-drivers/nvidia-drivers/files/nvidia-470.conf index 77b9d385fe71..977ef8034929 100644 --- a/x11-drivers/nvidia-drivers/files/nvidia-470.conf +++ b/x11-drivers/nvidia-drivers/files/nvidia-470.conf @@ -1,21 +1,18 @@ # NVIDIA drivers options # See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. -# nvidia-drivers and nouveau / nova cannot be used at same time. -# Comment out the following lines if you wish to allow either. +# nvidia-drivers and nouveau cannot be used at same time. +# Comment out the following line if you wish to allow nouveau. blacklist nouveau -blacklist nova_core -# Kernel Mode Setting (needed for wayland but is hardly usable with legacy 470) +# Kernel Mode Setting (notably needed for EGLStream/Wayland) # Enabling may possibly cause issues with SLI and Reverse PRIME. #options nvidia-drm modeset=1 -# Suspend options. Note that Allocations=1 requires suspend hooks currently -# only used when either systemd or elogind is used to suspend. If using -# neither or have issues, try Allocations=0 (revert if it does not help -# as =0 is not recommended). +# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's +# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend). options nvidia \ - NVreg_PreserveVideoMemoryAllocations=1 \ + NVreg_PreserveVideoMemoryAllocations=0 \ NVreg_TemporaryFilePath=/var/tmp # !!! Security Warning !!! diff --git a/x11-drivers/nvidia-drivers/files/nvidia-545.conf b/x11-drivers/nvidia-drivers/files/nvidia-545.conf new file mode 100644 index 000000000000..6de5577d5bf9 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-545.conf @@ -0,0 +1,38 @@ +# NVIDIA drivers options +# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. + +# nvidia-drivers and nouveau cannot be used at same time. +# Comment out the following line if you wish to allow nouveau. +blacklist nouveau + +# Kernel Mode Setting (notably needed for fbdev and wayland). +# Enabling may possibly cause issues with SLI and Reverse PRIME. +#options nvidia-drm modeset=1 + +# Enable experimental framebuffer console support (^ requires modeset=1). +# Replaces efifb or similar once loaded. Note that unloading nvidia modules +# to, e.g. load a new version, would result in losing console display +# (emphasis on being experimental, mode switch could cause issues with X). +#options nvidia-drm fbdev=1 + +# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's +# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend), +# but even then may lead to issues on some setups (keep 0 if in doubt). +options nvidia \ + NVreg_PreserveVideoMemoryAllocations=0 \ + NVreg_TemporaryFilePath=/var/tmp + +# !!! Security Warning !!! +# Do not change the DeviceFile options unless you know what you are doing. +# Only add trusted users to the 'video' group, these users may be able to +# crash, compromise, or irreparably damage the machine. +options nvidia \ + NVreg_DeviceFileGID=@VIDEOGID@ \ + NVreg_DeviceFileMode=432 \ + NVreg_DeviceFileUID=0 \ + NVreg_ModifyDeviceFiles=1 + +# Should be no need to touch anything below. +alias char-major-195 nvidia +alias /dev/nvidiactl char-major-195 +remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia-555.conf b/x11-drivers/nvidia-drivers/files/nvidia-555.conf new file mode 100644 index 000000000000..e0c1b09808f8 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-555.conf @@ -0,0 +1,43 @@ +# NVIDIA drivers options +# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. + +# nvidia-drivers and nouveau cannot be used at same time. +# Comment out the following line if you wish to allow nouveau. +blacklist nouveau + +# Kernel Mode Setting (notably needed for fbdev and wayland). +# Enabling may possibly cause issues with SLI and Reverse PRIME. +#options nvidia-drm modeset=1 + +# Enable experimental framebuffer console support (^ requires modeset=1). +# Replaces efifb or similar once loaded. Note that unloading nvidia modules +# to, e.g. load a new version, would result in losing console display +# (emphasis on being experimental, mode switch could cause issues with X). +#options nvidia-drm fbdev=1 + +# Disable use of the GSP firmware which has newly been enabled by default +# for GPUs that support it (Turing/Ampere+ GPUs, aka GTX 1650+). Not +# recommended unless experience regressions for which disabling helps. +# Cannot be disabled if using USE="kernel-open". +#options nvidia NVreg_EnableGpuFirmware=0 + +# Suspend options. Allocations=0 recommended over =1 unless enable nvidia's +# systemd sleep services (nvidia-hibernate, nvidia-resume, nvidia-suspend). +options nvidia \ + NVreg_PreserveVideoMemoryAllocations=0 \ + NVreg_TemporaryFilePath=/var/tmp + +# !!! Security Warning !!! +# Do not change the DeviceFile options unless you know what you are doing. +# Only add trusted users to the 'video' group, these users may be able to +# crash, compromise, or irreparably damage the machine. +options nvidia \ + NVreg_DeviceFileGID=@VIDEOGID@ \ + NVreg_DeviceFileMode=432 \ + NVreg_DeviceFileUID=0 \ + NVreg_ModifyDeviceFiles=1 + +# Should be no need to touch anything below. +alias char-major-195 nvidia +alias /dev/nvidiactl char-major-195 +remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia-580.conf b/x11-drivers/nvidia-drivers/files/nvidia-580.conf deleted file mode 100644 index 36d71d1664cb..000000000000 --- a/x11-drivers/nvidia-drivers/files/nvidia-580.conf +++ /dev/null @@ -1,47 +0,0 @@ -# NVIDIA drivers options -# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. - -# nvidia-drivers and nouveau / nova cannot be used at same time. -# Comment out the following lines if you wish to allow either. -blacklist nouveau -blacklist nova_core - -# Kernel Mode Setting (notably needed for fbdev and wayland). -# If in doubt, even X11 users should not touch this. -options nvidia-drm modeset=1 - -# If modeset=1 ^, NVIDIA will handle the console/tty display and allow -# overriding DRM devices such as simpledrm by default. May or may not -# cause issues like being unable to display/switch tty properly or -# resume from sleep with *some* setups. Try disabling by uncommenting -# if need to troubleshoot issues, and re-enable if unrelated. -#options nvidia-drm fbdev=0 - -# Disable use of the GSP firmware, only an option when USE=kernel-open -# is disabled (which in turn disables usage of Blackwell 50xx or newer -# GPUs). This should not be touched unless it is causing known issues. -# Notably may be needed to get Runtime D3 to work with Turing GPUs. -#options nvidia NVreg_EnableGpuFirmware=0 - -# Suspend options. Note that Allocations=1 requires suspend hooks currently -# only used when either systemd or elogind is used to suspend. If using -# neither or have issues, try Allocations=0 (revert if it does not help -# as =0 is not recommended). -options nvidia \ - NVreg_PreserveVideoMemoryAllocations=1 \ - NVreg_TemporaryFilePath=/var/tmp - -# !!! Security Warning !!! -# Do not change the DeviceFile options unless you know what you are doing. -# Only add trusted users to the 'video' group, these users may be able to -# crash, compromise, or irreparably damage the machine. -options nvidia \ - NVreg_DeviceFileGID=@VIDEOGID@ \ - NVreg_DeviceFileMode=432 \ - NVreg_DeviceFileUID=0 \ - NVreg_ModifyDeviceFiles=1 - -# Should be no need to touch anything below. -alias char-major-195 nvidia -alias /dev/nvidiactl char-major-195 -remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia-595.conf b/x11-drivers/nvidia-drivers/files/nvidia-595.conf deleted file mode 100644 index e166611781d9..000000000000 --- a/x11-drivers/nvidia-drivers/files/nvidia-595.conf +++ /dev/null @@ -1,36 +0,0 @@ -# NVIDIA drivers options -# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. - -# nvidia-drivers and nouveau / nova cannot be used at same time. -# Comment out the following lines if you wish to allow either. -blacklist nouveau -blacklist nova_core - -# By default, NVIDIA will handle the console/tty display and allow -# overriding DRM devices such as simpledrm. May or may not cause -# issues like being unable to display/switch tty properly or resume -# from sleep with *some* setups. Try disabling by uncommenting if -# need to troubleshoot issues, and re-enable if unrelated. -#options nvidia-drm fbdev=0 - -# Suspend options. Notifiers=1 implies NVreg_PreserveVideoMemoryAllocations=1 -# which is needed to avoid issues when resuming from suspend esp. on wayland -# (former systemd suspend services are not needed with kernel notifiers). -options nvidia \ - NVreg_UseKernelSuspendNotifiers=1 \ - NVreg_TemporaryFilePath=/var/tmp - -# !!! Security Warning !!! -# Do not change the DeviceFile options unless you know what you are doing. -# Only add trusted users to the 'video' group, these users may be able to -# crash, compromise, or irreparably damage the machine. -options nvidia \ - NVreg_DeviceFileGID=@VIDEOGID@ \ - NVreg_DeviceFileMode=432 \ - NVreg_DeviceFileUID=0 \ - NVreg_ModifyDeviceFiles=1 - -# Should be no need to touch anything below. -alias char-major-195 nvidia -alias /dev/nvidiactl char-major-195 -remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia-610.conf b/x11-drivers/nvidia-drivers/files/nvidia-610.conf deleted file mode 100644 index b69054f442bd..000000000000 --- a/x11-drivers/nvidia-drivers/files/nvidia-610.conf +++ /dev/null @@ -1,44 +0,0 @@ -# NVIDIA drivers options -# See /usr/share/doc/nvidia-drivers-*/README.txt* for more information. - -# nvidia-drivers and nouveau / nova cannot be used at same time. -# Comment out the following lines if you wish to allow either. -blacklist nouveau -blacklist nova_core - -# This is a new feature targeting wayland+HDR that not all wayland -# compositors can handle properly yet, this disables it by default -# for now. Feel free to re-enable if it works fine for you as it may -# provide a performance gain when using HDR. -# https://forums.developer.nvidia.com/t/365381 -# https://forums.developer.nvidia.com/t/371356 -options nvidia-drm color_pipeline=0 - -# By default, NVIDIA will handle the console/tty display and allow -# overriding DRM devices such as simpledrm. May or may not cause -# issues like being unable to display/switch tty properly or resume -# from sleep with *some* setups. Try disabling by uncommenting if -# need to troubleshoot issues, and re-enable if unrelated. -#options nvidia-drm fbdev=0 - -# Suspend options. Notifiers=1 implies NVreg_PreserveVideoMemoryAllocations=1 -# which is needed to avoid issues when resuming from suspend esp. on wayland -# (former systemd suspend services are not needed with kernel notifiers). -options nvidia \ - NVreg_UseKernelSuspendNotifiers=1 \ - NVreg_TemporaryFilePath=/var/tmp - -# !!! Security Warning !!! -# Do not change the DeviceFile options unless you know what you are doing. -# Only add trusted users to the 'video' group, these users may be able to -# crash, compromise, or irreparably damage the machine. -options nvidia \ - NVreg_DeviceFileGID=@VIDEOGID@ \ - NVreg_DeviceFileMode=432 \ - NVreg_DeviceFileUID=0 \ - NVreg_ModifyDeviceFiles=1 - -# Should be no need to touch anything below. -alias char-major-195 nvidia -alias /dev/nvidiactl char-major-195 -remove nvidia modprobe -r --ignore-remove nvidia-drm nvidia-modeset nvidia-uvm nvidia diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch index 334f0d1c9b13..ab88f2b997c3 100644 --- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.141.03-clang15.patch @@ -1,7 +1,6 @@ Kernel's makefiles pass -Werror=strict-prototypes which -can trigger errors depending on compiler defaults. +trigger errors with clang15+ https://bugs.gentoo.org/870238 -https://github.com/NVIDIA/open-gpu-kernel-modules/issues/377 --- a/kernel/nvidia/nvlink_linux.c +++ b/kernel/nvidia/nvlink_linux.c @@ -571 +571 @@ diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.116.04-clang-unused-option.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.116.04-clang-unused-option.patch new file mode 100644 index 000000000000..692e1880489d --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.116.04-clang-unused-option.patch @@ -0,0 +1,17 @@ +clang-15.0.7(?) or so may abort when the unused option -MD is passed, +option removal is backported from the nvidia:0/535 branch. + +Note patch is kept without context given the lines below change constantly +(version) preventing from applying same patch to multiple versions. + +https://github.com/NVIDIA/open-gpu-kernel-modules/issues/506 +--- a/kernel/Kbuild ++++ b/kernel/Kbuild +@@ -73 +73 @@ +-EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args ++EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args +--- a/kernel-module-source/kernel-open/Kbuild ++++ b/kernel-module-source/kernel-open/Kbuild +@@ -73 +73 @@ +-EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args ++EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-580.159.03-null-deref.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-580.159.03-null-deref.patch deleted file mode 100644 index 1e1edfe33569..000000000000 --- a/x11-drivers/nvidia-drivers/files/nvidia-drivers-580.159.03-null-deref.patch +++ /dev/null @@ -1,57 +0,0 @@ -This reverts the contents of nvidia-drm-fb.c back to the one used -by nvidia-drivers-580.126.18 as a temporary fix to avoid a NULL -dereference sometimes seen when using kwin. - -NVIDIA is aware of the issue but no fix have been deployed as of -the writing of this. Unclear if reverting can cause different -issues but it is believed to be better than doing nothing. - -USE=kernel-open is not known to be affected at the moment, so not -changing anything for the open variant. - -https://bugs.gentoo.org/971109 -https://forums.developer.nvidia.com/t/363409 ---- a/kernel/nvidia-drm/nvidia-drm-fb.c -+++ b/kernel/nvidia-drm/nvidia-drm-fb.c -@@ -64,7 +64,5 @@ - /* Free NvKmsKapiSurface associated with this framebuffer object */ - -- if (nv_fb->pSurface != NULL) { -- nvKms->destroySurface(nv_dev->pDevice, nv_fb->pSurface); -- } -+ nvKms->destroySurface(nv_dev->pDevice, nv_fb->pSurface); - - __nv_drm_framebuffer_free(nv_fb); -@@ -142,5 +140,4 @@ - struct nv_drm_gem_object *nv_gem; - struct drm_framebuffer *fb = &nv_fb->base; -- bool non_scanout_mem_backed = false; - uint32_t i; - int ret; -@@ -164,8 +161,4 @@ - params.planes[i].offset = fb->offsets[i]; - params.planes[i].pitch = fb->pitches[i]; -- -- if (!nvKms->isVidmem(nv_gem->pMemory) && nv_dev->hasVideoMemory) { -- non_scanout_mem_backed = true; -- } - } - } -@@ -234,13 +227,8 @@ - /* Create NvKmsKapiSurface */ - -- if (non_scanout_mem_backed) { -- /* Do not register drm_framebuffer against nvkms */ -- nv_fb->pSurface = NULL; -- } else { -- nv_fb->pSurface = nvKms->createSurface(nv_dev->pDevice, ¶ms); -- if (nv_fb->pSurface == NULL) { -- NV_DRM_DEV_DEBUG_DRIVER(nv_dev, "Failed to create NvKmsKapiSurface"); -- goto fail; -- } -+ nv_fb->pSurface = nvKms->createSurface(nv_dev->pDevice, ¶ms); -+ if (nv_fb->pSurface == NULL) { -+ NV_DRM_DEV_DEBUG_DRIVER(nv_dev, "Failed to create NvKmsKapiSurface"); -+ goto fail; - } - diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd index 27d8bb37d98a..e199efc1e54e 100644 --- a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd +++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.initd @@ -1,5 +1,6 @@ #!/sbin/openrc-run -# SPDX-License-Identifier: MIT +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 description="Maintain persistent software state in the NVIDIA driver" command="nvidia-persistenced" diff --git a/x11-drivers/nvidia-drivers/metadata.xml b/x11-drivers/nvidia-drivers/metadata.xml index 75a44bfaa124..2cca84b6fba0 100644 --- a/x11-drivers/nvidia-drivers/metadata.xml +++ b/x11-drivers/nvidia-drivers/metadata.xml @@ -1,6 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> <pkgmetadata> + <maintainer type="project"> + <email>dev@liguros.net</email> + <name>Development</name> + </maintainer> <maintainer type="person"> <email>ionen@gentoo.org</email> <name>Ionen Wolkens</name> @@ -9,29 +13,15 @@ <email>soap@gentoo.org</email> <name>David Seifert</name> </maintainer> + <upstream> + <remote-id type="cpe">cpe:/a:nvidia:gpu_driver</remote-id> + </upstream> <use> - <flag name="kernel-open"> - Use the open source variant of the drivers (only - works for Turing/Ampere or newer GPUs, aka GTX 1650+ - -- recommended with >=560.xx drivers if usable and - is *required* for 50xx Blackwell or newer GPUs -- - always-enabled regardless of USE in >=595.xx) - </flag> + <flag name="kernel-open">Use the open source variant of drivers (Turing/Ampere+ GPUs only, aka GTX 1650+, very experimental)</flag> <flag name="persistenced">Install the persistence daemon for keeping devices state when unused (e.g. for headless)</flag> <flag name="powerd">Install the NVIDIA dynamic boost support daemon (only useful with specific laptops, ignore if unsure)</flag> <flag name="static-libs">Install the XNVCtrl static library for accessing sensors and other features</flag> <flag name="tools">Install additional tools such as nvidia-settings</flag> </use> - <upstream> - <remote-id type="cpe">cpe:/a:nvidia:gpu_driver</remote-id> - </upstream> - <slots> - <subslots> - Subslot is primarily used to identify branches, at most - rebuilding reverse dependencies on bumps would only be - for the static library (not essential to) given other - headers are provided by nvidia-cuda-toolkit instead. - </subslots> - </slots> <origin>baldeagleos-repo</origin> </pkgmetadata> diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild deleted file mode 100644 index 3c7dd26989b7..000000000000 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild +++ /dev/null @@ -1,452 +0,0 @@ -# Copyright 1999-2026 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info - -MODULES_KERNEL_MAX=6.1 -NV_URI="https://download.nvidia.com/XFree86/" - -DESCRIPTION="NVIDIA Accelerated Graphics Driver" -HOMEPAGE="https://www.nvidia.com/" -SRC_URI=" - amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) - x86? ( ${NV_URI}Linux-x86/${PV}/NVIDIA-Linux-x86-${PV}.run ) - $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ - nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) -" -# nvidia-installer is unused but here for GPL-2's "distribute sources" -S=${WORKDIR} - -LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT" -SLOT="0/${PV%%.*}" -KEYWORDS="-* amd64 x86" -IUSE="+X abi_x86_32 abi_x86_64 persistenced +static-libs +tools" - -COMMON_DEPEND=" - acct-group/video - persistenced? ( - acct-user/nvpd - net-libs/libtirpc:= - ) - tools? ( - >=app-accessibility/at-spi2-core-2.46:2 - dev-libs/glib:2 - dev-libs/jansson:= - media-libs/harfbuzz:= - x11-libs/cairo - x11-libs/gdk-pixbuf:2 - x11-libs/gtk+:3[X] - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXxf86vm - x11-libs/pango - ) -" -RDEPEND=" - ${COMMON_DEPEND} - sys-libs/glibc - X? ( - media-libs/libglvnd[X,abi_x86_32(-)?] - x11-libs/libX11[abi_x86_32(-)?] - x11-libs/libXext[abi_x86_32(-)?] - ) -" -DEPEND=" - ${COMMON_DEPEND} - static-libs? ( - x11-base/xorg-proto - x11-libs/libX11 - x11-libs/libXext - ) - tools? ( - media-libs/libglvnd - sys-apps/dbus - x11-base/xorg-proto - x11-libs/libXrandr - x11-libs/libXv - x11-libs/libvdpau - ) -" -BDEPEND=" - sys-devel/m4 - virtual/pkgconfig -" - -# there is some non-prebuilt exceptions but rather not maintain a list -QA_PREBUILT="usr/bin/* usr/lib*" - -PATCHES=( - # note: no plans to add patches for newer kernels here, when the last - # working 6.1.x LTS is EOL then 390 will simply be removed from the tree - "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch - "${FILESDIR}"/nvidia-settings-390.141-fno-common.patch - "${FILESDIR}"/nvidia-settings-390.144-desktop.patch - "${FILESDIR}"/nvidia-settings-390.144-no-gtk2.patch - "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch -) - -pkg_setup() { - use modules && [[ ${MERGE_TYPE} != binary ]] || return - - local CONFIG_CHECK=" - PROC_FS - ~DRM_KMS_HELPER - ~SYSVIPC - ~!AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT - ~!LOCKDEP - ~!X86_KERNEL_IBT - !DEBUG_MUTEXES - " - - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection - of drivers (no custom config), and optional nvidia-drm.modeset=1. - With 390.xx drivers, also used by a GLX workaround needed for OpenGL. - Cannot be directly selected in the kernel's menuconfig, and may need - selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or - DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." - - local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature, - this will likely lead to modules load failure with ENDBR errors. - Please ignore if not having issues, but otherwise try to unset or - pass ibt=off to the kernel's command line." #911142 - - kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 - - linux-mod-r1_pkg_setup -} - -src_prepare() { - # make patches usable across versions - rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die - rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die - rm nvidia-settings && mv nvidia-settings{-${PV},} || die - rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die - - eapply "${FILESDIR}"/nvidia-drivers-390.154-clang15$(usev {,-}x86).patch - - default - - # prevent detection of incomplete kernel DRM support (bug #603818) - sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ - -i kernel/conftest.sh || die - - sed 's/__USER__/nvpd/' \ - nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ - > "${T}"/nvidia-persistenced.service || die - - # use alternative vulkan icd option if USE=-X (bug #909181) - sed "s/__NV_VK_ICD__/lib$(usex X GLX EGL)_nvidia.so.0/" \ - nvidia_icd.json.template > nvidia_icd.json || die - - # 390 has legacy glx needing a modified .conf (bug #713546) - # directory is not quite right, but kept for any existing custom xorg.conf - sed "s|@LIBDIR@|${EPREFIX}/usr/$(get_libdir)|" \ - "${FILESDIR}"/nvidia-drm-outputclass-390.conf > nvidia-drm-outputclass.conf || die -} - -src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch - - use static-libs && lto-guarantee-fat - - # dead branch that will never be fixed and due for eventual removal, - # so keeping lazy "fixes" (bug #921370) - local kcflags=( - -std=gnu17 - -Wno-error=implicit-function-declaration - -Wno-error=incompatible-pointer-types - ) - # not *FLAGS to ensure it's used everywhere including conftest.sh - CC+=" $(test-flags-CC "${kcflags[@]}")" - use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${kcflags[@]}")" - - NV_ARGS=( - PREFIX="${EPREFIX}"/usr - HOST_CC="$(tc-getBUILD_CC)" - HOST_LD="$(tc-getBUILD_LD)" - NV_USE_BUNDLED_LIBJANSSON=0 - NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - ) - - local modlist=( nvidia{,-drm,-modeset}=video:kernel ) - use x86 || modlist+=( nvidia-uvm=video:kernel ) - local modargs=( - CC="${KERNEL_CC}" # for the above kcflags workarounds - IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 - SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - ) - - # temporary workaround for bug #914468 - use modules && addpredict "${KV_OUT_DIR}" - - linux-mod-r1_src_compile - - if use persistenced; then - # 390.xx persistenced does not auto-detect libtirpc - LIBS=$(${PKG_CONFIG} --libs libtirpc || die) \ - common_cflags=$(${PKG_CONFIG} --cflags libtirpc || die) \ - emake "${NV_ARGS[@]}" -C nvidia-persistenced - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig - - if use tools; then - # avoid noisy *very* noisy logs with deprecation warnings - CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ - emake "${NV_ARGS[@]}" -C nvidia-settings - elif use static-libs; then - emake "${NV_ARGS[@]}" -C nvidia-settings/src build-xnvctrl - fi -} - -src_install() { - local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) - - NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) - - local -A paths=( - [APPLICATION_PROFILE]=/usr/share/nvidia - [CUDA_ICD]=/etc/OpenCL/vendors - [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d - [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d - [VULKAN_ICD_JSON]=/usr/share/vulkan/icd.d - [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d - - [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions - [GLX_MODULE_SYMLINK]=/usr/${libdir}/extensions/nvidia - [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules - [XMODULE_SYMLINK]=/usr/${libdir}/xorg/modules - ) - - local skip_files=( - $(usev !X "libGLX_nvidia libglx libnvidia-ifr") - libGLX_indirect # non-glvnd unused fallback - libnvidia-gtk nvidia-{settings,xconfig} # built from source - libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - ) - local skip_modules=( - $(usev !X "nvfbc vdpau xdriver") - installer nvpd # handled separately / built from source - ) - local skip_types=( - GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd - OPENCL_WRAPPER.\* # virtual/opencl - DOCUMENTATION DOT_DESKTOP # handled separately - XMODULE_NEWSYM # use xorg's libwfb.so, nvidia also keeps it if it exists - .\*_SRC DKMS_CONF LIBGL_LA OPENGL_HEADER # unused - ) - - local DOCS=( - README.txt NVIDIA_Changelog - nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt - ) - local HTML_DOCS=( html/. ) - einstalldocs - - local DISABLE_AUTOFORMATTING=yes - local DOC_CONTENTS="\ -Trusted users should be in the 'video' group to use NVIDIA devices. -You can add yourself by using: gpasswd -a my-user video\ -$(usev modules " - -Like all out-of-tree kernel modules, it is necessary to rebuild -${PN} after upgrading or rebuilding the Linux kernel -by for example running \`emerge @module-rebuild\`. Alternatively, -if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), -this can be automated by setting USE=dist-kernel globally. - -Loaded kernel modules also must not mismatch with the installed -${PN} version (excluding -r revision), meaning should -ensure \`eselect kernel list\` points to the kernel that will be -booted before building and preferably reboot after upgrading -${PN} (the ebuild will emit a warning if mismatching). - -See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ -$(use amd64 && usev !abi_x86_32 " - -Note that without USE=abi_x86_32 on ${PN}, 32bit applications -(typically using wine / steam) will not be able to use GPU acceleration.")\ -$(usev X " - -390.xx libglvnd support is partial and requires different Xorg modules -for working OpenGL/GLX. If using the default Xorg configuration these -should be used automatically, otherwise manually add the ModulePath -from: '${EPREFIX}/${paths[XORG_OUTPUTCLASS_CONFIG]#/}/nvidia-drm-outputclass.conf'")\ -$(usev x86 " - -Note that NVIDIA is no longer offering support for the unified memory -module (nvidia-uvm) on x86 (32bit), as such the module is missing. -This means OpenCL/CUDA (and related, like nvenc) cannot be used. -Other functions, like OpenGL, will continue to work.") - -Support from NVIDIA for 390.xx will end in December 2022, how long -Gentoo will be able to reasonably support it beyond that is unknown. -If wish to continue using this hardware, should consider switching -to the Nouveau open source driver. -https://nvidia.custhelp.com/app/answers/detail/a_id/3142/ - -For additional information or for troubleshooting issues, please see -https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own -documentation that is installed alongside this README." - readme.gentoo_create_doc - - if use modules; then - linux-mod-r1_src_install - - insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-390.conf nvidia.conf - fi - - emake "${NV_ARGS[@]}" -C nvidia-modprobe install - fowners :video /usr/bin/nvidia-modprobe #505092 - fperms 4710 /usr/bin/nvidia-modprobe - - if use persistenced; then - emake "${NV_ARGS[@]}" -C nvidia-persistenced install - newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced - newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced - systemd_dounit "${T}"/nvidia-persistenced.service - fi - - if use tools; then - emake "${NV_ARGS[@]}" -C nvidia-settings install - - doicon nvidia-settings/doc/nvidia-settings.png - domenu nvidia-settings/doc/nvidia-settings.desktop - - exeinto /etc/X11/xinit/xinitrc.d - newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings - fi - - if use static-libs; then - dolib.a nvidia-settings/src/libXNVCtrl/libXNVCtrl.a - strip-lto-bytecode - - insinto /usr/include/NVCtrl - doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h - fi - - use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install - - # mimic nvidia-installer by reading .manifest to install files - # 0:file 1:perms 2:type 3+:subtype/arguments -:module - local m into - while IFS=' ' read -ra m; do - ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || - [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || - [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || - has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue - - case ${m[2]} in - MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz} - pipestatus || die - continue - ;; - GLX_MODULE_SYMLINK|XMODULE_NEWSYM) - # messy symlinks for non-glvnd xorg modules overrides put - # in a different directory to avoid collisions (390-only) - m[4]=../../xorg/modules/${m[3]#/}${m[4]} - m[3]=/ - ;; - TLS_LIB) [[ ${m[4]} == CLASSIC ]] && continue;; # segfaults (bug #785289) - VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ - VULKAN_ICD_JSON) m[0]=${m[0]%.template};; - esac - - if [[ -v 'paths[${m[2]}]' ]]; then - into=${paths[${m[2]}]} - elif [[ ${m[2]} == *_BINARY ]]; then - into=/usr/bin - elif [[ ${m[3]} == COMPAT32 ]]; then - use abi_x86_32 || continue - into=/usr/${libdir32} - elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then - into=/usr/${libdir} - else - die "No known installation path for ${m[0]}" - fi - [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} - [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} - - if [[ ${m[2]} =~ _SYMLINK$|_NEWSYM$ ]]; then - [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} - dosym ${m[4]} ${into}/${m[0]} - continue - fi - - printf -v m[1] %o $((m[1] | 0200)) # 444->644 - insopts -m${m[1]} - insinto ${into} - doins ${m[0]} - done < .manifest || die - insopts -m0644 # reset - - # MODULE:installer non-skipped extras - dolib.so libnvidia-cfg.so.${PV} - dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so.1 - dosym libnvidia-cfg.so.${PV} /usr/${libdir}/libnvidia-cfg.so - - dobin nvidia-bug-report.sh - - # symlink non-versioned so nvidia-settings can use it even if misdetected - dosym nvidia-application-profiles-${PV}-key-documentation \ - ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation - - # sandbox issues with /dev/nvidiactl are widespread and sometime - # affect revdeps of packages built with USE=opencl/cuda making it - # hard to manage in ebuilds (minimal set, ebuilds should handle - # manually if need others or addwrite) - insinto /etc/sandbox.d - newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl"' - - # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure - # our settings are used for bug 932781#c8 and nouveau blacklist if either - # modules are included (however, just best-effort without initramfs regen) - if use modules; then - echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ - "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die - fi -} - -pkg_preinst() { - use modules || return - - # set video group id based on live system (bug #491414) - local g=$(egetent group video | cut -d: -f3) - [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" - sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die -} - -pkg_postinst() { - linux-mod-r1_pkg_postinst - - readme.gentoo_print_elog - - if [[ -r /proc/driver/nvidia/version && - $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" - ewarn "libraries and may prevent launching GPU-accelerated applications." - if use modules; then - ewarn "Easiest way to fix this is normally to reboot. If still run into issues" - ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify" - ewarn "that the running kernel is ${KV_FULL} and that (if used) the" - ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)." - fi - fi - - ewarn "\nBe warned/reminded that the 390.xx branch reached end-of-life and" - ewarn "NVIDIA is no longer fixing issues (including security). Free to keep" - ewarn "using (for now) but it is recommended to either switch to nouveau or" - ewarn "replace hardware. Will be kept in-tree while possible, but expect it" - ewarn "to be removed likely in late 2027 or earlier if major issues arise." - ewarn "\nNote that there is no plans to patch in support for kernels branches" - ewarn "newer than 6.1.x which will be supported upstream until December 2027" - ewarn "albeit its support *could* end earlier in Gentoo." -} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-495.46.ebuild index 3c7de626aa88..e37f5461e706 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.256.02-r2.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-495.46.ebuild @@ -1,17 +1,16 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2023-2025 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +inherit desktop flag-o-matic linux-mod-r1 multilib readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info MODULES_KERNEL_MAX=6.6 NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" -HOMEPAGE="https://www.nvidia.com/" +HOMEPAGE="https://www.nvidia.com/download/index.aspx" SRC_URI=" ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ @@ -22,8 +21,8 @@ S=${WORKDIR} LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" SLOT="0/${PV%%.*}" -KEYWORDS="-* amd64" -IUSE="+X abi_x86_32 abi_x86_64 persistenced +static-libs +tools" +KEYWORDS="-* ~amd64" +IUSE="+X abi_x86_32 abi_x86_64 persistenced +static-libs +tools wayland" COMMON_DEPEND=" acct-group/video @@ -53,11 +52,14 @@ RDEPEND=" x11-libs/libX11[abi_x86_32(-)?] x11-libs/libXext[abi_x86_32(-)?] ) + wayland? ( + ~gui-libs/egl-wayland-1.1.7 + media-libs/libglvnd + ) " DEPEND=" ${COMMON_DEPEND} static-libs? ( - x11-base/xorg-proto x11-libs/libX11 x11-libs/libXext ) @@ -75,8 +77,7 @@ BDEPEND=" virtual/pkgconfig " -# there is some non-prebuilt exceptions but rather not maintain a list -QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*" +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-drivers-470.141.03-clang15.patch @@ -101,7 +102,7 @@ pkg_setup() { " local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection - of drivers (no custom config), and for nvidia-drm.modeset=1 if used. + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. Cannot be directly selected in the kernel's menuconfig, and may need selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." @@ -132,26 +133,22 @@ src_prepare() { sed 's/__USER__/nvpd/' \ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ > "${T}"/nvidia-persistenced.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die } src_compile() { - tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + tc-export AR CC CXX LD OBJCOPY OBJDUMP local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch - # dead branch that will never be fixed and due for eventual removal, - # so keeping lazy "fixes" (bug #921370) - local kcflags=( - -std=gnu17 - -Wno-error=implicit-function-declaration - -Wno-error=incompatible-pointer-types - ) - # not *FLAGS to ensure it's used everywhere including conftest.sh - CC+=" $(test-flags-CC "${kcflags[@]}")" - use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${kcflags[@]}")" - - # extra flags for the libXNVCtrl.a static library local xnvflags=-fPIC #840389 - tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + # lto static libraries tend to cause problems without fat objects + is-flagq '-flto@(|=*)' && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" NV_ARGS=( PREFIX="${EPREFIX}"/usr @@ -164,13 +161,13 @@ src_compile() { local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=video:kernel ) local modargs=( - CC="${KERNEL_CC}" # for the above kcflags workarounds IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" ) # temporary workaround for bug #914468 - use modules && addpredict "${KV_OUT_DIR}" + use modules && + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}" linux-mod-r1_src_compile emake "${NV_ARGS[@]}" -C nvidia-modprobe @@ -208,10 +205,10 @@ src_install() { local skip_files=( $(usev !X "libGLX_nvidia libglxserver_nvidia libnvidia-ifr") + $(usev !wayland libnvidia-vulkan-producer) libGLX_indirect # non-glvnd unused fallback libnvidia-gtk nvidia-{settings,xconfig} # built from source - # skip wayland-related files, largely broken with 470 at this point - libnvidia-egl-wayland 10_nvidia_wayland libnvidia-vulkan-producer + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland ) local skip_modules=( $(usev !X "nvfbc vdpau xdriver") @@ -264,7 +261,7 @@ documentation that is installed alongside this README." linux-mod-r1_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-470.conf nvidia.conf + doins "${T}"/nvidia.conf # used for gpu verification with binpkgs (not kept, see pkg_preinst) insinto /usr/share/nvidia @@ -294,7 +291,6 @@ documentation that is installed alongside this README." if use static-libs; then dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode insinto /usr/include/NVCtrl doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h @@ -313,8 +309,7 @@ documentation that is installed alongside this README." case ${m[2]} in MANPAGE) - gzip -dc ${m[0]} | newman - ${m[0]%.gz} - pipestatus || die + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert continue ;; VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ @@ -323,7 +318,7 @@ documentation that is installed alongside this README." if [[ -v 'paths[${m[2]}]' ]]; then into=${paths[${m[2]}]} elif [[ ${m[2]} == *_BINARY ]]; then - into=/usr/bin + into=/opt/bin elif [[ ${m[3]} == COMPAT32 ]]; then use abi_x86_32 || continue into=/usr/${libdir32} @@ -359,38 +354,6 @@ documentation that is installed alongside this README." dobin nvidia-bug-report.sh - # enabling is needed for sleep to work properly and little reason not to do - # it unconditionally for a better user experience - : "$(systemd_get_systemunitdir)" - local unitdir=${_#"${EPREFIX}"} - # not using relative symlinks to match systemd's own links - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service - dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service - dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service - # also add a custom elogind hook to do the equivalent of the above - exeinto /usr/lib/elogind/system-sleep - newexe "${FILESDIR}"/system-sleep.elogind nvidia - # <elogind-255.5 used a different path (bug #939216), keep a compat symlink - # TODO: cleanup after 255.5 been stable for a few months - dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia - - # needed with >=systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 - insinto "${unitdir}"/systemd-homed.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false - EOF - insinto "${unitdir}"/systemd-suspend.service.d - newins - 10-nvidia.conf <<-EOF - [Service] - Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false - EOF - dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf - dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation @@ -404,17 +367,11 @@ documentation that is installed alongside this README." # ebuilds should handle manually if need others or addwrite) insinto /etc/sandbox.d newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"' - - # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure - # our settings are used for bug 932781#c8 and nouveau blacklist if either - # modules are included (however, just best-effort without initramfs regen) - if use modules; then - echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ - "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die - fi } pkg_preinst() { + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + use modules || return # set video group id based on live system (bug #491414) @@ -444,7 +401,7 @@ pkg_postinst() { if [[ -r /proc/driver/nvidia/version && $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" + ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." if use modules; then ewarn "Easiest way to fix this is normally to reboot. If still run into issues" @@ -455,32 +412,39 @@ pkg_postinst() { fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then - ewarn "\nDetected that the current kernel command line is using 'slub_debug='," + ewarn "Detected that the current kernel command line is using 'slub_debug='," ewarn "this may lead to system instability/freezes with this version of" ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi if [[ -v NV_LEGACY_MASK ]]; then - ewarn "\n***WARNING***" - ewarn "\nYou are installing a version of ${PN} known not to work" + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" ewarn "with a GPU of the current system. If unwanted, add the mask:" if [[ -d ${EROOT}/etc/portage/package.mask ]]; then - ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" else - ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" fi - ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" fi - ewarn "\nBe warned/reminded that the 470.xx branch reached end-of-life and" - ewarn "NVIDIA is no longer fixing issues (including security). Free to keep" - ewarn "using (for now) but it is recommended to either switch to nouveau or" - ewarn "replace hardware. Will be kept in-tree while possible, but expect it" - ewarn "to be removed likely in late 2027 or earlier if major issues arise." - ewarn "\nNote that there is no plans to patch in support for kernels branches" - ewarn "newer than 6.6.x which will be supported upstream until December 2027" - ewarn "albeit its support *could* end earlier in Gentoo." + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + elog + elog "This version of ${PN} only supports EGLStream which is only" + elog "supported by a few wayland compositors (e.g. kwin / mutter, not sway)," + elog "and is barely tested (X11 is recommended for this legacy branch)." + fi } diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild new file mode 100644 index 000000000000..2f32c5948fa7 --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild @@ -0,0 +1,507 @@ +# Copyright 2023 Liguros Authors +# Distributed under the terms of the GNU General Public License v2 +EAPI=8 + +MODULES_OPTIONAL_IUSE=+modules +inherit desktop flag-o-matic linux-mod-r1 multilib readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info + +MODULES_KERNEL_MAX=6.6 +NV_URI="https://download.nvidia.com/XFree86/" + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://www.nvidia.com/download/index.aspx" +SRC_URI=" + amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) + arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run ) + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) + ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz +" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S=${WORKDIR} + +LICENSE="NVIDIA-r2 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +SLOT="0/${PV%%.*}" +KEYWORDS="-* ~amd64 ~arm64" +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" + +COMMON_DEPEND=" + acct-group/video + X? ( x11-libs/libpciaccess ) + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) + tools? ( + >=app-accessibility/at-spi2-core-2.46:2 + dev-libs/glib:2 + dev-libs/jansson:= + media-libs/harfbuzz:= + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/gtk+:3[X] + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXxf86vm + x11-libs/pango + ) +" +RDEPEND=" + ${COMMON_DEPEND} + sys-libs/glibc + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) + wayland? ( + gui-libs/egl-gbm + >=gui-libs/egl-wayland-1.1.10 + media-libs/libglvnd + ) +" +DEPEND=" + ${COMMON_DEPEND} + static-libs? ( + x11-libs/libX11 + x11-libs/libXext + ) + tools? ( + media-libs/libglvnd + sys-apps/dbus + x11-base/xorg-proto + x11-libs/libXrandr + x11-libs/libXv + x11-libs/libvdpau + ) +" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig +" + +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" + +PATCHES=( + "${FILESDIR}"/nvidia-drivers-525.116.04-clang-unused-option.patch + "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-390.144-desktop.patch + "${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!SLUB_DEBUG_ON + !DEBUG_MUTEXES + " + + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." + + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature, + this *could* lead to modules load failure with ENDBR errors, or to + broken CUDA/NVENC. Please ignore if not having issues, but otherwise + try to unset or pass ibt=off to the kernel's command line." #911142 + use kernel-open || CONFIG_CHECK+=" ~!X86_KERNEL_IBT" + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." + + linux-mod-r1_pkg_setup +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-settings && mv nvidia-settings{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + + # adjust service files + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die + use !amd64 || sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-470.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + + # makefile attempts to install wayland library even if not built + use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ + nvidia-settings/src/Makefile || die + + # temporary option, nvidia will remove in the future + use !kernel-open || + sed -i '/blacklist/a\ +\ +# Enable using kernel-open with workstation GPUs (experimental)\ +options nvidia NVreg_OpenRmEnableUnsupportedGpus=1' "${T}"/nvidia.conf || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP + local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + is-flagq '-flto@(|=*)' && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + BUILD_GTK2LIB= + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + WAYLAND_AVAILABLE=$(usex wayland 1 0) + XNVCTRL_CFLAGS="${xnvflags}" + ) + + if use modules; then + local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open + + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + fi + + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) + local modargs=( + IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 + SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" + ) + + # temporary workaround for bug #914468 + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}" + + linux-mod-r1_src_compile + CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig + + if use tools; then + # avoid noisy *very* noisy logs with deprecation warnings + CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ + emake "${NV_ARGS[@]}" -C nvidia-settings + elif use static-libs; then + # pretend GTK+3 is available, not actually used (bug #880879) + emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ + -C nvidia-settings/src out/libXNVCtrl.a + fi +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [VULKAN_ICD_JSON]=/usr/share/vulkan + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia") + $(usev !wayland libnvidia-vulkan-producer) + libGLX_indirect # non-glvnd unused fallback + libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source + libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !modules gsp) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ +$(usev modules " + +Like all out-of-tree kernel modules, it is necessary to rebuild +${PN} after upgrading or rebuilding the Linux kernel +by for example running \`emerge @module-rebuild\`. Alternatively, +if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), +this can be automated by setting USE=dist-kernel globally. + +Loaded kernel modules also must not mismatch with the installed +${PN} version (excluding -r revision), meaning should +ensure \`eselect kernel list\` points to the kernel that will be +booted before building and preferably reboot after upgrading +${PN} (the ebuild will emit a warning if mismatching). + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ +$(use amd64 && usev !abi_x86_32 " + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.") + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + if use modules; then + linux-mod-r1_src_install + + insinto /etc/modprobe.d + doins "${T}"/nvidia.conf + + # used for gpu verification with binpkgs (not kept, see pkg_preinst) + insinto /usr/share/nvidia + doins supported-gpus/supported-gpus.json + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + if use tools; then + emake "${NV_ARGS[@]}" -C nvidia-settings install + + doicon nvidia-settings/doc/nvidia-settings.png + domenu nvidia-settings/doc/nvidia-settings.desktop + + exeinto /etc/X11/xinit/xinitrc.d + newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings + fi + + if use static-libs; then + dolib.a nvidia-settings/src/out/libXNVCtrl.a + + insinto /usr/include/NVCtrl + doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + [[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] && + dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # MODULE:powerd extras + if use amd64; then + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl (and /dev/char wrt bug #904292) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/char"' +} + +pkg_preinst() { + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + + use modules || return + + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die + + # try to find driver mismatches using temporary supported-gpus.json + for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do + g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ + "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) + if [[ ${g} ]]; then + g=$((${g##*\"}+1)) + if ver_test -ge ${g}; then + NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" + break + fi + fi + done + rm "${ED}"/usr/share/nvidia/supported-gpus.json || die +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + + readme.gentoo_print_elog + + if [[ -r /proc/driver/nvidia/version && + $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then + ewarn "Currently loaded NVIDIA modules do not match the newly installed" + ewarn "libraries and may prevent launching GPU-accelerated applications." + if use modules; then + ewarn "Easiest way to fix this is normally to reboot. If still run into issues" + ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify" + ewarn "that the running kernel is ${KV_FULL} and that (if used) the" + ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)." + fi + fi + + if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then + ewarn "Detected that the current kernel command line is using 'slub_debug='," + ewarn "this may lead to system instability/freezes with this version of" + ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" + fi + + if [[ -v NV_LEGACY_MASK ]]; then + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" + ewarn "with a GPU of the current system. If unwanted, add the mask:" + if [[ -d ${EROOT}/etc/portage/package.mask ]]; then + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + else + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + fi + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "are available or fully functional, may need to consider nouveau[2])." + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" + fi + + if use kernel-open; then + ewarn + ewarn "Open source variant of ${PN} was selected, be warned it is experimental" + ewarn "and only for modern GPUs (e.g. GTX 1650+). Try to disable if run into issues." + ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.309.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.309.01.ebuild index 35686cfe16c2..2c8cf85dbcda 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.309.01.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.309.01.ebuild @@ -1,13 +1,12 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2023-2025 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus flag-o-matic linux-mod-r1 multilib +inherit desktop eapi9-pipestatus flag-o-matic linux-mod-r1 multilib inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -MODULES_KERNEL_MAX=6.18 +MODULES_KERNEL_MAX=6.13 NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" @@ -22,10 +21,11 @@ SRC_URI=" # nvidia-installer is unused but here for GPL-2's "distribute sources" S=${WORKDIR} -LICENSE="NVIDIA-2023 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +LICENSE="NVIDIA-r2 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" SLOT="0/${PV%%.*}" -KEYWORDS="-* amd64 ~arm64" +KEYWORDS="-* ~amd64 ~arm64" IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" COMMON_DEPEND=" acct-group/video @@ -50,10 +50,8 @@ COMMON_DEPEND=" " RDEPEND=" ${COMMON_DEPEND} - || ( - dev-libs/openssl-compat:3 - dev-libs/openssl:0/3 - ) + dev-libs/openssl:0/3 + sys-libs/glibc X? ( media-libs/libglvnd[X,abi_x86_32(-)?] @@ -88,8 +86,7 @@ BDEPEND=" virtual/pkgconfig " -# there is some non-prebuilt exceptions but rather not maintain a list -QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*" +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch @@ -109,7 +106,6 @@ pkg_setup() { ~!PREEMPT_RT ~!SLUB_DEBUG_ON !DEBUG_MUTEXES - $(usev amd64 'X86_PAT') $(usev powerd '~CPU_FREQ') " @@ -119,11 +115,18 @@ pkg_setup() { selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." + local ERROR_X86_KERNEL_IBT="CONFIG_X86_KERNEL_IBT: is set and, if the CPU supports the feature, + this *could* lead to modules load failure with ENDBR errors, or to + broken CUDA/NVENC. Please ignore if not having issues, but otherwise + try to unset or pass ibt=off to the kernel's command line." #911142 + use kernel-open || CONFIG_CHECK+=" ~!X86_KERNEL_IBT" + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. Cannot be directly selected in the kernel's menuconfig, and may need - selection of another option that requires it such as CONFIG_AMD_IOMMU=y, - or DRM_I915=m (among others, consult the kernel config's help)." + selection of another option that requires it such as CONFIG_KVM." local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is @@ -147,9 +150,12 @@ src_prepare() { sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ -i kernel{,-module-source/kernel-open}/conftest.sh || die + # adjust service files sed 's/__USER__/nvpd/' \ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ > "${T}"/nvidia-persistenced.service || die + use !powerd || # file is missing on arm64 (masked) + sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die # use alternative vulkan icd option if USE=-X (bug #909181) use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die @@ -174,18 +180,10 @@ src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch - # extra flags for the libXNVCtrl.a static library local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - # same as uname -m - local target_arch - case ${ARCH} in - amd64) target_arch=x86_64;; - arm64) target_arch=aarch64;; - *) die "Unrecognised architecture: ${ARCH}";; - esac - NV_ARGS=( PREFIX="${EPREFIX}"/usr HOST_CC="$(tc-getBUILD_CC)" @@ -193,7 +191,6 @@ src_compile() { BUILD_GTK2LIB= NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - TARGET_ARCH="${target_arch}" WAYLAND_AVAILABLE=$(usex wayland 1 0) XNVCTRL_CFLAGS="${xnvflags}" ) @@ -201,6 +198,11 @@ src_compile() { if use modules; then local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + local modlistargs=video:kernel if use kernel-open; then modlistargs+=-module-source:kernel-module-source/kernel-open @@ -210,17 +212,13 @@ src_compile() { filter-flags -fno-plt #912949 filter-lto CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags - - # the "blob" uses C++ which is an issue if there is debug symbols - # when running pahole - linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0 fi local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - TARGET_ARCH="${target_arch}" # kernel takes "x86" and "x86_64" as meaning the same, but nvidia # makes the distinction (since 550.135) and is not happy with "x86" @@ -229,7 +227,7 @@ src_compile() { ) # temporary workaround for bug #914468 - addpredict "${KV_OUT_DIR}" + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}" linux-mod-r1_src_compile CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} @@ -363,7 +361,6 @@ documentation that is installed alongside this README." if use static-libs; then dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode insinto /usr/include/NVCtrl doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h @@ -395,7 +392,7 @@ documentation that is installed alongside this README." elif [[ ${m[2]} == EXPLICIT_PATH ]]; then into=${m[3]} elif [[ ${m[2]} == *_BINARY ]]; then - into=/usr/bin + into=/opt/bin elif [[ ${m[3]} == COMPAT32 ]]; then use abi_x86_32 || continue into=/usr/${libdir32} @@ -527,7 +524,7 @@ pkg_postinst() { if [[ -r /proc/driver/nvidia/version && $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" + ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." if use modules; then ewarn "Easiest way to fix this is normally to reboot. If still run into issues" @@ -538,37 +535,82 @@ pkg_postinst() { fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then - ewarn "\nDetected that the current kernel command line is using 'slub_debug='," + ewarn "Detected that the current kernel command line is using 'slub_debug='," ewarn "this may lead to system instability/freezes with this version of" ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi if [[ -v NV_LEGACY_MASK ]]; then - ewarn "\n***WARNING***" - ewarn "\nYou are installing a version of ${PN} known not to work" + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" ewarn "with a GPU of the current system. If unwanted, add the mask:" if [[ -d ${EROOT}/etc/portage/package.mask ]]; then - ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" else - ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" fi - ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" fi - if use kernel-open && use modules; then - ewarn "\nOpen source variant of ${PN} was selected, be warned it is experimental" + if use kernel-open; then + ewarn + ewarn "Open source variant of ${PN} was selected, be warned it is experimental" ewarn "and only for modern GPUs (e.g. GTX 1650+). Try to disable if run into issues." ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" fi if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then - elog "\nWith USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" elog "experimental but is required for wayland." - elog "\nIf you experience issues, either disable wayland or edit nvidia.conf." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." elog "Of note, may possibly cause issues with SLI and Reverse PRIME." fi + + # these can be removed after some time, only to help the transition + # given users are unlikely to do further custom solutions if it works + # (see also https://github.com/elogind/elogind/issues/272) + if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null + then + ewarn + ewarn "!!! WARNING !!!" + ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/." + ewarn "This 'could' cause issues if used in combination with the new hook" + ewarn "installed by the ebuild to handle sleep using the official upstream" + ewarn "script. It is recommended to disable the option." + fi + if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep 2>/dev/null | \ + sort | uniq | xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]] + then + ewarn + ewarn "!!! WARNING !!!" + ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep" + ewarn "referencing NVIDIA. This version of ${PN} has installed its own" + ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended" + ewarn "to remove the custom one to avoid potential issues." + ewarn + ewarn "Feel free to ignore this warning if you know the other NVIDIA-related" + ewarn "scripts can be used together. The warning will be removed in the future." + fi + if [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 535.183.01-r1 # may get repeated + then + elog + elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default" + elog "with this version of ${PN}. This is recommended (or required) by" + elog "major DEs especially with wayland but, *if* experience regressions with" + elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'." + elog + elog "May notably be an issue when using neither systemd nor elogind to suspend." + elog + elog "Also, the systemd suspend/hibernate/resume services are now enabled by" + elog "default, and for openrc+elogind a similar hook has been installed." + fi } diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.163.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.163.01.ebuild new file mode 100644 index 000000000000..4ff74d7a8fdc --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.163.01.ebuild @@ -0,0 +1,597 @@ +# Copyright 2023-2025 Liguros Authors +# Distributed under the terms of the GNU General Public License v2 +EAPI=8 + +MODULES_OPTIONAL_IUSE=+modules +inherit desktop flag-o-matic linux-mod-r1 readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info + +MODULES_KERNEL_MAX=6.12 +NV_URI="https://download.nvidia.com/XFree86/" + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://www.nvidia.com/" +SRC_URI=" + amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) + arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run ) + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) + ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz +" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S=${WORKDIR} + +LICENSE="NVIDIA-r2 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +SLOT="0/${PV%%.*}" +KEYWORDS="-* ~amd64 ~arm64" +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" + +COMMON_DEPEND=" + acct-group/video + X? ( x11-libs/libpciaccess ) + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) + tools? ( + >=app-accessibility/at-spi2-core-2.46:2 + dev-libs/glib:2 + dev-libs/jansson:= + media-libs/harfbuzz:= + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/gtk+:3[X] + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXxf86vm + x11-libs/pango + ) +" +RDEPEND=" + ${COMMON_DEPEND} + dev-libs/openssl:0/3 + + sys-libs/glibc + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) + powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) + wayland? ( + gui-libs/egl-gbm + >=gui-libs/egl-wayland-1.1.10 + ) +" +DEPEND=" + ${COMMON_DEPEND} + static-libs? ( + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + ) + tools? ( + media-libs/libglvnd + sys-apps/dbus + x11-base/xorg-proto + x11-libs/libXrandr + x11-libs/libXv + x11-libs/libvdpau + ) +" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig +" + +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" + +PATCHES=( + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK + get_version + require_configured_kernel + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!SLUB_DEBUG_ON + !DEBUG_MUTEXES + $(usev powerd '~CPU_FREQ') + " + + kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && + CONFIG_CHECK+=" DRM_TTM_HELPER" + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + + local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_QXL=m, DRM_NOUVEAU=m also acceptable if a module and *not* built-in." + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. + ${drm_helper_msg}" + local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using + kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. + ${drm_helper_msg} + Many DRM devices like DRM_I915 cannot currently be used to enable this." + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." + + linux-mod-r1_pkg_setup +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-settings && mv nvidia-settings{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + + # adjust service files + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die + sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-545.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + + # makefile attempts to install wayland library even if not built + use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ + nvidia-settings/src/Makefile || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + BUILD_GTK2LIB= + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + WAYLAND_AVAILABLE=$(usex wayland 1 0) + XNVCTRL_CFLAGS="${xnvflags}" + ) + + if use modules; then + local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open + + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + fi + + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) + local modargs=( + IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 + SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" + + # kernel takes "x86" and "x86_64" as meaning the same, but nvidia + # makes the distinction (since 550.135) and is not happy with "x86" + # TODO?: it should be ok/better for tc-arch-kernel to do x86_64 + $(usev amd64 ARCH=x86_64) + ) + + # temporary workaround for bug #914468 + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}" + + linux-mod-r1_src_compile + CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig + + if use tools; then + # avoid noisy *very* noisy logs with deprecation warnings + CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ + emake "${NV_ARGS[@]}" -C nvidia-settings + elif use static-libs; then + # pretend GTK+3 is available, not actually used (bug #880879) + emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ + -C nvidia-settings/src out/libXNVCtrl.a + fi +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [OPENGL_DATA]=/usr/share/nvidia + [VULKAN_ICD_JSON]=/usr/share/vulkan + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia") + libGLX_indirect # non-glvnd unused fallback + libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source + libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + libnvidia-pkcs11.so # using the openssl3 version instead + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !modules gsp) + $(usev !powerd powerd) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ +$(usev modules " + +Like all out-of-tree kernel modules, it is necessary to rebuild +${PN} after upgrading or rebuilding the Linux kernel +by for example running \`emerge @module-rebuild\`. Alternatively, +if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), +this can be automated by setting USE=dist-kernel globally. + +Loaded kernel modules also must not mismatch with the installed +${PN} version (excluding -r revision), meaning should +ensure \`eselect kernel list\` points to the kernel that will be +booted before building and preferably reboot after upgrading +${PN} (the ebuild will emit a warning if mismatching). + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ +$(use amd64 && usev !abi_x86_32 " + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.") + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + if use modules; then + linux-mod-r1_src_install + + insinto /etc/modprobe.d + doins "${T}"/nvidia.conf + + # used for gpu verification with binpkgs (not kept, see pkg_preinst) + insinto /usr/share/nvidia + doins supported-gpus/supported-gpus.json + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + if use tools; then + emake "${NV_ARGS[@]}" -C nvidia-settings install + + doicon nvidia-settings/doc/nvidia-settings.png + domenu nvidia-settings/doc/nvidia-settings.desktop + + exeinto /etc/X11/xinit/xinitrc.d + newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings + fi + + if use static-libs; then + dolib.a nvidia-settings/src/out/libXNVCtrl.a + + insinto /usr/include/NVCtrl + doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == EXPLICIT_PATH ]]; then + into=${m[3]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + [[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] && + dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # enabling is needed for sleep to work properly and little reason not to do + # it unconditionally for a better user experience + : "$(systemd_get_systemunitdir)" + local unitdir=${_#"${EPREFIX}"} + # not using relative symlinks to match systemd's own links + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service + # also add a custom elogind hook to do the equivalent of the above + exeinto /usr/lib/elogind/system-sleep + newexe "${FILESDIR}"/system-sleep.elogind nvidia + # <elogind-255.5 used a different path (bug #939216), keep a compat symlink + # TODO: cleanup after 255.5 been stable for a few months + dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl others (bug #904292,#921578) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' + + # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure + # our settings are used for bug 932781#c8 and nouveau blacklist if either + # modules are included (however, just best-effort without initramfs regen) + if use modules; then + echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ + "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die + fi +} + +pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + + use modules || return + + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die + + # try to find driver mismatches using temporary supported-gpus.json + for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do + g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ + "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) + if [[ ${g} ]]; then + g=$((${g##*\"}+1)) + if ver_test -ge ${g}; then + NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" + break + fi + fi + done + rm "${ED}"/usr/share/nvidia/supported-gpus.json || die +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + + readme.gentoo_print_elog + + if [[ -r /proc/driver/nvidia/version && + $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then + ewarn "Currently loaded NVIDIA modules do not match the newly installed" + ewarn "libraries and may prevent launching GPU-accelerated applications." + if use modules; then + ewarn "Easiest way to fix this is normally to reboot. If still run into issues" + ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify" + ewarn "that the running kernel is ${KV_FULL} and that (if used) the" + ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)." + fi + fi + + if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then + ewarn "Detected that the current kernel command line is using 'slub_debug='," + ewarn "this may lead to system instability/freezes with this version of" + ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" + fi + + if [[ -v NV_LEGACY_MASK ]]; then + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" + ewarn "with a GPU of the current system. If unwanted, add the mask:" + if [[ -d ${EROOT}/etc/portage/package.mask ]]; then + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + else + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + fi + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "are available or fully functional, may need to consider nouveau[2])." + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" + fi + + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, be warned it is experimental" + ewarn "and only for modern GPUs (e.g. GTX 1650+). Try to disable if run into issues." + ewarn "Please also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + # these can be removed after some time, only to help the transition + # given users are unlikely to do further custom solutions if it works + # (see also https://github.com/elogind/elogind/issues/272) + if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null + then + ewarn + ewarn "!!! WARNING !!!" + ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/." + ewarn "This 'could' cause issues if used in combination with the new hook" + ewarn "installed by the ebuild to handle sleep using the official upstream" + ewarn "script. It is recommended to disable the option." + fi + if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep 2>/dev/null | \ + sort | uniq | xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]] + then + ewarn + ewarn "!!! WARNING !!!" + ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep" + ewarn "referencing NVIDIA. This version of ${PN} has installed its own" + ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended" + ewarn "to remove the custom one to avoid potential issues." + ewarn + ewarn "Feel free to ignore this warning if you know the other NVIDIA-related" + ewarn "scripts can be used together. The warning will be removed in the future." + fi + if [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 550.107.02-r1 # may get repeated + then + elog + elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default" + elog "with this version of ${PN}. This is recommended (or required) by" + elog "major DEs especially with wayland but, *if* experience regressions with" + elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'." + elog + elog "May notably be an issue when using neither systemd nor elogind to suspend." + elog + elog "Also, the systemd suspend/hibernate/resume services are now enabled by" + elog "default, and for openrc+elogind a similar hook has been installed." + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-555.58.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-555.58.02.ebuild new file mode 100644 index 000000000000..7e1683321e74 --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-555.58.02.ebuild @@ -0,0 +1,508 @@ +# Copyright 2023-2024 Liguros Authors +# Distributed under the terms of the GNU General Public License v2 +EAPI=8 + +MODULES_OPTIONAL_IUSE=+modules +inherit desktop flag-o-matic linux-mod-r1 readme.gentoo-r1 systemd toolchain-funcs unpacker user-info + +MODULES_KERNEL_MAX=6.9 +NV_URI="https://download.nvidia.com/XFree86/" + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://www.nvidia.com/download/index.aspx" +SRC_URI=" + amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) + arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run ) + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) + ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz +" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S=${WORKDIR} + +LICENSE="NVIDIA-r2 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +SLOT="0/${PV%%.*}" +KEYWORDS="-* ~amd64 ~arm64" +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" + +COMMON_DEPEND=" + acct-group/video + X? ( x11-libs/libpciaccess ) + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) + tools? ( + >=app-accessibility/at-spi2-core-2.46:2 + dev-libs/glib:2 + dev-libs/jansson:= + media-libs/harfbuzz:= + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/gtk+:3[X] + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXxf86vm + x11-libs/pango + ) +" +RDEPEND=" + ${COMMON_DEPEND} + dev-libs/openssl:0/3 + + sys-libs/glibc + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) + powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) + wayland? ( + gui-libs/egl-gbm + >=gui-libs/egl-wayland-1.1.10 + ) +" +DEPEND=" + ${COMMON_DEPEND} + static-libs? ( + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + ) + tools? ( + media-libs/libglvnd + sys-apps/dbus + x11-base/xorg-proto + x11-libs/libXrandr + x11-libs/libXv + x11-libs/libvdpau + ) +" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig +" + +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" + +PATCHES=( + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!SLUB_DEBUG_ON + !DEBUG_MUTEXES + $(usev powerd '~CPU_FREQ') + " + + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." + + linux-mod-r1_pkg_setup +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-settings && mv nvidia-settings{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + + # adjust service files + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die + sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-555.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + + # makefile attempts to install wayland library even if not built + use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ + nvidia-settings/src/Makefile || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + BUILD_GTK2LIB= + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + WAYLAND_AVAILABLE=$(usex wayland 1 0) + XNVCTRL_CFLAGS="${xnvflags}" + ) + + if use modules; then + local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open + + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + fi + + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) + local modargs=( + IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 + SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" + ) + + # temporary workaround for bug #914468 + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}" + + linux-mod-r1_src_compile + CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig + + if use tools; then + # avoid noisy *very* noisy logs with deprecation warnings + CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ + emake "${NV_ARGS[@]}" -C nvidia-settings + elif use static-libs; then + # pretend GTK+3 is available, not actually used (bug #880879) + emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ + -C nvidia-settings/src out/libXNVCtrl.a + fi +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [OPENGL_DATA]=/usr/share/nvidia + [VULKAN_ICD_JSON]=/usr/share/vulkan + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia") + libGLX_indirect # non-glvnd unused fallback + libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source + libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + libnvidia-pkcs11.so # using the openssl3 version instead + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !modules gsp) + $(usev !powerd powerd) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ +$(usev modules " + +Like all out-of-tree kernel modules, it is necessary to rebuild +${PN} after upgrading or rebuilding the Linux kernel +by for example running \`emerge @module-rebuild\`. Alternatively, +if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), +this can be automated by setting USE=dist-kernel globally. + +Loaded kernel modules also must not mismatch with the installed +${PN} version (excluding -r revision), meaning should +ensure \`eselect kernel list\` points to the kernel that will be +booted before building and preferably reboot after upgrading +${PN} (the ebuild will emit a warning if mismatching). + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ +$(use amd64 && usev !abi_x86_32 " + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.") + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + if use modules; then + linux-mod-r1_src_install + + insinto /etc/modprobe.d + doins "${T}"/nvidia.conf + + # used for gpu verification with binpkgs (not kept, see pkg_preinst) + insinto /usr/share/nvidia + doins supported-gpus/supported-gpus.json + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + if use tools; then + emake "${NV_ARGS[@]}" -C nvidia-settings install + + doicon nvidia-settings/doc/nvidia-settings.png + domenu nvidia-settings/doc/nvidia-settings.desktop + + exeinto /etc/X11/xinit/xinitrc.d + newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings + fi + + if use static-libs; then + dolib.a nvidia-settings/src/out/libXNVCtrl.a + + insinto /usr/include/NVCtrl + doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == EXPLICIT_PATH ]]; then + into=${m[3]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + [[ ${m[0]} =~ ^libnvidia-ngx.so|^libnvidia-egl-gbm.so ]] && + dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 # soname not in .manifest + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl others (bug #904292,#921578) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' +} + +pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + + use modules || return + + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die + + # try to find driver mismatches using temporary supported-gpus.json + for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do + g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ + "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) + if [[ ${g} ]]; then + g=$((${g##*\"}+1)) + if ver_test -ge ${g}; then + NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" + break + fi + fi + done + rm "${ED}"/usr/share/nvidia/supported-gpus.json || die +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + + readme.gentoo_print_elog + + if [[ -r /proc/driver/nvidia/version && + $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then + ewarn "Currently loaded NVIDIA modules do not match the newly installed" + ewarn "libraries and may prevent launching GPU-accelerated applications." + if use modules; then + ewarn "Easiest way to fix this is normally to reboot. If still run into issues" + ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify" + ewarn "that the running kernel is ${KV_FULL} and that (if used) the" + ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)." + fi + fi + + if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then + ewarn "Detected that the current kernel command line is using 'slub_debug='," + ewarn "this may lead to system instability/freezes with this version of" + ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" + fi + + if [[ -v NV_LEGACY_MASK ]]; then + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" + ewarn "with a GPU of the current system. If unwanted, add the mask:" + if [[ -d ${EROOT}/etc/portage/package.mask ]]; then + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + else + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + fi + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "are available or fully functional, may need to consider nouveau[2])." + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" + fi + + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" + ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." + ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 555 + then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03.ebuild new file mode 100644 index 000000000000..83c8e437879b --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03.ebuild @@ -0,0 +1,513 @@ +# Copyright 2023-2024 Liguros Authors +# Distributed under the terms of the GNU General Public License v2 +EAPI=8 + +MODULES_OPTIONAL_IUSE=+modules +inherit desktop flag-o-matic linux-mod-r1 readme.gentoo-r1 systemd toolchain-funcs unpacker user-info + +MODULES_KERNEL_MAX=6.10 +NV_URI="https://download.nvidia.com/XFree86/" + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://www.nvidia.com/download/index.aspx" +SRC_URI=" + amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) + arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run ) + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) + ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz +" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S=${WORKDIR} + +LICENSE="NVIDIA-r2 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +SLOT="0/${PV%%.*}" +KEYWORDS="-* ~amd64 ~arm64" +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" + +COMMON_DEPEND=" + acct-group/video + X? ( x11-libs/libpciaccess ) + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) + tools? ( + >=app-accessibility/at-spi2-core-2.46:2 + dev-libs/glib:2 + dev-libs/jansson:= + media-libs/harfbuzz:= + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/gtk+:3[X] + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXxf86vm + x11-libs/pango + ) +" +RDEPEND=" + ${COMMON_DEPEND} + dev-libs/openssl:0/3 + + sys-libs/glibc + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) + powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) + wayland? ( + gui-libs/egl-wayland[abi_x86_32(-)?] + media-libs/mesa[gbm(+),abi_x86_32(-)?] + x11-libs/libdrm[abi_x86_32(-)?] + !gui-libs/egl-gbm + ) +" +DEPEND=" + ${COMMON_DEPEND} + static-libs? ( + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + ) + tools? ( + dev-util/vulkan-headers + media-libs/libglvnd + sys-apps/dbus + x11-base/xorg-proto + x11-libs/libXrandr + x11-libs/libXv + x11-libs/libvdpau + ) +" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig +" + +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" + +PATCHES=( + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!SLUB_DEBUG_ON + !DEBUG_MUTEXES + $(usev powerd '~CPU_FREQ') + " + + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_I915=y, DRM_NOUVEAU=m also acceptable if a module and not built-in." + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." + + linux-mod-r1_pkg_setup +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-settings && mv nvidia-settings{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + + # adjust service files + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die + sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-555.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + + # makefile attempts to install wayland library even if not built + use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ + nvidia-settings/src/Makefile || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + BUILD_GTK2LIB= + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + WAYLAND_AVAILABLE=$(usex wayland 1 0) + XNVCTRL_CFLAGS="${xnvflags}" + ) + + if use modules; then + local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open + + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + fi + + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) + local modargs=( + IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 + SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" + ) + + # temporary workaround for bug #914468 + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}" + + linux-mod-r1_src_compile + CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig + + if use tools; then + # avoid noisy *very* noisy logs with deprecation warnings + CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ + emake "${NV_ARGS[@]}" -C nvidia-settings + elif use static-libs; then + # pretend GTK+3 is available, not actually used (bug #880879) + emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ + -C nvidia-settings/src out/libXNVCtrl.a + fi +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [OPENGL_DATA]=/usr/share/nvidia + [VULKAN_ICD_JSON]=/usr/share/vulkan + [VULKANSC_ICD_JSON]=/usr/share/vulkansc + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia") + $(usev !wayland "libnvidia-egl-gbm 15_nvidia_gbm") + libGLX_indirect # non-glvnd unused fallback + libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + libnvidia-pkcs11.so # using the openssl3 version instead + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !modules gsp) + $(usev !powerd powerd) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ +$(usev modules " + +Like all out-of-tree kernel modules, it is necessary to rebuild +${PN} after upgrading or rebuilding the Linux kernel +by for example running \`emerge @module-rebuild\`. Alternatively, +if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), +this can be automated by setting USE=dist-kernel globally. + +Loaded kernel modules also must not mismatch with the installed +${PN} version (excluding -r revision), meaning should +ensure \`eselect kernel list\` points to the kernel that will be +booted before building and preferably reboot after upgrading +${PN} (the ebuild will emit a warning if mismatching). + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ +$(use amd64 && usev !abi_x86_32 " + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.") + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + if use modules; then + linux-mod-r1_src_install + + insinto /etc/modprobe.d + doins "${T}"/nvidia.conf + + # used for gpu verification with binpkgs (not kept, see pkg_preinst) + insinto /usr/share/nvidia + doins supported-gpus/supported-gpus.json + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + if use tools; then + emake "${NV_ARGS[@]}" -C nvidia-settings install + + doicon nvidia-settings/doc/nvidia-settings.png + domenu nvidia-settings/doc/nvidia-settings.desktop + + exeinto /etc/X11/xinit/xinitrc.d + newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings + fi + + if use static-libs; then + dolib.a nvidia-settings/src/out/libXNVCtrl.a + + insinto /usr/include/NVCtrl + doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == EXPLICIT_PATH ]]; then + into=${m[3]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + # avoid portage warning due to missing soname links in manifest + [[ ${m[0]} =~ .*((libnvidia-ngx.so|libnvidia-egl-gbm.so).*) ]] && + dosym ${BASH_REMATCH[1]} ${into}/${BASH_REMATCH[2]}.1 + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl others (bug #904292,#921578) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' +} + +pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + + use modules || return + + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die + + # try to find driver mismatches using temporary supported-gpus.json + for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do + g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ + "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) + if [[ ${g} ]]; then + g=$((${g##*\"}+1)) + if ver_test -ge ${g}; then + NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" + break + fi + fi + done + rm "${ED}"/usr/share/nvidia/supported-gpus.json || die +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + + readme.gentoo_print_elog + + if [[ -r /proc/driver/nvidia/version && + $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then + ewarn "Currently loaded NVIDIA modules do not match the newly installed" + ewarn "libraries and may prevent launching GPU-accelerated applications." + if use modules; then + ewarn "Easiest way to fix this is normally to reboot. If still run into issues" + ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify" + ewarn "that the running kernel is ${KV_FULL} and that (if used) the" + ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)." + fi + fi + + if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then + ewarn "Detected that the current kernel command line is using 'slub_debug='," + ewarn "this may lead to system instability/freezes with this version of" + ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" + fi + + if [[ -v NV_LEGACY_MASK ]]; then + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" + ewarn "with a GPU of the current system. If unwanted, add the mask:" + if [[ -d ${EROOT}/etc/portage/package.mask ]]; then + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + else + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + fi + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "are available or fully functional, may need to consider nouveau[2])." + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" + fi + + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" + ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." + ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 555 + then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-565.77.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-565.77.ebuild new file mode 100644 index 000000000000..eb90491325ca --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-565.77.ebuild @@ -0,0 +1,629 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE=+modules +inherit desktop flag-o-matic linux-mod-r1 readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info + +MODULES_KERNEL_MAX=6.12 +NV_URI="https://download.nvidia.com/XFree86/" + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://www.nvidia.com/" +SRC_URI=" + amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) + arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run ) + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) + ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz +" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S=${WORKDIR} + +LICENSE="NVIDIA-r2 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +SLOT="0/${PV%%.*}" +KEYWORDS="-* ~amd64 ~arm64" +# note: kernel-open is an upstream default in >=560 if all GPUs on the system +# support it but, since no automagic here, keeping it off for the wider support +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" + +COMMON_DEPEND=" + acct-group/video + X? ( x11-libs/libpciaccess ) + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) + tools? ( + >=app-accessibility/at-spi2-core-2.46:2 + dev-libs/glib:2 + dev-libs/jansson:= + media-libs/harfbuzz:= + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/gtk+:3[X] + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXxf86vm + x11-libs/pango + ) +" +RDEPEND=" + ${COMMON_DEPEND} + dev-libs/openssl:0/3 + + sys-libs/glibc + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) + powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) + wayland? ( + >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?] + >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?] + X? ( gui-libs/egl-x11[abi_x86_32(-)?] ) + ) +" +DEPEND=" + ${COMMON_DEPEND} + static-libs? ( + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + ) + tools? ( + dev-util/vulkan-headers + media-libs/libglvnd + sys-apps/dbus + x11-base/xorg-proto + x11-libs/libXrandr + x11-libs/libXv + x11-libs/libvdpau + ) +" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig +" + +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" + +PATCHES=( + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK + get_version + require_configured_kernel + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!PREEMPT_RT + ~!SLUB_DEBUG_ON + !DEBUG_MUTEXES + $(usev powerd '~CPU_FREQ') + " + + kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && + CONFIG_CHECK+=" DRM_TTM_HELPER" + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + + local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_QXL=m, DRM_NOUVEAU=m also acceptable if a module and *not* built-in." + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. + ${drm_helper_msg}" + local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using + kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. + ${drm_helper_msg} + Many DRM devices like DRM_I915 cannot currently be used to enable this." + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." + local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and + will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is + set. Please do not report issues if run into e.g. kernel panics while + ignoring this." + + linux-mod-r1_pkg_setup +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-settings && mv nvidia-settings{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + + # adjust service files + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die + sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-555.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + + # makefile attempts to install wayland library even if not built + use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ + nvidia-settings/src/Makefile || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + BUILD_GTK2LIB= + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + WAYLAND_AVAILABLE=$(usex wayland 1 0) + XNVCTRL_CFLAGS="${xnvflags}" + ) + + if use modules; then + local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open + + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + + LDFLAGS=$(raw-ldflags) + fi + + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) + local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround + IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 + SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" + + # kernel takes "x86" and "x86_64" as meaning the same, but nvidia + # makes the distinction (since 550.135) and is not happy with "x86" + # TODO?: it should be ok/better for tc-arch-kernel to do x86_64 + $(usev amd64 ARCH=x86_64) + ) + + # temporary workaround for bug #914468 + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}" + + linux-mod-r1_src_compile + CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig + + if use tools; then + # avoid noisy *very* noisy logs with deprecation warnings + CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ + emake "${NV_ARGS[@]}" -C nvidia-settings + elif use static-libs; then + # pretend GTK+3 is available, not actually used (bug #880879) + emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ + -C nvidia-settings/src out/libXNVCtrl.a + fi +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [OPENGL_DATA]=/usr/share/nvidia + [VULKAN_ICD_JSON]=/usr/share/vulkan + [VULKANSC_ICD_JSON]=/usr/share/vulkansc + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia") + libGLX_indirect # non-glvnd unused fallback + libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source + libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11 + libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11 + libnvidia-pkcs11.so # using the openssl3 version instead + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !modules gsp) + $(usev !powerd powerd) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ +$(usev modules " + +Like all out-of-tree kernel modules, it is necessary to rebuild +${PN} after upgrading or rebuilding the Linux kernel +by for example running \`emerge @module-rebuild\`. Alternatively, +if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), +this can be automated by setting USE=dist-kernel globally. + +Loaded kernel modules also must not mismatch with the installed +${PN} version (excluding -r revision), meaning should +ensure \`eselect kernel list\` points to the kernel that will be +booted before building and preferably reboot after upgrading +${PN} (the ebuild will emit a warning if mismatching). + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ +$(use amd64 && usev !abi_x86_32 " + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.") + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + if use modules; then + linux-mod-r1_src_install + + insinto /etc/modprobe.d + doins "${T}"/nvidia.conf + + # used for gpu verification with binpkgs (not kept, see pkg_preinst) + insinto /usr/share/nvidia + doins supported-gpus/supported-gpus.json + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + if use tools; then + emake "${NV_ARGS[@]}" -C nvidia-settings install + + doicon nvidia-settings/doc/nvidia-settings.png + domenu nvidia-settings/doc/nvidia-settings.desktop + + exeinto /etc/X11/xinit/xinitrc.d + newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings + fi + + if use static-libs; then + dolib.a nvidia-settings/src/out/libXNVCtrl.a + + insinto /usr/include/NVCtrl + doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == EXPLICIT_PATH ]]; then + into=${m[3]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + # avoid portage warning due to missing soname links in manifest + [[ ${m[0]} =~ ^libnvidia-ngx.so ]] && + dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # enabling is needed for sleep to work properly and little reason not to do + # it unconditionally for a better user experience + : "$(systemd_get_systemunitdir)" + local unitdir=${_#"${EPREFIX}"} + # not using relative symlinks to match systemd's own links + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service + # also add a custom elogind hook to do the equivalent of the above + exeinto /usr/lib/elogind/system-sleep + newexe "${FILESDIR}"/system-sleep.elogind nvidia + # <elogind-255.5 used a different path (bug #939216), keep a compat symlink + # TODO: cleanup after 255.5 been stable for a few months + dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' + + # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure + # our settings are used for bug 932781#c8 and nouveau blacklist if either + # modules are included (however, just best-effort without initramfs regen) + if use modules; then + echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ + "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die + fi +} + +pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + + use modules || return + + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die + + # try to find driver mismatches using temporary supported-gpus.json + # TODO?: automatically check "kernelopen" bit for USE=kernel-open compat + for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do + g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ + "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) + if [[ ${g} ]]; then + g=$((${g##*\"}+1)) + if ver_test -ge ${g}; then + NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" + break + fi + fi + done + rm "${ED}"/usr/share/nvidia/supported-gpus.json || die +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + + readme.gentoo_print_elog + + if [[ -r /proc/driver/nvidia/version && + $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then + ewarn "Currently loaded NVIDIA modules do not match the newly installed" + ewarn "libraries and may prevent launching GPU-accelerated applications." + if use modules; then + ewarn "Easiest way to fix this is normally to reboot. If still run into issues" + ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify" + ewarn "that the running kernel is ${KV_FULL} and that (if used) the" + ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)." + fi + fi + + if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then + ewarn "Detected that the current kernel command line is using 'slub_debug='," + ewarn "this may lead to system instability/freezes with this version of" + ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" + fi + + if [[ -v NV_LEGACY_MASK ]]; then + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" + ewarn "with a GPU of the current system. If unwanted, add the mask:" + if [[ -d ${EROOT}/etc/portage/package.mask ]]; then + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + else + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + fi + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "are available or fully functional, may need to consider nouveau[2])." + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" + fi + + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" + ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." + ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 555 + then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." + fi + + # these can be removed after some time, only to help the transition + # given users are unlikely to do further custom solutions if it works + # (see also https://github.com/elogind/elogind/issues/272) + if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null + then + ewarn + ewarn "!!! WARNING !!!" + ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/." + ewarn "This 'could' cause issues if used in combination with the new hook" + ewarn "installed by the ebuild to handle sleep using the official upstream" + ewarn "script. It is recommended to disable the option." + fi + if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep 2>/dev/null | \ + sort | uniq | xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]] + then + ewarn + ewarn "!!! WARNING !!!" + ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep" + ewarn "referencing NVIDIA. This version of ${PN} has installed its own" + ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended" + ewarn "to remove the custom one to avoid potential issues." + ewarn + ewarn "Feel free to ignore this warning if you know the other NVIDIA-related" + ewarn "scripts can be used together. The warning will be removed in the future." + fi + if [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 560.35.03-r1 # may get repeated + then + elog + elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default" + elog "with this version of ${PN}. This is recommended (or required) by" + elog "major DEs especially with wayland but, *if* experience regressions with" + elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'." + elog + elog "May notably be an issue when using neither systemd nor elogind to suspend." + elog + elog "Also, the systemd suspend/hibernate/resume services are now enabled by" + elog "default, and for openrc+elogind a similar hook has been installed." + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-570.211.01.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-570.211.01.ebuild new file mode 100644 index 000000000000..6d3d1acb4aa9 --- /dev/null +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-570.211.01.ebuild @@ -0,0 +1,628 @@ +# Copyright 2024-2025 Liguros Authors +# Distributed under the terms of the GNU General Public License v2 +EAPI=8 + +MODULES_OPTIONAL_IUSE=+modules +inherit desktop flag-o-matic linux-mod-r1 readme.gentoo-r1 +inherit systemd toolchain-funcs unpacker user-info + +MODULES_KERNEL_MAX=6.12 +NV_URI="https://download.nvidia.com/XFree86/" + +DESCRIPTION="NVIDIA Accelerated Graphics Driver" +HOMEPAGE="https://www.nvidia.com/" +SRC_URI=" + amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) + arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run ) + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ + nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) + ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz +" +# nvidia-installer is unused but here for GPL-2's "distribute sources" +S=${WORKDIR} + +LICENSE="NVIDIA-r2 Apache-2.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl" +SLOT="0/${PV%%.*}" +KEYWORDS="-* ~amd64 ~arm64" +# note: kernel-open is an upstream default in >=560 if all GPUs on the system +# support it but, since no automagic here, keeping it off for the wider support +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" + +COMMON_DEPEND=" + acct-group/video + X? ( x11-libs/libpciaccess ) + persistenced? ( + acct-user/nvpd + net-libs/libtirpc:= + ) + tools? ( + >=app-accessibility/at-spi2-core-2.46:2 + dev-libs/glib:2 + dev-libs/jansson:= + media-libs/harfbuzz:= + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/gtk+:3[X] + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXxf86vm + x11-libs/pango + ) +" +RDEPEND=" + ${COMMON_DEPEND} + dev-libs/openssl:0/3 + + sys-libs/glibc + X? ( + media-libs/libglvnd[X,abi_x86_32(-)?] + x11-libs/libX11[abi_x86_32(-)?] + x11-libs/libXext[abi_x86_32(-)?] + ) + powerd? ( sys-apps/dbus[abi_x86_32(-)?] ) + wayland? ( + >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?] + >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?] + X? ( gui-libs/egl-x11[abi_x86_32(-)?] ) + ) +" +DEPEND=" + ${COMMON_DEPEND} + static-libs? ( + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + ) + tools? ( + dev-util/vulkan-headers + media-libs/libglvnd + sys-apps/dbus + x11-base/xorg-proto + x11-libs/libXrandr + x11-libs/libXv + x11-libs/libvdpau + ) +" +BDEPEND=" + sys-devel/m4 + virtual/pkgconfig +" + +QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*" + +PATCHES=( + "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch + "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch +) + +pkg_setup() { + use modules && [[ ${MERGE_TYPE} != binary ]] || return + + # do early before linux-mod-r1 so can use chkconfig to setup CONFIG_CHECK + get_version + require_configured_kernel + + local CONFIG_CHECK=" + PROC_FS + ~DRM_KMS_HELPER + ~SYSVIPC + ~!LOCKDEP + ~!PREEMPT_RT + ~!SLUB_DEBUG_ON + !DEBUG_MUTEXES + $(usev powerd '~CPU_FREQ') + " + + kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && + CONFIG_CHECK+=" DRM_TTM_HELPER" + + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + + local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need + selection of a DRM device even if unused, e.g. CONFIG_DRM_AMDGPU=m or + DRM_QXL=m, DRM_NOUVEAU=m also acceptable if a module and *not* built-in." + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. + ${drm_helper_msg}" + local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using + kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. + ${drm_helper_msg} + Many DRM devices like DRM_I915 cannot currently be used to enable this." + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." + local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and + will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is + set. Please do not report issues if run into e.g. kernel panics while + ignoring this." + + linux-mod-r1_pkg_setup +} + +src_prepare() { + # make patches usable across versions + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-settings && mv nvidia-settings{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die + + default + + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + + # adjust service files + sed 's/__USER__/nvpd/' \ + nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ + > "${T}"/nvidia-persistenced.service || die + sed -i "s|/usr|${EPREFIX}/opt|" systemd/system/nvidia-powerd.service || die + + # use alternative vulkan icd option if USE=-X (bug #909181) + use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-555.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + + # makefile attempts to install wayland library even if not built + use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ + nvidia-settings/src/Makefile || die +} + +src_compile() { + tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG + + local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects + tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" + + NV_ARGS=( + PREFIX="${EPREFIX}"/usr + HOST_CC="$(tc-getBUILD_CC)" + HOST_LD="$(tc-getBUILD_LD)" + BUILD_GTK2LIB= + NV_USE_BUNDLED_LIBJANSSON=0 + NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out + WAYLAND_AVAILABLE=$(usex wayland 1 0) + XNVCTRL_CFLAGS="${xnvflags}" + ) + + if use modules; then + local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open + + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + + LDFLAGS=$(raw-ldflags) + fi + + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) + local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround + IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 + SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" + + # kernel takes "x86" and "x86_64" as meaning the same, but nvidia + # makes the distinction (since 550.135) and is not happy with "x86" + # TODO?: it should be ok/better for tc-arch-kernel to do x86_64 + $(usev amd64 ARCH=x86_64) + ) + + # temporary workaround for bug #914468 + CPP="${KERNEL_CC} -E" tc-is-clang && addpredict "${KV_OUT_DIR}" + + linux-mod-r1_src_compile + CFLAGS=${o_cflags} CXXFLAGS=${o_cxxflags} LDFLAGS=${o_ldflags} + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe + use persistenced && emake "${NV_ARGS[@]}" -C nvidia-persistenced + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig + + if use tools; then + # avoid noisy *very* noisy logs with deprecation warnings + CFLAGS="-Wno-deprecated-declarations ${CFLAGS}" \ + emake "${NV_ARGS[@]}" -C nvidia-settings + elif use static-libs; then + # pretend GTK+3 is available, not actually used (bug #880879) + emake "${NV_ARGS[@]}" BUILD_GTK3LIB=1 \ + -C nvidia-settings/src out/libXNVCtrl.a + fi +} + +src_install() { + local libdir=$(get_libdir) libdir32=$(ABI=x86 get_libdir) + + NV_ARGS+=( DESTDIR="${D}" LIBDIR="${ED}"/usr/${libdir} ) + + local -A paths=( + [APPLICATION_PROFILE]=/usr/share/nvidia + [CUDA_ICD]=/etc/OpenCL/vendors + [EGL_EXTERNAL_PLATFORM_JSON]=/usr/share/egl/egl_external_platform.d + [FIRMWARE]=/lib/firmware/nvidia/${PV} + [GBM_BACKEND_LIB_SYMLINK]=/usr/${libdir}/gbm + [GLVND_EGL_ICD_JSON]=/usr/share/glvnd/egl_vendor.d + [OPENGL_DATA]=/usr/share/nvidia + [VULKAN_ICD_JSON]=/usr/share/vulkan + [VULKANSC_ICD_JSON]=/usr/share/vulkansc + [WINE_LIB]=/usr/${libdir}/nvidia/wine + [XORG_OUTPUTCLASS_CONFIG]=/usr/share/X11/xorg.conf.d + + [GLX_MODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules/extensions + [GLX_MODULE_SYMLINK]=/usr/${libdir}/xorg/modules + [XMODULE_SHARED_LIB]=/usr/${libdir}/xorg/modules + ) + + local skip_files=( + $(usev !X "libGLX_nvidia libglxserver_nvidia") + libGLX_indirect # non-glvnd unused fallback + libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source + libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm + libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland + libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11 + libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11 + libnvidia-pkcs11.so # using the openssl3 version instead + ) + local skip_modules=( + $(usev !X "nvfbc vdpau xdriver") + $(usev !modules gsp) + $(usev !powerd powerd) + installer nvpd # handled separately / built from source + ) + local skip_types=( + GLVND_LIB GLVND_SYMLINK EGL_CLIENT.\* GLX_CLIENT.\* # media-libs/libglvnd + OPENCL_WRAPPER.\* # virtual/opencl + DOCUMENTATION DOT_DESKTOP .\*_SRC DKMS_CONF SYSTEMD_UNIT # handled separately / unused + ) + + local DOCS=( + README.txt NVIDIA_Changelog supported-gpus/supported-gpus.json + nvidia-settings/doc/{FRAMELOCK,NV-CONTROL-API}.txt + ) + local HTML_DOCS=( html/. ) + einstalldocs + + local DISABLE_AUTOFORMATTING=yes + local DOC_CONTENTS="\ +Trusted users should be in the 'video' group to use NVIDIA devices. +You can add yourself by using: gpasswd -a my-user video\ +$(usev modules " + +Like all out-of-tree kernel modules, it is necessary to rebuild +${PN} after upgrading or rebuilding the Linux kernel +by for example running \`emerge @module-rebuild\`. Alternatively, +if using a distribution kernel (sys-kernel/gentoo-kernel{,-bin}), +this can be automated by setting USE=dist-kernel globally. + +Loaded kernel modules also must not mismatch with the installed +${PN} version (excluding -r revision), meaning should +ensure \`eselect kernel list\` points to the kernel that will be +booted before building and preferably reboot after upgrading +${PN} (the ebuild will emit a warning if mismatching). + +See '${EPREFIX}/etc/modprobe.d/nvidia.conf' for modules options.")\ +$(use amd64 && usev !abi_x86_32 " + +Note that without USE=abi_x86_32 on ${PN}, 32bit applications +(typically using wine / steam) will not be able to use GPU acceleration.") + +For additional information or for troubleshooting issues, please see +https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own +documentation that is installed alongside this README." + readme.gentoo_create_doc + + if use modules; then + linux-mod-r1_src_install + + insinto /etc/modprobe.d + doins "${T}"/nvidia.conf + + # used for gpu verification with binpkgs (not kept, see pkg_preinst) + insinto /usr/share/nvidia + doins supported-gpus/supported-gpus.json + fi + + emake "${NV_ARGS[@]}" -C nvidia-modprobe install + fowners :video /usr/bin/nvidia-modprobe #505092 + fperms 4710 /usr/bin/nvidia-modprobe + + if use persistenced; then + emake "${NV_ARGS[@]}" -C nvidia-persistenced install + newconfd "${FILESDIR}"/nvidia-persistenced.confd nvidia-persistenced + newinitd "${FILESDIR}"/nvidia-persistenced.initd nvidia-persistenced + systemd_dounit "${T}"/nvidia-persistenced.service + fi + + if use tools; then + emake "${NV_ARGS[@]}" -C nvidia-settings install + + doicon nvidia-settings/doc/nvidia-settings.png + domenu nvidia-settings/doc/nvidia-settings.desktop + + exeinto /etc/X11/xinit/xinitrc.d + newexe "${FILESDIR}"/95-nvidia-settings-r1 95-nvidia-settings + fi + + if use static-libs; then + dolib.a nvidia-settings/src/out/libXNVCtrl.a + + insinto /usr/include/NVCtrl + doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h + fi + + use X && emake "${NV_ARGS[@]}" -C nvidia-xconfig install + + # mimic nvidia-installer by reading .manifest to install files + # 0:file 1:perms 2:type 3+:subtype/arguments -:module + local m into + while IFS=' ' read -ra m; do + ! [[ ${#m[@]} -ge 2 && ${m[-1]} =~ MODULE: ]] || + [[ " ${m[0]##*/}" =~ ^(\ ${skip_files[*]/%/.*|\\} )$ ]] || + [[ " ${m[2]}" =~ ^(\ ${skip_types[*]/%/|\\} )$ ]] || + has ${m[-1]#MODULE:} "${skip_modules[@]}" && continue + + case ${m[2]} in + MANPAGE) + gzip -dc ${m[0]} | newman - ${m[0]%.gz}; assert + continue + ;; + GBM_BACKEND_LIB_SYMLINK) m[4]=../${m[4]};; # missing ../ + VDPAU_SYMLINK) m[4]=vdpau/; m[5]=${m[5]#vdpau/};; # .so to vdpau/ + esac + + if [[ -v 'paths[${m[2]}]' ]]; then + into=${paths[${m[2]}]} + elif [[ ${m[2]} == EXPLICIT_PATH ]]; then + into=${m[3]} + elif [[ ${m[2]} == *_BINARY ]]; then + into=/opt/bin + elif [[ ${m[3]} == COMPAT32 ]]; then + use abi_x86_32 || continue + into=/usr/${libdir32} + elif [[ ${m[2]} == *_@(LIB|SYMLINK) ]]; then + into=/usr/${libdir} + else + die "No known installation path for ${m[0]}" + fi + [[ ${m[3]: -2} == ?/ ]] && into+=/${m[3]%/} + [[ ${m[4]: -2} == ?/ ]] && into+=/${m[4]%/} + + if [[ ${m[2]} =~ _SYMLINK$ ]]; then + [[ ${m[4]: -1} == / ]] && m[4]=${m[5]} + dosym ${m[4]} ${into}/${m[0]} + continue + fi + # avoid portage warning due to missing soname links in manifest + [[ ${m[0]} =~ ^libnvidia-ngx.so ]] && + dosym ${m[0]} ${into}/${m[0]%.so*}.so.1 + + printf -v m[1] %o $((m[1] | 0200)) # 444->644 + insopts -m${m[1]} + insinto ${into} + doins ${m[0]} + done < .manifest || die + insopts -m0644 # reset + + # MODULE:installer non-skipped extras + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service + + dobin nvidia-bug-report.sh + + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # enabling is needed for sleep to work properly and little reason not to do + # it unconditionally for a better user experience + : "$(systemd_get_systemunitdir)" + local unitdir=${_#"${EPREFIX}"} + # not using relative symlinks to match systemd's own links + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service + # also add a custom elogind hook to do the equivalent of the above + exeinto /usr/lib/elogind/system-sleep + newexe "${FILESDIR}"/system-sleep.elogind nvidia + # <elogind-255.5 used a different path (bug #939216), keep a compat symlink + # TODO: cleanup after 255.5 been stable for a few months + dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + insinto "${unitdir}"/systemd-homed.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false + EOF + insinto "${unitdir}"/systemd-suspend.service.d + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF + dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf + dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf + + # symlink non-versioned so nvidia-settings can use it even if misdetected + dosym nvidia-application-profiles-${PV}-key-documentation \ + ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation + + # don't attempt to strip firmware files (silences errors) + dostrip -x ${paths[FIRMWARE]} + + # sandbox issues with /dev/nvidiactl and others (bug #904292,#921578) + # are widespread and sometime affect revdeps of packages built with + # USE=opencl/cuda making it hard to manage in ebuilds (minimal set, + # ebuilds should handle manually if need others or addwrite) + insinto /etc/sandbox.d + newins - 20nvidia <<<'SANDBOX_PREDICT="/dev/nvidiactl:/dev/nvidia-caps:/dev/char"' + + # dracut does not use /etc/modprobe.d if hostonly=no, but want to make sure + # our settings are used for bug 932781#c8 and nouveau blacklist if either + # modules are included (however, just best-effort without initramfs regen) + if use modules; then + echo "install_items+=\" ${EPREFIX}/etc/modprobe.d/nvidia.conf \"" >> \ + "${ED}"/usr/lib/dracut/dracut.conf.d/10-${PN}.conf || die + fi +} + +pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + + use modules || return + + # set video group id based on live system (bug #491414) + local g=$(egetent group video | cut -d: -f3) + [[ ${g} =~ ^[0-9]+$ ]] || die "Failed to determine video group id (got '${g}')" + sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die + + # try to find driver mismatches using temporary supported-gpus.json + # TODO?: automatically check "kernelopen" bit for USE=kernel-open compat + for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do + g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ + "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) + if [[ ${g} ]]; then + g=$((${g##*\"}+1)) + if ver_test -ge ${g}; then + NV_LEGACY_MASK=">=${CATEGORY}/${PN}-${g}" + break + fi + fi + done + rm "${ED}"/usr/share/nvidia/supported-gpus.json || die +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + + readme.gentoo_print_elog + + if [[ -r /proc/driver/nvidia/version && + $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then + ewarn "Currently loaded NVIDIA modules do not match the newly installed" + ewarn "libraries and may prevent launching GPU-accelerated applications." + if use modules; then + ewarn "Easiest way to fix this is normally to reboot. If still run into issues" + ewarn "(e.g. API mismatch messages in the \`dmesg\` output), please verify" + ewarn "that the running kernel is ${KV_FULL} and that (if used) the" + ewarn "initramfs does not include NVIDIA modules (or at least, not old ones)." + fi + fi + + if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then + ewarn "Detected that the current kernel command line is using 'slub_debug='," + ewarn "this may lead to system instability/freezes with this version of" + ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" + fi + + if [[ -v NV_LEGACY_MASK ]]; then + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" + ewarn "with a GPU of the current system. If unwanted, add the mask:" + if [[ -d ${EROOT}/etc/portage/package.mask ]]; then + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + else + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + fi + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "are available or fully functional, may need to consider nouveau[2])." + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" + fi + + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" + ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." + ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 555 + then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." + fi + + # these can be removed after some time, only to help the transition + # given users are unlikely to do further custom solutions if it works + # (see also https://github.com/elogind/elogind/issues/272) + if grep -riq "^[^#]*HandleNvidiaSleep=yes" "${EROOT}"/etc/elogind/sleep.conf.d/ 2>/dev/null + then + ewarn + ewarn "!!! WARNING !!!" + ewarn "Detected HandleNvidiaSleep=yes in ${EROOT}/etc/elogind/sleep.conf.d/." + ewarn "This 'could' cause issues if used in combination with the new hook" + ewarn "installed by the ebuild to handle sleep using the official upstream" + ewarn "script. It is recommended to disable the option." + fi + if [[ $(realpath "${EROOT}"{/etc,{/usr,}/lib*}/elogind/system-sleep 2>/dev/null | \ + sort | uniq | xargs -d'\n' grep -Ril nvidia 2>/dev/null | wc -l) -gt 2 ]] + then + ewarn + ewarn "!!! WARNING !!!" + ewarn "Detected a custom script at ${EROOT}{/etc,{/usr,}/lib*}/elogind/system-sleep" + ewarn "referencing NVIDIA. This version of ${PN} has installed its own" + ewarn "hook at ${EROOT}/usr/lib/elogind/system-sleep/nvidia and it is recommended" + ewarn "to remove the custom one to avoid potential issues." + ewarn + ewarn "Feel free to ignore this warning if you know the other NVIDIA-related" + ewarn "scripts can be used together. The warning will be removed in the future." + fi + if [[ ${REPLACING_VERSIONS##* } ]] && + ver_test ${REPLACING_VERSIONS##* } -lt 560.35.03-r1 # may get repeated + then + elog + elog "For suspend/sleep, 'NVreg_PreserveVideoMemoryAllocations=1' is now default" + elog "with this version of ${PN}. This is recommended (or required) by" + elog "major DEs especially with wayland but, *if* experience regressions with" + elog "suspend, try reverting to =0 in '${EROOT}/etc/modprobe.d/nvidia.conf'." + elog + elog "May notably be an issue when using neither systemd nor elogind to suspend." + elog + elog "Also, the systemd suspend/hibernate/resume services are now enabled by" + elog "default, and for openrc+elogind a similar hook has been installed." + fi +} diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.03-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-575.64.05.ebuild index 805a533c3ae8..e93864d17f9a 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.03-r1.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-575.64.05.ebuild @@ -1,13 +1,11 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2024-2025 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +inherit desktop eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -MODULES_KERNEL_MAX=7.0 +MODULES_KERNEL_MAX=6.14 NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" @@ -23,15 +21,16 @@ SRC_URI=" S=${WORKDIR} LICENSE=" - NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB + NVIDIA-r2 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl public-domain " SLOT="0/${PV%%.*}" -KEYWORDS="-* amd64 ~arm64" -IUSE=" - +X abi_x86_32 abi_x86_64 kernel-open persistenced powerd - +static-libs +tools wayland -" +# unkeyworded due to being a beta, feel free to opt-in +#KEYWORDS="-* ~amd64 ~arm64" +# note: kernel-open is an upstream default in >=560 if all GPUs on the system +# support it but, since no automagic here, keeping it off for the wider support +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" COMMON_DEPEND=" acct-group/video @@ -56,10 +55,8 @@ COMMON_DEPEND=" " RDEPEND=" ${COMMON_DEPEND} - || ( - dev-libs/openssl-compat:3 - dev-libs/openssl:0/3 - ) + dev-libs/openssl:0/3 + sys-libs/glibc X? ( media-libs/libglvnd[X,abi_x86_32(-)?] @@ -91,6 +88,7 @@ DEPEND=" ) " BDEPEND=" + app-alternatives/awk sys-devel/m4 virtual/pkgconfig " @@ -101,7 +99,6 @@ QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch - "${FILESDIR}"/nvidia-drivers-580.159.03-null-deref.patch ) pkg_setup() { @@ -120,33 +117,32 @@ pkg_setup() { ~!PREEMPT_RT ~!SLUB_DEBUG_ON !DEBUG_MUTEXES - $(usev amd64 'X86_PAT') $(usev powerd '~CPU_FREQ') " kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && CONFIG_CHECK+=" DRM_TTM_HELPER" + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or DRM_AMDGPU=m (among others, consult the kernel config's help), can also use DRM_NOUVEAU=m as long as built as module *not* built-in." - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for nvidia-drm.modeset=1 - support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf) which is needed for wayland - and for config-less Xorg auto-detection. + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. ${drm_helper_msg}" local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. ${drm_helper_msg}" local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for - nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may - result in a blank console/tty." + nvidia-drm.fbdev=1 support, currently off-by-default and it could + be ignored, but note that is due to change in the future." local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. Cannot be directly selected in the kernel's menuconfig, and may need - selection of another option that requires it such as CONFIG_AMD_IOMMU=y, - or DRM_I915=m (among others, consult the kernel config's help)." + selection of another option that requires it such as CONFIG_KVM." local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is set. Please do not report issues if run into e.g. kernel panics while @@ -176,6 +172,10 @@ src_prepare() { # use alternative vulkan icd option if USE=-X (bug #909181) use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-570.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + # makefile attempts to install wayland library even if not built use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ nvidia-settings/src/Makefile || die @@ -184,18 +184,10 @@ src_prepare() { src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - # extra flags for the libXNVCtrl.a static library local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - # same as uname -m - local target_arch - case ${ARCH} in - amd64) target_arch=x86_64;; - arm64) target_arch=aarch64;; - *) die "Unrecognised architecture: ${ARCH}";; - esac - NV_ARGS=( PREFIX="${EPREFIX}"/usr HOST_CC="$(tc-getBUILD_CC)" @@ -203,7 +195,6 @@ src_compile() { BUILD_GTK2LIB= NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - TARGET_ARCH="${target_arch}" WAYLAND_AVAILABLE=$(usex wayland 1 0) XNVCTRL_CFLAGS="${xnvflags}" ) @@ -211,6 +202,11 @@ src_compile() { if use modules; then local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + local modlistargs=video:kernel if use kernel-open; then modlistargs+=-module-source:kernel-module-source/kernel-open @@ -222,18 +218,13 @@ src_compile() { CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags LDFLAGS=$(raw-ldflags) - - # the "blob" uses C++ which is an issue if there is debug symbols - # when running pahole, there is a pahole.sh wrapper that tries to - # exclude C++ but it did not seem to be enough last time tried - linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0 fi local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - TARGET_ARCH="${target_arch}" # kernel takes "x86" and "x86_64" as meaning the same, but nvidia # makes the distinction (since 550.135) and is not happy with "x86" @@ -341,7 +332,7 @@ Note that without USE=abi_x86_32 on ${PN}, 32bit applications Be warned that USE=kernel-open may need to be either enabled or disabled for certain cards to function: -- GTX 50xx (blackwell) and higher require it to be enabled +- GTX 50xx (blackwell) and higher are known to require it to be enabled - GTX 1650 and higher (pre-blackwell) should work either way - Older cards require it to be disabled @@ -354,7 +345,7 @@ documentation that is installed alongside this README." linux-mod-r1_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-580.conf nvidia.conf + doins "${T}"/nvidia.conf # used for gpu verification with binpkgs (not kept, see pkg_preinst) insinto /usr/share/nvidia @@ -384,7 +375,6 @@ documentation that is installed alongside this README." if use static-libs; then dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode insinto /usr/include/NVCtrl doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h @@ -524,6 +514,7 @@ documentation that is installed alongside this README." pkg_preinst() { has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= use modules || return @@ -533,6 +524,7 @@ pkg_preinst() { sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json + # TODO?: automatically check "kernelopen" bit for USE=kernel-open compat for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) @@ -554,7 +546,7 @@ pkg_postinst() { if [[ -r /proc/driver/nvidia/version && $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" + ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." if use modules; then ewarn "Easiest way to fix this is normally to reboot. If still run into issues" @@ -565,38 +557,49 @@ pkg_postinst() { fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then - ewarn "\nDetected that the current kernel command line is using 'slub_debug='," + ewarn "Detected that the current kernel command line is using 'slub_debug='," ewarn "this may lead to system instability/freezes with this version of" ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi if [[ -v NV_LEGACY_MASK ]]; then - ewarn "\n***WARNING***" - ewarn "\nYou are installing a version of ${PN} known not to work" + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" ewarn "with a GPU of the current system. If unwanted, add the mask:" if [[ -d ${EROOT}/etc/portage/package.mask ]]; then - ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" else - ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" fi - ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" fi - if use kernel-open && use modules && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then - ewarn "\nOpen source variant of ${PN} was selected, note that it requires" + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" fi - if ver_replacing -lt 580.126.09-r1; then - elog "\n>=nvidia-drivers-580.126.09-r1 changes some defaults that may or may" - elog "not need attention:" - elog "1. nvidia-drm.modeset=1 is now default regardless of USE=wayland" - elog "2. nvidia-drm.fbdev=1 is now also tentatively default to match upstream" - elog "See ${EROOT}/etc/modprobe.d/nvidia.conf to modify settings if needed," - elog "fbdev=1 *could* cause issues for the console display with some setups." + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && ver_replacing -lt 555; then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." fi } diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-595.80.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.03.ebuild index 065d2e2af767..2c044e9a5d4f 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-595.80.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.03.ebuild @@ -1,13 +1,11 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2024-2026 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +inherit desktop eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -MODULES_KERNEL_MAX=7.0 +MODULES_KERNEL_MAX=6.18 NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" @@ -23,12 +21,16 @@ SRC_URI=" S=${WORKDIR} LICENSE=" - NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB + NVIDIA-r2 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl public-domain " SLOT="0/${PV%%.*}" -KEYWORDS="-* ~amd64 ~arm64" -IUSE="+X abi_x86_32 abi_x86_64 persistenced powerd +static-libs +tools wayland" +# unkeyworded due to being a beta, feel free to opt-in +#KEYWORDS="-* ~amd64 ~arm64" +# note: kernel-open is an upstream default in >=560 if all GPUs on the system +# support it but, since no automagic here, keeping it off for the wider support +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" COMMON_DEPEND=" acct-group/video @@ -51,15 +53,10 @@ COMMON_DEPEND=" x11-libs/pango ) " -# egl-wayland2: nvidia currently ships both versions so, to ensure -# everything works properly, depend on both at same time for now -# (may use one or the other depending on setup) RDEPEND=" ${COMMON_DEPEND} - || ( - dev-libs/openssl-compat:3 - dev-libs/openssl:0/3 - ) + dev-libs/openssl:0/3 + sys-libs/glibc X? ( media-libs/libglvnd[X,abi_x86_32(-)?] @@ -70,7 +67,6 @@ RDEPEND=" wayland? ( >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?] >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?] - gui-libs/egl-wayland2[abi_x86_32(-)?] X? ( gui-libs/egl-x11[abi_x86_32(-)?] ) ) " @@ -92,6 +88,7 @@ DEPEND=" ) " BDEPEND=" + app-alternatives/awk sys-devel/m4 virtual/pkgconfig " @@ -120,26 +117,32 @@ pkg_setup() { ~!PREEMPT_RT ~!SLUB_DEBUG_ON !DEBUG_MUTEXES - $(usev amd64 'X86_PAT') $(usev powerd '~CPU_FREQ') " kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && CONFIG_CHECK+=" DRM_TTM_HELPER" + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or DRM_AMDGPU=m (among others, consult the kernel config's help), can also use DRM_NOUVEAU=m as long as built as module *not* built-in." - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for wayland support, - tty takeover (e.g. for simpledrm), and config-less Xorg auto-detection. + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. ${drm_helper_msg}" local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. ${drm_helper_msg}" local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for - nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may - result in a blank console/tty." + nvidia-drm.fbdev=1 support, currently off-by-default and it could + be ignored, but note that is due to change in the future." + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is set. Please do not report issues if run into e.g. kernel panics while @@ -158,6 +161,10 @@ src_prepare() { default + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + sed 's/__USER__/nvpd/' \ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ > "${T}"/nvidia-persistenced.service || die @@ -165,6 +172,10 @@ src_prepare() { # use alternative vulkan icd option if USE=-X (bug #909181) use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-570.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + # makefile attempts to install wayland library even if not built use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ nvidia-settings/src/Makefile || die @@ -173,18 +184,10 @@ src_prepare() { src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - # extra flags for the libXNVCtrl.a static library local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - # same as uname -m - local target_arch - case ${ARCH} in - amd64) target_arch=x86_64;; - arm64) target_arch=aarch64;; - *) die "Unrecognised architecture: ${ARCH}";; - esac - NV_ARGS=( PREFIX="${EPREFIX}"/usr HOST_CC="$(tc-getBUILD_CC)" @@ -192,7 +195,6 @@ src_compile() { BUILD_GTK2LIB= NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - TARGET_ARCH="${target_arch}" WAYLAND_AVAILABLE=$(usex wayland 1 0) XNVCTRL_CFLAGS="${xnvflags}" ) @@ -200,24 +202,29 @@ src_compile() { if use modules; then local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} - # environment flags are normally unused for modules, but nvidia uses - # them for building the formerly closed "blob" and it is a bit fragile - filter-flags -fno-plt #912949 - filter-lto - CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags - LDFLAGS=$(raw-ldflags) + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open - # the "blob" uses C++ which is an issue if there is debug symbols - # when running pahole, there is a pahole.sh wrapper that tries to - # exclude C++ but it did not seem to be enough last time tried - linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0 + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + + LDFLAGS=$(raw-ldflags) + fi - : video:kernel-module-source:kernel-module-source/kernel-open - local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${_} ) + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - TARGET_ARCH="${target_arch}" # kernel takes "x86" and "x86_64" as meaning the same, but nvidia # makes the distinction (since 550.135) and is not happy with "x86" @@ -276,7 +283,6 @@ src_install() { libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - libnvidia-egl-wayland2 09_nvidia_wayland2 # gui-libs/egl-wayland2 libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11 libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11 libnvidia-pkcs11.so # using the openssl3 version instead @@ -324,6 +330,12 @@ $(use amd64 && usev !abi_x86_32 " Note that without USE=abi_x86_32 on ${PN}, 32bit applications (typically using wine / steam) will not be able to use GPU acceleration.") +Be warned that USE=kernel-open may need to be either enabled or +disabled for certain cards to function: +- GTX 50xx (blackwell) and higher are known to require it to be enabled +- GTX 1650 and higher (pre-blackwell) should work either way +- Older cards require it to be disabled + For additional information or for troubleshooting issues, please see https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own documentation that is installed alongside this README." @@ -333,7 +345,7 @@ documentation that is installed alongside this README." linux-mod-r1_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-595.conf nvidia.conf + doins "${T}"/nvidia.conf # used for gpu verification with binpkgs (not kept, see pkg_preinst) insinto /usr/share/nvidia @@ -363,7 +375,6 @@ documentation that is installed alongside this README." if use static-libs; then dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode insinto /usr/include/NVCtrl doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h @@ -424,36 +435,60 @@ documentation that is installed alongside this README." insopts -m0644 # reset # MODULE:installer non-skipped extras - # (sleep services skipped, obsoleted by NVreg_UseKernelSuspendNotifiers=1) + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend,suspend-then-hibernate}.service + dobin nvidia-bug-report.sh insinto /usr/share/nvidia/files.d doins sandboxutils-filelist.json - # needed with >=systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # enabling is needed for sleep to work properly and little reason not to do + # it unconditionally for a better user experience : "$(systemd_get_systemunitdir)" local unitdir=${_#"${EPREFIX}"} + # not using relative symlinks to match systemd's own links + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-suspend-then-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-resume.service + # also add a custom elogind hook to do the equivalent of the above + exeinto /usr/lib/elogind/system-sleep + newexe "${FILESDIR}"/system-sleep.elogind nvidia + # <elogind-255.5 used a different path (bug #939216), keep a compat symlink + # TODO: cleanup after 255.5 been stable for a few months + dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 insinto "${unitdir}"/systemd-homed.service.d newins - 10-nvidia.conf <<-EOF [Service] Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false EOF insinto "${unitdir}"/systemd-suspend.service.d - newins systemd/system/systemd-suspend.service.d/nvidia-suspend-nofreeze.conf 10-nvidia.conf + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - # MODULE:powerd extras - if use powerd; then - newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation @@ -478,6 +513,9 @@ documentation that is installed alongside this README." } pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + use modules || return # set video group id based on live system (bug #491414) @@ -486,6 +524,7 @@ pkg_preinst() { sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json + # TODO?: automatically check "kernelopen" bit for USE=kernel-open compat for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) @@ -507,7 +546,7 @@ pkg_postinst() { if [[ -r /proc/driver/nvidia/version && $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" + ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." if use modules; then ewarn "Easiest way to fix this is normally to reboot. If still run into issues" @@ -518,39 +557,49 @@ pkg_postinst() { fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then - ewarn "\nDetected that the current kernel command line is using 'slub_debug='," + ewarn "Detected that the current kernel command line is using 'slub_debug='," ewarn "this may lead to system instability/freezes with this version of" ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi if [[ -v NV_LEGACY_MASK ]]; then - ewarn "\n***WARNING***" - ewarn "\nYou are installing a version of ${PN} known not to work" + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" ewarn "with a GPU of the current system. If unwanted, add the mask:" if [[ -d ${EROOT}/etc/portage/package.mask ]]; then - ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" else - ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" fi - ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" fi - if ver_replacing -lt 595; then - elog "\n>=${PN}-595 has changes that may or may not need attention:" - elog "1. USE=kernel-open was removed and is now always enabled. If for some" - elog " reason you really need the closed variant (e.g. Runtime D3 on Turing" - elog " GPUs), please use LTS 580.xx instead as Gentoo has no intention to" - elog " support both variants anymore going forward" - elog "2. systemd/elogind sleep services (nvidia-sleep.sh) were tentatively" - elog " removed and replaced by setting NVreg_UseKernelSuspendNotifiers=1 in" - elog " ${EROOT}/etc/modprobe.d/nvidia.conf. If using a non-default custom" - elog " nvidia.conf, please ensure the option is set. Also, systemd users" - elog " may want to ensure that they do not have old sleep/suspend/resume" - elog " *nvidia* files in ${EROOT}/etc/systemd to avoid potential issues." - elog "3. nvidia-drm.modeset=1 was removed from nvidia.conf because it is now" - elog " default enabled regardless (new NVIDIA default)" + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" + ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." + ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && ver_replacing -lt 555; then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." fi } diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.04.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.04.ebuild index 805a533c3ae8..2c044e9a5d4f 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.04.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-580.159.04.ebuild @@ -1,13 +1,11 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2024-2026 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +inherit desktop eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -MODULES_KERNEL_MAX=7.0 +MODULES_KERNEL_MAX=6.18 NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" @@ -23,15 +21,16 @@ SRC_URI=" S=${WORKDIR} LICENSE=" - NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB + NVIDIA-r2 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl public-domain " SLOT="0/${PV%%.*}" -KEYWORDS="-* amd64 ~arm64" -IUSE=" - +X abi_x86_32 abi_x86_64 kernel-open persistenced powerd - +static-libs +tools wayland -" +# unkeyworded due to being a beta, feel free to opt-in +#KEYWORDS="-* ~amd64 ~arm64" +# note: kernel-open is an upstream default in >=560 if all GPUs on the system +# support it but, since no automagic here, keeping it off for the wider support +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" COMMON_DEPEND=" acct-group/video @@ -56,10 +55,8 @@ COMMON_DEPEND=" " RDEPEND=" ${COMMON_DEPEND} - || ( - dev-libs/openssl-compat:3 - dev-libs/openssl:0/3 - ) + dev-libs/openssl:0/3 + sys-libs/glibc X? ( media-libs/libglvnd[X,abi_x86_32(-)?] @@ -91,6 +88,7 @@ DEPEND=" ) " BDEPEND=" + app-alternatives/awk sys-devel/m4 virtual/pkgconfig " @@ -101,7 +99,6 @@ QA_PREBUILT="lib/firmware/* usr/bin/* usr/lib*" PATCHES=( "${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch "${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch - "${FILESDIR}"/nvidia-drivers-580.159.03-null-deref.patch ) pkg_setup() { @@ -120,33 +117,32 @@ pkg_setup() { ~!PREEMPT_RT ~!SLUB_DEBUG_ON !DEBUG_MUTEXES - $(usev amd64 'X86_PAT') $(usev powerd '~CPU_FREQ') " kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && CONFIG_CHECK+=" DRM_TTM_HELPER" + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or DRM_AMDGPU=m (among others, consult the kernel config's help), can also use DRM_NOUVEAU=m as long as built as module *not* built-in." - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for nvidia-drm.modeset=1 - support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf) which is needed for wayland - and for config-less Xorg auto-detection. + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. ${drm_helper_msg}" local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. ${drm_helper_msg}" local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for - nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may - result in a blank console/tty." + nvidia-drm.fbdev=1 support, currently off-by-default and it could + be ignored, but note that is due to change in the future." local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. Cannot be directly selected in the kernel's menuconfig, and may need - selection of another option that requires it such as CONFIG_AMD_IOMMU=y, - or DRM_I915=m (among others, consult the kernel config's help)." + selection of another option that requires it such as CONFIG_KVM." local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is set. Please do not report issues if run into e.g. kernel panics while @@ -176,6 +172,10 @@ src_prepare() { # use alternative vulkan icd option if USE=-X (bug #909181) use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-570.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + # makefile attempts to install wayland library even if not built use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ nvidia-settings/src/Makefile || die @@ -184,18 +184,10 @@ src_prepare() { src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - # extra flags for the libXNVCtrl.a static library local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - # same as uname -m - local target_arch - case ${ARCH} in - amd64) target_arch=x86_64;; - arm64) target_arch=aarch64;; - *) die "Unrecognised architecture: ${ARCH}";; - esac - NV_ARGS=( PREFIX="${EPREFIX}"/usr HOST_CC="$(tc-getBUILD_CC)" @@ -203,7 +195,6 @@ src_compile() { BUILD_GTK2LIB= NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - TARGET_ARCH="${target_arch}" WAYLAND_AVAILABLE=$(usex wayland 1 0) XNVCTRL_CFLAGS="${xnvflags}" ) @@ -211,6 +202,11 @@ src_compile() { if use modules; then local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + local modlistargs=video:kernel if use kernel-open; then modlistargs+=-module-source:kernel-module-source/kernel-open @@ -222,18 +218,13 @@ src_compile() { CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags LDFLAGS=$(raw-ldflags) - - # the "blob" uses C++ which is an issue if there is debug symbols - # when running pahole, there is a pahole.sh wrapper that tries to - # exclude C++ but it did not seem to be enough last time tried - linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0 fi local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - TARGET_ARCH="${target_arch}" # kernel takes "x86" and "x86_64" as meaning the same, but nvidia # makes the distinction (since 550.135) and is not happy with "x86" @@ -341,7 +332,7 @@ Note that without USE=abi_x86_32 on ${PN}, 32bit applications Be warned that USE=kernel-open may need to be either enabled or disabled for certain cards to function: -- GTX 50xx (blackwell) and higher require it to be enabled +- GTX 50xx (blackwell) and higher are known to require it to be enabled - GTX 1650 and higher (pre-blackwell) should work either way - Older cards require it to be disabled @@ -354,7 +345,7 @@ documentation that is installed alongside this README." linux-mod-r1_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-580.conf nvidia.conf + doins "${T}"/nvidia.conf # used for gpu verification with binpkgs (not kept, see pkg_preinst) insinto /usr/share/nvidia @@ -384,7 +375,6 @@ documentation that is installed alongside this README." if use static-libs; then dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode insinto /usr/include/NVCtrl doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h @@ -524,6 +514,7 @@ documentation that is installed alongside this README." pkg_preinst() { has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= use modules || return @@ -533,6 +524,7 @@ pkg_preinst() { sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json + # TODO?: automatically check "kernelopen" bit for USE=kernel-open compat for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) @@ -554,7 +546,7 @@ pkg_postinst() { if [[ -r /proc/driver/nvidia/version && $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" + ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." if use modules; then ewarn "Easiest way to fix this is normally to reboot. If still run into issues" @@ -565,38 +557,49 @@ pkg_postinst() { fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then - ewarn "\nDetected that the current kernel command line is using 'slub_debug='," + ewarn "Detected that the current kernel command line is using 'slub_debug='," ewarn "this may lead to system instability/freezes with this version of" ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi if [[ -v NV_LEGACY_MASK ]]; then - ewarn "\n***WARNING***" - ewarn "\nYou are installing a version of ${PN} known not to work" + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" ewarn "with a GPU of the current system. If unwanted, add the mask:" if [[ -d ${EROOT}/etc/portage/package.mask ]]; then - ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" else - ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" fi - ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" fi - if use kernel-open && use modules && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then - ewarn "\nOpen source variant of ${PN} was selected, note that it requires" + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" fi - if ver_replacing -lt 580.126.09-r1; then - elog "\n>=nvidia-drivers-580.126.09-r1 changes some defaults that may or may" - elog "not need attention:" - elog "1. nvidia-drm.modeset=1 is now default regardless of USE=wayland" - elog "2. nvidia-drm.fbdev=1 is now also tentatively default to match upstream" - elog "See ${EROOT}/etc/modprobe.d/nvidia.conf to modify settings if needed," - elog "fbdev=1 *could* cause issues for the console display with some setups." + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && ver_replacing -lt 555; then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." fi } diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-610.43.02-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-590.48.01.ebuild index ff8aefc2f1a6..b73c2a7ae2f2 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-610.43.02-r1.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-590.48.01.ebuild @@ -1,13 +1,11 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2024-2025 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +inherit desktop eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -MODULES_KERNEL_MAX=7.0 +MODULES_KERNEL_MAX=6.17 NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" @@ -23,12 +21,16 @@ SRC_URI=" S=${WORKDIR} LICENSE=" - NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB + NVIDIA-r2 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl public-domain " SLOT="0/${PV%%.*}" -KEYWORDS="-* ~amd64 ~arm64" -IUSE="+X abi_x86_32 abi_x86_64 persistenced powerd +static-libs +tools wayland" +# unkeyworded due to being a beta, feel free to opt-in +#KEYWORDS="-* ~amd64 ~arm64" +# note: kernel-open is an upstream default in >=560 if all GPUs on the system +# support it but, since no automagic here, keeping it off for the wider support +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" COMMON_DEPEND=" acct-group/video @@ -51,16 +53,10 @@ COMMON_DEPEND=" x11-libs/pango ) " -# egl-wayland2: nvidia currently ships both versions so, to ensure -# everything works properly, depend on both at same time for now -# (may use one or the other depending on setup) RDEPEND=" ${COMMON_DEPEND} - || ( - dev-libs/openssl-compat:3 - dev-libs/openssl:0/3 - ) - sys-devel/gcc:* + dev-libs/openssl:0/3 + sys-libs/glibc X? ( media-libs/libglvnd[X,abi_x86_32(-)?] @@ -71,7 +67,6 @@ RDEPEND=" wayland? ( >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?] >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?] - gui-libs/egl-wayland2[abi_x86_32(-)?] X? ( gui-libs/egl-x11[abi_x86_32(-)?] ) ) " @@ -93,6 +88,7 @@ DEPEND=" ) " BDEPEND=" + app-alternatives/awk sys-devel/m4 virtual/pkgconfig " @@ -121,26 +117,32 @@ pkg_setup() { ~!PREEMPT_RT ~!SLUB_DEBUG_ON !DEBUG_MUTEXES - $(usev amd64 'X86_PAT') $(usev powerd '~CPU_FREQ') " kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && CONFIG_CHECK+=" DRM_TTM_HELPER" + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or DRM_AMDGPU=m (among others, consult the kernel config's help), can also use DRM_NOUVEAU=m as long as built as module *not* built-in." - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for wayland support, - tty takeover (e.g. for simpledrm), and config-less Xorg auto-detection. + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. ${drm_helper_msg}" local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. ${drm_helper_msg}" local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for - nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may - result in a blank console/tty." + nvidia-drm.fbdev=1 support, currently off-by-default and it could + be ignored, but note that is due to change in the future." + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is set. Please do not report issues if run into e.g. kernel panics while @@ -159,6 +161,10 @@ src_prepare() { default + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + sed 's/__USER__/nvpd/' \ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ > "${T}"/nvidia-persistenced.service || die @@ -166,6 +172,10 @@ src_prepare() { # use alternative vulkan icd option if USE=-X (bug #909181) use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-570.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + # makefile attempts to install wayland library even if not built use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ nvidia-settings/src/Makefile || die @@ -174,18 +184,10 @@ src_prepare() { src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - # extra flags for the libXNVCtrl.a static library local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - # same as uname -m - local target_arch - case ${ARCH} in - amd64) target_arch=x86_64;; - arm64) target_arch=aarch64;; - *) die "Unrecognised architecture: ${ARCH}";; - esac - NV_ARGS=( PREFIX="${EPREFIX}"/usr HOST_CC="$(tc-getBUILD_CC)" @@ -193,7 +195,6 @@ src_compile() { BUILD_GTK2LIB= NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - TARGET_ARCH="${target_arch}" WAYLAND_AVAILABLE=$(usex wayland 1 0) XNVCTRL_CFLAGS="${xnvflags}" ) @@ -201,24 +202,29 @@ src_compile() { if use modules; then local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} - # environment flags are normally unused for modules, but nvidia uses - # them for building the formerly closed "blob" and it is a bit fragile - filter-flags -fno-plt #912949 - filter-lto - CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags - LDFLAGS=$(raw-ldflags) + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open - # the "blob" uses C++ which is an issue if there is debug symbols - # when running pahole, there is a pahole.sh wrapper that tries to - # exclude C++ but it did not seem to be enough last time tried - linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0 + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + + LDFLAGS=$(raw-ldflags) + fi - : video:kernel-module-source:kernel-module-source/kernel-open - local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${_} ) + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - TARGET_ARCH="${target_arch}" # kernel takes "x86" and "x86_64" as meaning the same, but nvidia # makes the distinction (since 550.135) and is not happy with "x86" @@ -277,7 +283,6 @@ src_install() { libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - libnvidia-egl-wayland2 09_nvidia_wayland2 # gui-libs/egl-wayland2 libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11 libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11 libnvidia-pkcs11.so # using the openssl3 version instead @@ -325,6 +330,12 @@ $(use amd64 && usev !abi_x86_32 " Note that without USE=abi_x86_32 on ${PN}, 32bit applications (typically using wine / steam) will not be able to use GPU acceleration.") +Be warned that USE=kernel-open may need to be either enabled or +disabled for certain cards to function: +- GTX 50xx (blackwell) and higher are known to require it to be enabled +- GTX 1650 and higher (pre-blackwell) should work either way +- Older cards require it to be disabled + For additional information or for troubleshooting issues, please see https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own documentation that is installed alongside this README." @@ -334,7 +345,7 @@ documentation that is installed alongside this README." linux-mod-r1_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-610.conf nvidia.conf + doins "${T}"/nvidia.conf # used for gpu verification with binpkgs (not kept, see pkg_preinst) insinto /usr/share/nvidia @@ -364,7 +375,6 @@ documentation that is installed alongside this README." if use static-libs; then dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode insinto /usr/include/NVCtrl doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h @@ -425,36 +435,60 @@ documentation that is installed alongside this README." insopts -m0644 # reset # MODULE:installer non-skipped extras - # (sleep services skipped, obsoleted by NVreg_UseKernelSuspendNotifiers=1) + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend,suspend-then-hibernate}.service + dobin nvidia-bug-report.sh insinto /usr/share/nvidia/files.d doins sandboxutils-filelist.json - # needed with >=systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # enabling is needed for sleep to work properly and little reason not to do + # it unconditionally for a better user experience : "$(systemd_get_systemunitdir)" local unitdir=${_#"${EPREFIX}"} + # not using relative symlinks to match systemd's own links + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-suspend-then-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-resume.service + # also add a custom elogind hook to do the equivalent of the above + exeinto /usr/lib/elogind/system-sleep + newexe "${FILESDIR}"/system-sleep.elogind nvidia + # <elogind-255.5 used a different path (bug #939216), keep a compat symlink + # TODO: cleanup after 255.5 been stable for a few months + dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 insinto "${unitdir}"/systemd-homed.service.d newins - 10-nvidia.conf <<-EOF [Service] Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false EOF insinto "${unitdir}"/systemd-suspend.service.d - newins systemd/system/systemd-suspend.service.d/nvidia-suspend-nofreeze.conf 10-nvidia.conf + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - # MODULE:powerd extras - if use powerd; then - newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation @@ -479,6 +513,9 @@ documentation that is installed alongside this README." } pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + use modules || return # set video group id based on live system (bug #491414) @@ -487,6 +524,7 @@ pkg_preinst() { sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json + # TODO?: automatically check "kernelopen" bit for USE=kernel-open compat for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) @@ -508,7 +546,7 @@ pkg_postinst() { if [[ -r /proc/driver/nvidia/version && $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" + ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." if use modules; then ewarn "Easiest way to fix this is normally to reboot. If still run into issues" @@ -519,39 +557,49 @@ pkg_postinst() { fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then - ewarn "\nDetected that the current kernel command line is using 'slub_debug='," + ewarn "Detected that the current kernel command line is using 'slub_debug='," ewarn "this may lead to system instability/freezes with this version of" ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi if [[ -v NV_LEGACY_MASK ]]; then - ewarn "\n***WARNING***" - ewarn "\nYou are installing a version of ${PN} known not to work" + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" ewarn "with a GPU of the current system. If unwanted, add the mask:" if [[ -d ${EROOT}/etc/portage/package.mask ]]; then - ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" else - ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" fi - ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" fi - if ver_replacing -lt 595; then - elog "\n>=${PN}-595 has changes that may or may not need attention:" - elog "1. USE=kernel-open was removed and is now always enabled. If for some" - elog " reason you really need the closed variant (e.g. Runtime D3 on Turing" - elog " GPUs), please use LTS 580.xx instead as Gentoo has no intention to" - elog " support both variants anymore going forward" - elog "2. systemd/elogind sleep services (nvidia-sleep.sh) were tentatively" - elog " removed and replaced by setting NVreg_UseKernelSuspendNotifiers=1 in" - elog " ${EROOT}/etc/modprobe.d/nvidia.conf. If using a non-default custom" - elog " nvidia.conf, please ensure the option is set. Also, systemd users" - elog " may want to ensure that they do not have old sleep/suspend/resume" - elog " *nvidia* files in ${EROOT}/etc/systemd to avoid potential issues." - elog "3. nvidia-drm.modeset=1 was removed from nvidia.conf because it is now" - elog " default enabled regardless (new NVIDIA default)" + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" + ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." + ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && ver_replacing -lt 555; then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." fi } diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-595.71.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-595.71.05.ebuild index 117af792bb31..2fe2255736a7 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-595.71.05.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-595.71.05.ebuild @@ -1,13 +1,11 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2024-2026 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +inherit desktop eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -MODULES_KERNEL_MAX=7.0 +MODULES_KERNEL_MAX=6.19 NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" @@ -23,12 +21,16 @@ SRC_URI=" S=${WORKDIR} LICENSE=" - NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB + NVIDIA-r2 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl public-domain " SLOT="0/${PV%%.*}" -KEYWORDS="-* amd64 ~arm64" -IUSE="+X abi_x86_32 abi_x86_64 persistenced powerd +static-libs +tools wayland" +# unkeyworded due to being a beta, feel free to opt-in +#KEYWORDS="-* ~amd64 ~arm64" +# note: kernel-open is an upstream default in >=560 if all GPUs on the system +# support it but, since no automagic here, keeping it off for the wider support +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" COMMON_DEPEND=" acct-group/video @@ -51,15 +53,10 @@ COMMON_DEPEND=" x11-libs/pango ) " -# egl-wayland2: nvidia currently ships both versions so, to ensure -# everything works properly, depend on both at same time for now -# (may use one or the other depending on setup) RDEPEND=" ${COMMON_DEPEND} - || ( - dev-libs/openssl-compat:3 - dev-libs/openssl:0/3 - ) + dev-libs/openssl:0/3 + sys-libs/glibc X? ( media-libs/libglvnd[X,abi_x86_32(-)?] @@ -70,7 +67,6 @@ RDEPEND=" wayland? ( >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?] >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?] - gui-libs/egl-wayland2[abi_x86_32(-)?] X? ( gui-libs/egl-x11[abi_x86_32(-)?] ) ) " @@ -92,6 +88,7 @@ DEPEND=" ) " BDEPEND=" + app-alternatives/awk sys-devel/m4 virtual/pkgconfig " @@ -120,26 +117,32 @@ pkg_setup() { ~!PREEMPT_RT ~!SLUB_DEBUG_ON !DEBUG_MUTEXES - $(usev amd64 'X86_PAT') $(usev powerd '~CPU_FREQ') " kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && CONFIG_CHECK+=" DRM_TTM_HELPER" + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or DRM_AMDGPU=m (among others, consult the kernel config's help), can also use DRM_NOUVEAU=m as long as built as module *not* built-in." - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for wayland support, - tty takeover (e.g. for simpledrm), and config-less Xorg auto-detection. + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. ${drm_helper_msg}" local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. ${drm_helper_msg}" local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for - nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may - result in a blank console/tty." + nvidia-drm.fbdev=1 support, currently off-by-default and it could + be ignored, but note that is due to change in the future." + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is set. Please do not report issues if run into e.g. kernel panics while @@ -158,6 +161,10 @@ src_prepare() { default + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + sed 's/__USER__/nvpd/' \ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ > "${T}"/nvidia-persistenced.service || die @@ -165,6 +172,10 @@ src_prepare() { # use alternative vulkan icd option if USE=-X (bug #909181) use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-570.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + # makefile attempts to install wayland library even if not built use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ nvidia-settings/src/Makefile || die @@ -173,18 +184,10 @@ src_prepare() { src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - # extra flags for the libXNVCtrl.a static library local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - # same as uname -m - local target_arch - case ${ARCH} in - amd64) target_arch=x86_64;; - arm64) target_arch=aarch64;; - *) die "Unrecognised architecture: ${ARCH}";; - esac - NV_ARGS=( PREFIX="${EPREFIX}"/usr HOST_CC="$(tc-getBUILD_CC)" @@ -192,7 +195,6 @@ src_compile() { BUILD_GTK2LIB= NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - TARGET_ARCH="${target_arch}" WAYLAND_AVAILABLE=$(usex wayland 1 0) XNVCTRL_CFLAGS="${xnvflags}" ) @@ -200,24 +202,29 @@ src_compile() { if use modules; then local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} - # environment flags are normally unused for modules, but nvidia uses - # them for building the formerly closed "blob" and it is a bit fragile - filter-flags -fno-plt #912949 - filter-lto - CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags - LDFLAGS=$(raw-ldflags) + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open - # the "blob" uses C++ which is an issue if there is debug symbols - # when running pahole, there is a pahole.sh wrapper that tries to - # exclude C++ but it did not seem to be enough last time tried - linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0 + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + + LDFLAGS=$(raw-ldflags) + fi - : video:kernel-module-source:kernel-module-source/kernel-open - local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${_} ) + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - TARGET_ARCH="${target_arch}" # kernel takes "x86" and "x86_64" as meaning the same, but nvidia # makes the distinction (since 550.135) and is not happy with "x86" @@ -276,7 +283,6 @@ src_install() { libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - libnvidia-egl-wayland2 09_nvidia_wayland2 # gui-libs/egl-wayland2 libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11 libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11 libnvidia-pkcs11.so # using the openssl3 version instead @@ -324,6 +330,12 @@ $(use amd64 && usev !abi_x86_32 " Note that without USE=abi_x86_32 on ${PN}, 32bit applications (typically using wine / steam) will not be able to use GPU acceleration.") +Be warned that USE=kernel-open may need to be either enabled or +disabled for certain cards to function: +- GTX 50xx (blackwell) and higher are known to require it to be enabled +- GTX 1650 and higher (pre-blackwell) should work either way +- Older cards require it to be disabled + For additional information or for troubleshooting issues, please see https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own documentation that is installed alongside this README." @@ -333,7 +345,7 @@ documentation that is installed alongside this README." linux-mod-r1_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-595.conf nvidia.conf + doins "${T}"/nvidia.conf # used for gpu verification with binpkgs (not kept, see pkg_preinst) insinto /usr/share/nvidia @@ -363,7 +375,6 @@ documentation that is installed alongside this README." if use static-libs; then dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode insinto /usr/include/NVCtrl doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h @@ -424,36 +435,60 @@ documentation that is installed alongside this README." insopts -m0644 # reset # MODULE:installer non-skipped extras - # (sleep services skipped, obsoleted by NVreg_UseKernelSuspendNotifiers=1) + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend,suspend-then-hibernate}.service + dobin nvidia-bug-report.sh insinto /usr/share/nvidia/files.d doins sandboxutils-filelist.json - # needed with >=systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # enabling is needed for sleep to work properly and little reason not to do + # it unconditionally for a better user experience : "$(systemd_get_systemunitdir)" local unitdir=${_#"${EPREFIX}"} + # not using relative symlinks to match systemd's own links + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-suspend-then-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-resume.service + # also add a custom elogind hook to do the equivalent of the above + exeinto /usr/lib/elogind/system-sleep + newexe "${FILESDIR}"/system-sleep.elogind nvidia + # <elogind-255.5 used a different path (bug #939216), keep a compat symlink + # TODO: cleanup after 255.5 been stable for a few months + dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 insinto "${unitdir}"/systemd-homed.service.d newins - 10-nvidia.conf <<-EOF [Service] Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false EOF insinto "${unitdir}"/systemd-suspend.service.d - newins systemd/system/systemd-suspend.service.d/nvidia-suspend-nofreeze.conf 10-nvidia.conf + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - # MODULE:powerd extras - if use powerd; then - newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation @@ -478,6 +513,9 @@ documentation that is installed alongside this README." } pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + use modules || return # set video group id based on live system (bug #491414) @@ -486,6 +524,7 @@ pkg_preinst() { sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json + # TODO?: automatically check "kernelopen" bit for USE=kernel-open compat for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) @@ -507,7 +546,7 @@ pkg_postinst() { if [[ -r /proc/driver/nvidia/version && $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" + ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." if use modules; then ewarn "Easiest way to fix this is normally to reboot. If still run into issues" @@ -518,39 +557,49 @@ pkg_postinst() { fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then - ewarn "\nDetected that the current kernel command line is using 'slub_debug='," + ewarn "Detected that the current kernel command line is using 'slub_debug='," ewarn "this may lead to system instability/freezes with this version of" ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi if [[ -v NV_LEGACY_MASK ]]; then - ewarn "\n***WARNING***" - ewarn "\nYou are installing a version of ${PN} known not to work" + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" ewarn "with a GPU of the current system. If unwanted, add the mask:" if [[ -d ${EROOT}/etc/portage/package.mask ]]; then - ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" else - ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" fi - ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" fi - if ver_replacing -lt 595; then - elog "\n>=${PN}-595 has changes that may or may not need attention:" - elog "1. USE=kernel-open was removed and is now always enabled. If for some" - elog " reason you really need the closed variant (e.g. Runtime D3 on Turing" - elog " GPUs), please use LTS 580.xx instead as Gentoo has no intention to" - elog " support both variants anymore going forward" - elog "2. systemd/elogind sleep services (nvidia-sleep.sh) were tentatively" - elog " removed and replaced by setting NVreg_UseKernelSuspendNotifiers=1 in" - elog " ${EROOT}/etc/modprobe.d/nvidia.conf. If using a non-default custom" - elog " nvidia.conf, please ensure the option is set. Also, systemd users" - elog " may want to ensure that they do not have old sleep/suspend/resume" - elog " *nvidia* files in ${EROOT}/etc/systemd to avoid potential issues." - elog "3. nvidia-drm.modeset=1 was removed from nvidia.conf because it is now" - elog " default enabled regardless (new NVIDIA default)" + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" + ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." + ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && ver_replacing -lt 555; then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." fi } diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-595.44.09.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-610.43.02.ebuild index 21061e333524..2fe2255736a7 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-595.44.09.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-610.43.02.ebuild @@ -1,35 +1,36 @@ -# Copyright 1999-2026 Gentoo Authors +# Copyright 2024-2026 Liguros Authors # Distributed under the terms of the GNU General Public License v2 - EAPI=8 MODULES_OPTIONAL_IUSE=+modules -inherit desktop dot-a eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 -inherit readme.gentoo-r1 systemd toolchain-funcs unpacker user-info +inherit desktop eapi9-pipestatus eapi9-ver flag-o-matic linux-mod-r1 readme.gentoo-r1 systemd toolchain-funcs unpacker user-info -MODULES_KERNEL_MAX=7.0 -NV_PIN=595.71.05 +MODULES_KERNEL_MAX=6.19 +NV_URI="https://download.nvidia.com/XFree86/" DESCRIPTION="NVIDIA Accelerated Graphics Driver" -HOMEPAGE="https://developer.nvidia.com/vulkan-driver/" +HOMEPAGE="https://www.nvidia.com/" SRC_URI=" - https://developer.nvidia.com/downloads/vulkan-beta-${PV//.}-linux - -> NVIDIA-Linux-x86_64-${PV}.run - $(printf "https://download.nvidia.com/XFree86/%s/%s-${NV_PIN}.tar.bz2 " \ + amd64? ( ${NV_URI}Linux-x86_64/${PV}/NVIDIA-Linux-x86_64-${PV}.run ) + arm64? ( ${NV_URI}Linux-aarch64/${PV}/NVIDIA-Linux-aarch64-${PV}.run ) + $(printf "${NV_URI}%s/%s-${PV}.tar.bz2 " \ nvidia-{installer,modprobe,persistenced,settings,xconfig}{,}) - https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${PV}.tar.gz - -> open-gpu-kernel-modules-${PV}.tar.gz + ${NV_URI}NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${PV}.tar.xz " # nvidia-installer is unused but here for GPL-2's "distribute sources" S=${WORKDIR} LICENSE=" - NVIDIA-2025 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB + NVIDIA-r2 Apache-2.0 Boost-1.0 BSD BSD-2 GPL-2 MIT ZLIB curl openssl public-domain " -SLOT="0/vulkan" -KEYWORDS="-* ~amd64" -IUSE="+X abi_x86_32 abi_x86_64 persistenced powerd +static-libs +tools wayland" +SLOT="0/${PV%%.*}" +# unkeyworded due to being a beta, feel free to opt-in +#KEYWORDS="-* ~amd64 ~arm64" +# note: kernel-open is an upstream default in >=560 if all GPUs on the system +# support it but, since no automagic here, keeping it off for the wider support +IUSE="+X abi_x86_32 abi_x86_64 kernel-open persistenced powerd +static-libs +tools wayland" +REQUIRED_USE="kernel-open? ( modules )" COMMON_DEPEND=" acct-group/video @@ -52,15 +53,10 @@ COMMON_DEPEND=" x11-libs/pango ) " -# egl-wayland2: nvidia currently ships both versions so, to ensure -# everything works properly, depend on both at same time for now -# (may use one or the other depending on setup) RDEPEND=" ${COMMON_DEPEND} - || ( - dev-libs/openssl-compat:3 - dev-libs/openssl:0/3 - ) + dev-libs/openssl:0/3 + sys-libs/glibc X? ( media-libs/libglvnd[X,abi_x86_32(-)?] @@ -71,7 +67,6 @@ RDEPEND=" wayland? ( >=gui-libs/egl-gbm-1.1.1-r2[abi_x86_32(-)?] >=gui-libs/egl-wayland-1.1.13.1[abi_x86_32(-)?] - gui-libs/egl-wayland2[abi_x86_32(-)?] X? ( gui-libs/egl-x11[abi_x86_32(-)?] ) ) " @@ -93,6 +88,7 @@ DEPEND=" ) " BDEPEND=" + app-alternatives/awk sys-devel/m4 virtual/pkgconfig " @@ -121,26 +117,32 @@ pkg_setup() { ~!PREEMPT_RT ~!SLUB_DEBUG_ON !DEBUG_MUTEXES - $(usev amd64 'X86_PAT') $(usev powerd '~CPU_FREQ') " kernel_is -ge 6 11 && linux_chkconfig_present DRM_FBDEV_EMULATION && CONFIG_CHECK+=" DRM_TTM_HELPER" + use amd64 && kernel_is -ge 5 8 && CONFIG_CHECK+=" X86_PAT" #817764 + + use kernel-open && CONFIG_CHECK+=" MMU_NOTIFIER" #843827 + local drm_helper_msg="Cannot be directly selected in the kernel's config menus, and may need selection of a DRM device even if unused, e.g. CONFIG_DRM_QXL=m or DRM_AMDGPU=m (among others, consult the kernel config's help), can also use DRM_NOUVEAU=m as long as built as module *not* built-in." - local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but is needed for wayland support, - tty takeover (e.g. for simpledrm), and config-less Xorg auto-detection. + local ERROR_DRM_KMS_HELPER="CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection + of drivers (no custom config), and for wayland / nvidia-drm.modeset=1. ${drm_helper_msg}" local ERROR_DRM_TTM_HELPER="CONFIG_DRM_TTM_HELPER: is not set but is needed to compile when using kernel version 6.11.x or newer while DRM_FBDEV_EMULATION is set. ${drm_helper_msg}" local ERROR_DRM_FBDEV_EMULATION="CONFIG_DRM_FBDEV_EMULATION: is not set but is needed for - nvidia-drm.fbdev=1 support (see ${EPREFIX}/etc/modprobe.d/nvidia.conf), may - result in a blank console/tty." + nvidia-drm.fbdev=1 support, currently off-by-default and it could + be ignored, but note that is due to change in the future." + local ERROR_MMU_NOTIFIER="CONFIG_MMU_NOTIFIER: is not set but needed to build with USE=kernel-open. + Cannot be directly selected in the kernel's menuconfig, and may need + selection of another option that requires it such as CONFIG_KVM." local ERROR_PREEMPT_RT="CONFIG_PREEMPT_RT: is set but is unsupported by NVIDIA upstream and will fail to build unless the env var IGNORE_PREEMPT_RT_PRESENCE=1 is set. Please do not report issues if run into e.g. kernel panics while @@ -151,14 +153,18 @@ pkg_setup() { src_prepare() { # make patches usable across versions - rm nvidia-modprobe && mv nvidia-modprobe{-${NV_PIN},} || die - rm nvidia-persistenced && mv nvidia-persistenced{-${NV_PIN},} || die - rm nvidia-settings && mv nvidia-settings{-${NV_PIN},} || die - rm nvidia-xconfig && mv nvidia-xconfig{-${NV_PIN},} || die - mv open-gpu-kernel-modules-${PV} kernel-module-source || die + rm nvidia-modprobe && mv nvidia-modprobe{-${PV},} || die + rm nvidia-persistenced && mv nvidia-persistenced{-${PV},} || die + rm nvidia-settings && mv nvidia-settings{-${PV},} || die + rm nvidia-xconfig && mv nvidia-xconfig{-${PV},} || die + mv NVIDIA-kernel-module-source-${PV} kernel-module-source || die default + # prevent detection of incomplete kernel DRM support (bug #603818) + sed 's/defined(CONFIG_DRM/defined(CONFIG_DRM_KMS_HELPER/g' \ + -i kernel{,-module-source/kernel-open}/conftest.sh || die + sed 's/__USER__/nvpd/' \ nvidia-persistenced/init/systemd/nvidia-persistenced.service.template \ > "${T}"/nvidia-persistenced.service || die @@ -166,6 +172,10 @@ src_prepare() { # use alternative vulkan icd option if USE=-X (bug #909181) use X || sed -i 's/"libGLX/"libEGL/' nvidia_{layers,icd}.json || die + # enable nvidia-drm.modeset=1 by default with USE=wayland + cp "${FILESDIR}"/nvidia-570.conf "${T}"/nvidia.conf || die + use !wayland || sed -i '/^#.*modeset=1$/s/^#//' "${T}"/nvidia.conf || die + # makefile attempts to install wayland library even if not built use wayland || sed -i 's/ WAYLAND_LIB_install$//' \ nvidia-settings/src/Makefile || die @@ -174,18 +184,10 @@ src_prepare() { src_compile() { tc-export AR CC CXX LD OBJCOPY OBJDUMP PKG_CONFIG - # extra flags for the libXNVCtrl.a static library local xnvflags=-fPIC #840389 + # lto static libraries tend to cause problems without fat objects tc-is-lto && xnvflags+=" $(test-flags-CC -ffat-lto-objects)" - # same as uname -m - local target_arch - case ${ARCH} in - amd64) target_arch=x86_64;; - arm64) target_arch=aarch64;; - *) die "Unrecognised architecture: ${ARCH}";; - esac - NV_ARGS=( PREFIX="${EPREFIX}"/usr HOST_CC="$(tc-getBUILD_CC)" @@ -193,7 +195,6 @@ src_compile() { BUILD_GTK2LIB= NV_USE_BUNDLED_LIBJANSSON=0 NV_VERBOSE=1 DO_STRIP= MANPAGE_GZIP= OUTPUTDIR=out - TARGET_ARCH="${target_arch}" WAYLAND_AVAILABLE=$(usex wayland 1 0) XNVCTRL_CFLAGS="${xnvflags}" ) @@ -201,24 +202,29 @@ src_compile() { if use modules; then local o_cflags=${CFLAGS} o_cxxflags=${CXXFLAGS} o_ldflags=${LDFLAGS} - # environment flags are normally unused for modules, but nvidia uses - # them for building the formerly closed "blob" and it is a bit fragile - filter-flags -fno-plt #912949 - filter-lto - CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags - LDFLAGS=$(raw-ldflags) + # conftest.sh is broken with c23 due to func() changing meaning, + # and then fails later due to ealier misdetections + # TODO: try without now and then + drop modargs' CC= (bug #944092) + KERNEL_CC+=" -std=gnu17" + + local modlistargs=video:kernel + if use kernel-open; then + modlistargs+=-module-source:kernel-module-source/kernel-open - # the "blob" uses C++ which is an issue if there is debug symbols - # when running pahole, there is a pahole.sh wrapper that tries to - # exclude C++ but it did not seem to be enough last time tried - linux_chkconfig_present DEBUG_INFO_BTF_MODULES && append-flags -g0 + # environment flags are normally unused for modules, but nvidia + # uses it for building the "blob" and it is a bit fragile + filter-flags -fno-plt #912949 + filter-lto + CC=${KERNEL_CC} CXX=${KERNEL_CXX} strip-unsupported-flags + + LDFLAGS=$(raw-ldflags) + fi - : video:kernel-module-source:kernel-module-source/kernel-open - local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${_} ) + local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=${modlistargs} ) local modargs=( + CC="${KERNEL_CC}" # needed for above gnu17 workaround IGNORE_CC_MISMATCH=yes NV_VERBOSE=1 SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}" - TARGET_ARCH="${target_arch}" # kernel takes "x86" and "x86_64" as meaning the same, but nvidia # makes the distinction (since 550.135) and is not happy with "x86" @@ -277,7 +283,6 @@ src_install() { libnvidia-{gtk,wayland-client} nvidia-{settings,xconfig} # from source libnvidia-egl-gbm 15_nvidia_gbm # gui-libs/egl-gbm libnvidia-egl-wayland 10_nvidia_wayland # gui-libs/egl-wayland - libnvidia-egl-wayland2 09_nvidia_wayland2 # gui-libs/egl-wayland2 libnvidia-egl-xcb 20_nvidia_xcb.json # gui-libs/egl-x11 libnvidia-egl-xlib 20_nvidia_xlib.json # gui-libs/egl-x11 libnvidia-pkcs11.so # using the openssl3 version instead @@ -325,6 +330,12 @@ $(use amd64 && usev !abi_x86_32 " Note that without USE=abi_x86_32 on ${PN}, 32bit applications (typically using wine / steam) will not be able to use GPU acceleration.") +Be warned that USE=kernel-open may need to be either enabled or +disabled for certain cards to function: +- GTX 50xx (blackwell) and higher are known to require it to be enabled +- GTX 1650 and higher (pre-blackwell) should work either way +- Older cards require it to be disabled + For additional information or for troubleshooting issues, please see https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers and NVIDIA's own documentation that is installed alongside this README." @@ -334,7 +345,7 @@ documentation that is installed alongside this README." linux-mod-r1_src_install insinto /etc/modprobe.d - newins "${FILESDIR}"/nvidia-595.conf nvidia.conf + doins "${T}"/nvidia.conf # used for gpu verification with binpkgs (not kept, see pkg_preinst) insinto /usr/share/nvidia @@ -364,7 +375,6 @@ documentation that is installed alongside this README." if use static-libs; then dolib.a nvidia-settings/src/out/libXNVCtrl.a - strip-lto-bytecode insinto /usr/include/NVCtrl doins nvidia-settings/src/libXNVCtrl/NVCtrl{Lib,}.h @@ -425,36 +435,60 @@ documentation that is installed alongside this README." insopts -m0644 # reset # MODULE:installer non-skipped extras - # (sleep services skipped, obsoleted by NVreg_UseKernelSuspendNotifiers=1) + : "$(systemd_get_sleepdir)" + exeinto "${_#"${EPREFIX}"}" + doexe systemd/system-sleep/nvidia + dobin systemd/nvidia-sleep.sh + systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend,suspend-then-hibernate}.service + dobin nvidia-bug-report.sh insinto /usr/share/nvidia/files.d doins sandboxutils-filelist.json - # needed with >=systemd-256 or may fail to resume with some setups - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 + # MODULE:powerd extras + if use powerd; then + newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 + systemd_dounit systemd/system/nvidia-powerd.service + + insinto /usr/share/dbus-1/system.d + doins nvidia-dbus.conf + fi + + # enabling is needed for sleep to work properly and little reason not to do + # it unconditionally for a better user experience : "$(systemd_get_systemunitdir)" local unitdir=${_#"${EPREFIX}"} + # not using relative symlinks to match systemd's own links + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-hibernate.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-suspend.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend.service.wants}/nvidia-resume.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-suspend-then-hibernate.service + dosym {"${unitdir}",/etc/systemd/system/systemd-suspend-then-hibernate.service.wants}/nvidia-resume.service + # also add a custom elogind hook to do the equivalent of the above + exeinto /usr/lib/elogind/system-sleep + newexe "${FILESDIR}"/system-sleep.elogind nvidia + # <elogind-255.5 used a different path (bug #939216), keep a compat symlink + # TODO: cleanup after 255.5 been stable for a few months + dosym {/usr/lib,/"${libdir}"}/elogind/system-sleep/nvidia + + # needed with >=systemd-256 or may fail to resume with some setups + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072722 insinto "${unitdir}"/systemd-homed.service.d newins - 10-nvidia.conf <<-EOF [Service] Environment=SYSTEMD_HOME_LOCK_FREEZE_SESSION=false EOF insinto "${unitdir}"/systemd-suspend.service.d - newins systemd/system/systemd-suspend.service.d/nvidia-suspend-nofreeze.conf 10-nvidia.conf + newins - 10-nvidia.conf <<-EOF + [Service] + Environment=SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false + EOF dosym -r "${unitdir}"/systemd-{suspend,hibernate}.service.d/10-nvidia.conf dosym -r "${unitdir}"/systemd-{suspend,hybrid-sleep}.service.d/10-nvidia.conf dosym -r "${unitdir}"/systemd-{suspend,suspend-then-hibernate}.service.d/10-nvidia.conf - # MODULE:powerd extras - if use powerd; then - newinitd "${FILESDIR}"/nvidia-powerd.initd nvidia-powerd #923117 - systemd_dounit systemd/system/nvidia-powerd.service - - insinto /usr/share/dbus-1/system.d - doins nvidia-dbus.conf - fi - # symlink non-versioned so nvidia-settings can use it even if misdetected dosym nvidia-application-profiles-${PV}-key-documentation \ ${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation @@ -479,6 +513,9 @@ documentation that is installed alongside this README." } pkg_preinst() { + has_version "${CATEGORY}/${PN}[kernel-open]" && NV_HAD_KERNEL_OPEN= + has_version "${CATEGORY}/${PN}[wayland]" && NV_HAD_WAYLAND= + use modules || return # set video group id based on live system (bug #491414) @@ -487,6 +524,7 @@ pkg_preinst() { sed -i "s/@VIDEOGID@/${g}/" "${ED}"/etc/modprobe.d/nvidia.conf || die # try to find driver mismatches using temporary supported-gpus.json + # TODO?: automatically check "kernelopen" bit for USE=kernel-open compat for g in $(grep -l 0x10de /sys/bus/pci/devices/*/vendor 2>/dev/null); do g=$(grep -io "\"devid\":\"$(<${g%vendor}device)\"[^}]*branch\":\"[0-9]*" \ "${ED}"/usr/share/nvidia/supported-gpus.json 2>/dev/null) @@ -508,7 +546,7 @@ pkg_postinst() { if [[ -r /proc/driver/nvidia/version && $(</proc/driver/nvidia/version) != *" ${PV} "* ]]; then - ewarn "\nCurrently loaded NVIDIA modules do not match the newly installed" + ewarn "Currently loaded NVIDIA modules do not match the newly installed" ewarn "libraries and may prevent launching GPU-accelerated applications." if use modules; then ewarn "Easiest way to fix this is normally to reboot. If still run into issues" @@ -519,39 +557,49 @@ pkg_postinst() { fi if [[ $(</proc/cmdline) == *slub_debug=[!-]* ]]; then - ewarn "\nDetected that the current kernel command line is using 'slub_debug='," + ewarn "Detected that the current kernel command line is using 'slub_debug='," ewarn "this may lead to system instability/freezes with this version of" ewarn "${PN}. Bug: https://bugs.gentoo.org/796329" fi if [[ -v NV_LEGACY_MASK ]]; then - ewarn "\n***WARNING***" - ewarn "\nYou are installing a version of ${PN} known not to work" + ewarn + ewarn "***WARNING***" + ewarn + ewarn "You are installing a version of ${PN} known not to work" ewarn "with a GPU of the current system. If unwanted, add the mask:" if [[ -d ${EROOT}/etc/portage/package.mask ]]; then - ewarn "\n echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" + ewarn " echo '${NV_LEGACY_MASK}' > ${EROOT}/etc/portage/package.mask/${PN}" else - ewarn "\n echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" + ewarn " echo '${NV_LEGACY_MASK}' >> ${EROOT}/etc/portage/package.mask" fi - ewarn "\n...then downgrade to a legacy[1] branch if possible (not all old versions" + ewarn "...then downgrade to a legacy[1] branch if possible (not all old versions" ewarn "are available or fully functional, may need to consider nouveau[2])." - ewarn "\n[1] https://www.nvidia.com/object/IO_32667.html" + ewarn "[1] https://www.nvidia.com/object/IO_32667.html" ewarn "[2] https://wiki.gentoo.org/wiki/Nouveau" fi - if ver_replacing -lt 595; then - elog "\n>=${PN}-595 has changes that may or may not need attention:" - elog "1. USE=kernel-open was removed and is now always enabled. If for some" - elog " reason you really need the closed variant (e.g. Runtime D3 on Turing" - elog " GPUs), please use LTS 580.xx instead as Gentoo has no intention to" - elog " support both variants anymore going forward" - elog "2. systemd/elogind sleep services (nvidia-sleep.sh) were tentatively" - elog " removed and replaced by setting NVreg_UseKernelSuspendNotifiers=1 in" - elog " ${EROOT}/etc/modprobe.d/nvidia.conf. If using a non-default custom" - elog " nvidia.conf, please ensure the option is set. Also, systemd users" - elog " may want to ensure that they do not have old sleep/suspend/resume" - elog " *nvidia* files in ${EROOT}/etc/systemd to avoid potential issues." - elog "3. nvidia-drm.modeset=1 was removed from nvidia.conf because it is now" - elog " default enabled regardless (new NVIDIA default)" + if use kernel-open && [[ ! -v NV_HAD_KERNEL_OPEN ]]; then + ewarn + ewarn "Open source variant of ${PN} was selected, note that it requires" + ewarn "Turing/Ampere+ GPUs (aka GTX 1650+). Try disabling if run into issues." + ewarn "Also see: ${EROOT}/usr/share/doc/${PF}/html/kernel_open.html" + fi + + if use wayland && use modules && [[ ! -v NV_HAD_WAYLAND ]]; then + elog + elog "With USE=wayland, this version of ${PN} sets nvidia-drm.modeset=1" + elog "in '${EROOT}/etc/modprobe.d/nvidia.conf'. This feature is considered" + elog "experimental but is required for wayland." + elog + elog "If you experience issues, either disable wayland or edit nvidia.conf." + elog "Of note, may possibly cause issues with SLI and Reverse PRIME." + fi + + if use !kernel-open && ver_replacing -lt 555; then + elog + elog "If using a Turing/Ampere+ GPU (aka GTX 1650+), note that >=nvidia-drivers-555" + elog "enables the use of the GSP firmware by default. *If* experience regressions," + elog "please see '${EROOT}/etc/modprobe.d/nvidia.conf' to optionally disable." fi } |
