Hi everyone,
This is how I made it work on my Ubuntu 24.04 install after hitting my head against the wall for a long time… 
Nouveau is extremely buggy on my system, with visual glitches that ultimately render the desktop unusable, so that was not an option for me.
I installed the recommended ppa ( ppa:kelebek333/nvidia-legacy
) that used to work for me in previous ubuntu versions (including 22.04) but this time did not work for me: the nvidia driver loaded in the kernel, but I got the infamous black login screen.
Reading on Linux Mint forums, I noticed Butterfly (the username for the kelebek333 ppas) asked a user with issues to try it’s build ppa (where the packages from Debian Sid are located), and that actually worked for me:
sudo add-apt-repository ppa:kelebek333/build
sudo apt install nvidia-legacy-340xx-driver
That got me to the login screen and I was able to start a new visual session, but there was a problem when launching some applications (including Nautilus!): the windows would not show.
After a lot of research, I found that the GTK4 renderer needed to be forced to cairo
to make it work, and the way to do that globally is to edit the environment file:
sudo nano /etc/environment
and adding the following line of code to it:
GSK_RENDERER=cairo
After rebooting most things are working properly (I am having issues with flutter apps like RuskDesk), but everthing else seems to be working file.
What I didn’t try was to force the rendered to cairo
with the original ppa:kelebek333/nvidia-legacy
repository: it might work, but I am not touching my system any longer! 
I hope that helps people getting the black login screen.