See: Support timeframes for Unix legacy GPU releases. Nvidia dropped support for your GPU and the 340 branch in Dec 2019. Ubuntu no longer ships the 340 series driver because of this as it doesn’t officially support the 5.15 series kernel.
There is a PPA where someone has patched the 340 driver for newer kernels: ppa:kelebek333/nvidia-legacy