Cuda 10.1 installation problems

I am trying to install cuda 10.1 on a workstation running a cleanly installed OpenSuse Leap 15.2 (kernel 5.3.18) but I am getting “kernel sources not found” errors and both the associated driver (version 418.67) and cuda toolkit fail to install. On the contrary, doing the same with cuda 11.2, the installation proceeds flawlessly.

This machine is equipped with a Quadro P4000 card and is set to use Nvidia 3D vision, which lost support from Nvidia after driver 418.XX version. Thus, I need cuda 10.1 instead of 11.2, since this last one goes associated with Nvidia driver version 460.27 and I doubt that I can downgrade to any 418.XX driver version .

I am pretty sure that the kernel sources are installed (this is also required for the installation of cuda 11.2) and in addition I prevented other problems of incompatibility with installed Noveau drivers (I removed and blacklisted Nouveau drivers) and add the nomodeset kernel parameter at boot, but none of these solved the problem.

Therefore I wonder if cuda 10 is incompatible with kernel 5.3.18 or with gcc 7.5, or if there is something else that I can try. Any suggestions?