I have posted the same post in Nvidia CUDA forum:
Link Here
I reinstalled multiple times with the method from the post but still having the same “class template” problems.
Then I reinstalled CUDA 9.1 and VS2017 ver 15.6.7 also with the same method and it finally works.
Further problems that I encountered is in the post too.
solved Cuda compilation error: class template has already been defined