Spack
Install oneAPI for AMD GPU using the Spack packaging tool.
You can install oneAPI for AMD GPU using Spack, a tool commonly used in supercomputing.
Usage Guide
To install the oneAPI for AMD GPU using Spack, you can follow the below steps. Please note, some of the commands may not be needed depending on your setup.
Step 1 - Read The Docs
Before getting started, it may be worth reading the Spack documentation.
Read Spack DocumentationStep 2 - Install Spack
You will need a Spack install available on your system. Run the following commands to clone spack to your local machine and initialize it.
Install and Setup Spack
git clone --depth=2 https://github.com/spack/spack.git
. spack/share/spack/setup-env.sh
spack bootstrap now
Add Our Packages (temporary)
We currently have an open PR to add our packages to the official spack repo. Until this is merged, please add our packages manually using the commands below.
git clone --depth=2 --branch=spack-pr-50784 https://github.com/scottstraughan/spack-packages.git
spack repo add spack-packages/repos/spack_repo/builtin
Step 3 - Install the Plugin
You can run the following commands to install spack packages. If you wish to specify a driver
version to target, you can use driver=VERSION
when installing. If you do not
specify a value, the latest driver will be used.
spack install codeplay-oneapi-amd
spack install codeplay-oneapi-amd driver=6.3
spack install codeplay-oneapi-amd driver=6.2
spack install codeplay-oneapi-amd driver=6.1
spack install codeplay-oneapi-amd driver=6.0
spack install codeplay-oneapi-amd driver=5.7
spack install codeplay-oneapi-amd driver=5.4
Step 4 - Setup the oneAPI Compiler
You can now load the Intel oneAPI compiler and setup some environment variables.
The setvars.sh
script will allow you to run sycl-ls
and ensure
everything needed to compile, is available on your PATH.
spack load intel-oneapi-compilers
spack compiler find
source spack/opt/spack/linux-*/intel-oneapi-compilers*/setvars.sh
Step 5 - Test
You can now check everything is working fine by running the following command.
sycl-ls