I have not tried this myself, but it seems some Ubuntu users are having success using graysky's patches that I assume are the same as those here.
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1916640
That thread points to this link on editing xorg.conf https://launchpad.net/~kelebek333/+archive/ubuntu/nvidia-legacy
There also seems to be a patch ready to go for 5.12 http://rglinuxtech.com/?p=2896
Any brave folks want to give this a shot?
Pinned Comments
JerryXiao commented on 2022-10-13 03:51 (UTC) (edited on 2022-10-14 02:44 (UTC) by JerryXiao)
For testing users, contributors: check out https://github.com/archlinux-jerry/nvidia-340xx
Warning: force push may happen to match the aur tree