CUDA 3.2 and CUDA 4.0 co-exist


Is it feasible to install both CUDA3.2 and CUDA4.0 on one linux distribution?

Driver,cudatoolkit and cudasdk are re-packaged as rpm format. That means they are ordered by dependency.

I’d like to install them in the specified directory and use the two versions when necessary.

my shell script:

echo “Install NVIDIA_CUDA_3.2”
rpm -ivh nvidia-260.19.21-x86_64.rpm
rpm -ivh cudatoolkit-3.2.16-x86_64.rpm
rpm -ivh cudasdk-3.2.16-x86_64.rpm

ln /lib/modules/uname -r/kernel/drivers/video/nvidia.ko /usr/local/project/nvidia/3.2/260.19.21

rpm -e nvidia-260.19.21 //in order to install another driver

echo “Install NVIDIA_CUDA_4.0”
rpm -ivh nvidia-270.27-sgi.cl55.1.1.x86_64.rpm
rpm -ivh cudatoolkit-4.0.11-sgi.cl55.1.1.x86_64.rpm
rpm -ivh cudasdk-4.0.11-sgi.cl55.1.1.x86_64.rpm

ln /lib/modules/uname -r/kernel/drivers/video/nvidia.ko /usr/local/project/nvidia/4.0/270.27

Then if I want to use CUDA3.2, I will do:

export PATH=/usr/local/project/nvidia/3.2/cuda/bin
export LD_LIBRARY_PATH=/usr/local/project/nvidia/3.2/cuda/lib64
export CUDA_INSTALL_PATH=/usr/local/project/nvidia/3.2/cuda

rmmod nvidia
insmod /usr/local/project/nvidia/3.2/260.19.21

If i want to use CUDA 4.0,I would do:

export PATH=$PATH:/usr/local/project/nvidia/4.0/cuda/bin
export LD_LIBRARY_PATH=/usr/local/project/nvidia/4.0/cuda/lib64
export CUDA_INSTALL_PATH=/usr/local/project/nvidia/4.0/cuda

rmmod nvidia
insmod /usr/local/AEE/nvidia/4.0.11/270.27

However, I encounter a critical problem which will prompt me driver component version and module version mismatch and fail to run cuda sample.

So what shall I do to make two versions co-exist?

Thank you in advance!

Install just the newer driver and use it for both.
If it does not work out, you can still forget about RPMs and install the original Nvidia packages directly.

Thank you for your replay.

But is it possible to have two different version driver installed in the distribution?

Not that I am aware of.