revert CUDA 6.0 to 4.0 on Ubuntu 12.04

I have installed CUDA 6.0 on my Ubuntu12.04, but my source code actually need CUDA 4.0. How can I revert CUDA 6.0 to CUDA 4.0 on my platform?

I’m curious why you say you need a previous version of CUDA… code should be portable across CUDA versions. Did you try compiling the code? Were there any errors?

That being said, you can just install the CUDA 4.2 run file and point your paths to where you install it. More than 1 CUDA toolkit can co-exist on the same machine… you just have to remember to point the environment variables to the one you’re currently using.