How to set in the installation script no removal of the old driver. I have two kernels (both needed):
Centos 7.5 (./install --eth-only);
Centos 7.5 + patch RT (compilation, ./install --eth-only -add-kernel-support).
Unfortunately, one driver uninstalls another during installation. This effectively blocks the use of the latest drivers for both kernels.
If your question is if it possible to use different MOFED version for different kernel, then it is not . However, you should be able to install Mellanox OFED on one kernel with --disable-kmp option, reboot to other kernel, recompile same Mellanox OFED using mlnx_add_kernel_support and after that install only kernel modules.
I found one bug in the Mellanox drivers. In the RT kernel on the Centos 7.5 system, the ptp4l or phc2sys processes do not want to start automatically as a service (systemctl). There is no problem with drivers built into the kernel.