Spack
Last updated
Was this helpful?
Last updated
Was this helpful?
is an open-source package manager that allows the developers to easily manage multiple versions of the same software and its dependencies, for example by allowing to quickly switch between multiple CUDA
or gcc
versions.
Let's get started with Spack on DataCrunch On-demand cluster!
On your first boot, Spack is not added to your shell by default. To initialize Spack, please run:
The above can also be added to your .bashrc
to have Spack commands always available on login.
We recommend you consult to learn more about its features. Below, we provide some basic examples.
You can make the specific version of a package active by running spack load package@version
and conversely, deactivating it by running spack unload package
. Behind the scenes, Spack handles the above by prepending to the $PATH
environment variable.
List the currently installed packages:
On a freshly installed cluster this should provide output similar to:
To find info on all installable versions of Nvidia CUDA:
To install CUDA version 12.6.2:
Once the package has been installed load it with:
Verify that the package has been loaded:
Now the Nvidia CUDA Compiler path will be set to the Spack module corresponding to the loaded CUDA version:
Should output something like:
The Spack setup script is available here: /usr/local/bin/spack.setup.sh
. If you for any reason delete your /home/spack
directory, you can recreate it by running the above script.
We recommend you read spack.setup.sh
before using it. It for example sets cuda_arch=90a
which is not the right choice for NVIDIA GPU generations newer than H200.