Kernel space is much more reliable, as the system can use only one nvidia kernel module at a time.
You can check the following file:
/sys/module/nvidia/version
and you will get something like 367.44 (the format being "$major_version.$minor_version\n"). You can pick the major version, and use that to determine which libraries to load, as the path is /usr/lib/nvidia-$major_version.
Kernel space is much more reliable, as the system can use only one nvidia kernel module at a time.
You can check the following file:
/sys/module/ nvidia/ version
and you will get something like 367.44 (the format being "$major_ version. $minor_ version\ n"). You can pick the major version, and use that to determine which libraries to load, as the path is /usr/lib/ nvidia- $major_ version.