CUDA installation and driver/runtime incompatibility

Hi,

I’m having the following issue, these are my current versions of the linux kernel and nvidia driver:

kernel:   4.19.0-5-amd64 #1 SMP Debian 4.19.37-5 (2019-06-19) 
nvidia-driver: NVIDIA-SMI 418.74       Driver Version: 418.74       CUDA Version: N/A

Still, the system returns an error when trying to run an example:

Failed to allocate device vector A (error code CUDA driver version is insufficient for CUDA runtime version)!

The nvidia driver was installed through debian apt but I wanted to install the latest cuda version
hence cuda was not installed through the package manager.

I’m wondering what’s wrong in my current setup.
Is it because the NVIDIA driver included in the cuda devkit is “special” and contains another abi?
Otherwise I wouldn’t understand why nvidia-smi returns CUDA Version: N/A.

p.s. It’s an NVIDIA optimus laptop.

it’s quite possible that the NVIDIA driver provided with the CUDA toolkit installer is different than the driver you got from some other repository