Yet another "CUDA driver version is insufficient for CUDA runtime version" on CUDA9/nvidia 384.111

I have nvidia GeForce 840M.
I installed CUDA 9 with nvidia drivers 384.111. I checked up on the forum and found they were compatible.

I have a weird error.

The output of nvidia-smi

Thu Jan 25 14:45:20 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.111                Driver Version: 384.111                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce 840M        Off  | 00000000:03:00.0 Off |                  N/A |
| N/A   53C    P0    N/A /  N/A |    278MiB /  4044MiB |     13%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1429      G   /usr/lib/xorg/Xorg                           167MiB |
|    0      2149      G   compiz                                       108MiB |
+-----------------------------------------------------------------------------+

Output of nvcc is

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

But, I can’t seem to run nvidia-detector or deviceQuery.
I get None when I run nvidia-detector and

./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL

Any help appreciated. I am seeing this error in many of the posts in the forum but nothing is working for me.

Mobile gpu can be shut off in various ways. You’ll need to learn more about your laptop and optimus laptops in general to learn how to turn it on. Try reading about nvidia-prime