Nvidia drivers not detected in Xubuntu 21.10

In Xubuntu 21.10 which is the latest release there
is a new problem with nvidia driver,
So there is a program called Additional Drivers
in that program it is not detecting my nvidia driver 340 only wifi card driver is showing .
Also I have tried installing nvidia from terminal but it doesn’t install nvidia driver properly.

From this article: LinuxOPsys: Linux How-to guide, Tutorials & Tips

Install the driver with CLI:

sudo Ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
sudo apt install nvidia-driver-340

Then, reboot the computer:

Verify using nvidia-smi

sudo nvidia-settings

There are other methods that I’ve found on DDG, but try the above for now.

Other solutions would be to download the .deb file from Ubuntu website: Index of /ubuntu/pool/restricted/n/nvidia-graphics-drivers-340

Details here: https://ubuntu.pkgs.org/20.04/ubuntu-updates-restricted-amd64/nvidia-340-uvm_340.108-0ubuntu5.20.04.1_amd64.deb.html

Sometimes Ubuntu doesn’t detect your hardware. In my case, it didn’t detect broadcom wifi on Acer laptop because I disabled proprietary drivers for devices. When I installed Linux Mint on the same laptop, Mint was able to detect that.

Maybe you did the same. In this case, the solution would be to enable proprietary drivers for devices. Go to software and updates > Check proprietary drivers for devices. Then, check for updates and see what happens.