Running multiple CUDA / OpenCL toolkits on one workstation.
Cudaswitcher is a simple utility designed to allow multiple versions of a CUDA or OpenCL SDK to be installed on a system along with their respective toolkits. Cudaswitcher can be configured to use only a certain version, or by default it will use the newest installed.
Cudaswitcher looks in 2 places for a configuration file each time it runs: /etc/cudaswitcher.conf and ~/.cudaswitcher. Both files may be present on a system, and in that case, cudaswitcher will prefer the profile-specific config file ~/.cudaswitcher.
The configuration file contains one line in the format:
cudaversion="2.3"To configure Cudaswitcher to use version 2.2, simply change the line to:
cudaversion="2.2"Cudaswitcher also looks for an environment variable "CUDAVERSION". This setting takes preference over the configuration files, and can be changed quickly by typing:
In the installation of cudatoolkit, all binaries are renamed to include their version. Additionally, supporting files such as includes and libraries are placed in versioned folders. Versioned binaries and their symlinks are installed to /usr/bin/nameXX, versioned includes are installed to /usr/include/cudaXX, and versioned libraries are installed to /usr/lib64/cudaXX.
Paths and Makefiles:
As the include and libary files are versioned by changing their paths, the common.mk file in the SDK is patched to include these locations. Any additional makefiles created must include these locations.
For runtime support, the library paths are appended to the system LD_LIBRARY_PATH on login with the script /etc/profile.d/cudalibs.sh according to cudaswitcher configuration.
This HOWTO was prepared by Owen Stampflee and Matt Watson, Fixstars Solutions, Inc.