Hi @LittleFive
Thanks for your interest in using lightning.gpu. There are a few things worth noting for use here:
- Firstly, you can try upgrading the
lightning.gpuinstalled package aspython -m pip install pennylane pennylane-lightning pennylane-lightning-gpu --upgradeto ensure the version is the most recent (v0.33.1 as of writing). Once this is installed and up to date, you can trypip install custatevec-cu11to bring in the CUDA 11 variant of the NVIDIA cuQuantum custatevec library. lightning.gpurequires a CUDA compute capability of SM7.0 or newer (Volta era and newer) to work. This is a hard requirement from the NVIDIA cuQuantum SDK (specifically the custatevec library), as the library expects data-center/HPC grade hardware to run. I cannot tell which GPUs you have installed, but it may be possible they are not supported by the library. You can inspect the compute capabilities for a variety of NVIDIA devices here- Assuming a supported GPU, the
lightning.gpusimulator requires a minimum CUDA version of 11.5 runtime libraries to operate. I see your version on the platform is 11.4. If you can upgrade the installed drivers and SDK to 11.5 at a minimum (11.8 preferred), the libraries will work as expected. If you cannot upgrade the SDK, you can attempt to installnvidia-cusparse-cu11,nvidia-cublas-cu11, andnvidia-cuda-runtime-cu11to your python virtualenv, and these may allow you to operate, assuming the installed hardware driver is of a supported version. - If your hardware isn’t supported by NVIDIA cuQuantum, but you can install a CUDA 12 toolchain, you can try to build our other HPC device
lightning.kokkos, with instructions here. This require some manual steps to build from source, but may get you GPU support, depending on your hardware type. We require CUDA 12 here as the compiler toolchain for CUDA 11 does not allow some of the newer features we added. - If none of the above are valid options, you can swap
default.qubitfor our C++ backed CPU simulatorslightning.qubitand our CPU-variant oflightning.kokkos. When you install PennyLane aspip install pennylaneyou getlightning.qubittoo, so this should work directly. For the OpenMP variant oflightning.kokkosyou can runpip install pennylane-lightning[kokkos]and the package will be installed for you.
Hopefully the above steps help you get running with one of the above devices. If not, feel free to let us know and we can try to help out.