Lightning-AMDGPU installation

Install Lightning-AMDGPU from source

Lightning-AMDGPU is an instantiation of the Lighting-Kokkos device, specifically for AMD GPUs using the HIP backend. For building Lightning-Kokkos for targets other than AMD GPUs, please refer to the Lightning-Kokkos installation page.

Install Lightning-AMDGPU

git clone https://github.com/PennyLaneAI/pennylane-lightning.git
cd pennylane-lightning
pip install -r requirements.txt
pip install git+https://github.com/PennyLaneAI/pennylane.git@master

# First Install Lightning-Qubit
PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py
python -m pip install . -vv

# Install Lightning-AMDGPU
PL_BACKEND="lightning_amdgpu" python scripts/configure_pyproject_toml.py
export CMAKE_ARGS="-DCMAKE_CXX_COMPILER=hipcc \
                   -DCMAKE_CXX_FLAGS='--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/11/'"
python -m pip install . -vv

Note

Make sure that gcc-11 is installed and accessible on your system, since it is required to compile the Lightning-AMDGPU device. This can be done on Ubuntu via sudo apt install gcc-11 g++-11.

Install Lightning-AMDGPU with MPI

Note

To build Lightning-AMDGPU with MPI support, please consult the Lightning-Kokkos installation guide at Lightning-Kokkos installation and Lightning-Kokkos installation on HPC.