How to Install CUDA 10 together with CUDA 8?

I have CUDA 8 and cudnn 5.1.10 installed on my Windows 10. Now I need to run application that needs CUDA 10 and cudnn 7.** . I don’t want to remove the previous cuda 8 installation because some of my apps will still need it, so for 1 app I need CUDA 8 and for other app I will need CUDA 10. Is it okay to have 2 CUDA version on the same windows? Is there any detail step how to install CUDA 10 that will not break my system? Thank you!

Technically you would need to change your CUDA-related environment variables (as well as the PATH to the desired nvcc) every time you want to compile with one or the other, avoiding that both are active at the same time.

But more than that, you will have to first check if the driver required by CUDA 10 is backwards compatible with CUDA 8. Maybe it is, but you need to be 100% sure, otherwise the worst scenario is that you will also need to change the driver depending on what you want to run.

Maybe a batch file to setup the appropriate variables just before it calls the executable…
I haven’t tried myself, these are just some ideas.

If I am not mistaken, the versions are backwards compatible. This means the apps built with v8 should run on a v10 system. If possible, try installing v10.1 on a system and running your v8 apps on it. They should run.

In general, when an application is linked against a particular cuda library (like the cuda runtime API library, which would be used by a large number of apps), you must provide that exact library version. An app so linked against CUDA 8.0 cudart (cuda runtime library) cannot run successfully if you only provide the CUDA 10.0 cudart library (e.g. libcudart.so on linux, or the equivalent on windows).

Apps built using only the CUDA driver API have the kind of compatibility you describe. An app that only depends on libcuda.so and no other CUDA libraries should run successfully on a system that has a “CUDA 10 driver”, even if it were built on a system with only CUDA 8 installed.