CUDA Toolkit installation error with laptop HP ab217ns

I have an NVIDIA 940m(4 gb version) but when i try to install CUDA 9.1 it fails but in other laptop with the same GPU i can install CUDA 9.1.
What can i do to install cuda 9.1 in this laptop?

This thread may be of interest:

https://devtalk.nvidia.com/default/topic/1033111/cuda-setup-and-installation/cuda-9-1-cannot-install-due-to-failed-visual-studio-integration/