qiskit-aer: [qiskit-aer-gpu] ImportError: libcustatevec.so.1
Informations
- Qiskit Aer version: qiskit-aer-gpu 0.12.2
- Python version: 3.11
- Operating system: Ubuntu 22.04
- CUDA version: 12.1.1 / 11.8.0
What is the current behavior?
If I run the following procedure in a very clean environment, I will get a library load error and not be able to use qiskit_aer.
>>> import qiskit_aer
Traceback (most recent call last): File “<stdin>”, line 1, in <module> … ImportError: libcustatevec.so.1: cannot open shared object file: No such file or directory
Steps to reproduce the problem
- Create a clean environment. For example, use the following docker images:
-
Enter a clean environment. e.g.,
docker run -it --rm --gpus all python311:ubuntu22-cuda121
if you will use docker images above. -
Set up
qiskit-aer-gpu
with the following steps
pip install qiskit
pip uninstall -y qiskit-aer
pip install "qiskit-aer-gpu==0.12.2"
(For CUDA 11.8 the last line would be pip install "qiskit-aer-gpu-cu11==0.12.2"
.)
- Run
python -c "import qiskit_aer"
What is the expected behavior?
Importing qiskit_aer
will successfully finish.
Suggested solutions
It would be nice if the library paths (LD_LIBRARY_PATH
) could be properly set. One work around would be:
mkdir -p /usr/local/nvidia/lib64
ln -s /usr/local/lib/python3.11/site-packages/cuquantum/lib/libcustatevec.so.1 /usr/local/nvidia/lib64/libcustatevec.so.1
ln -s /usr/local/lib/python3.11/site-packages/cuquantum/lib/libcutensornet.so.2 /usr/local/nvidia/lib64/libcutensornet.so.2
ln -s /usr/local/lib/python3.11/site-packages/cutensor/lib/libcutensor.so.1 /usr/local/nvidia/lib64/libcutensor.so.1
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 22 (1 by maintainers)
We are planning to include this fix in 0.13.0 release. I created binary distribution of the latest codes and put on TestPyPI temporary. https://test.pypi.org/project/qiskit-aer-gpu/0.13.0/
Before installing by pip, other required packages should be installed manually, as following
pip install nvidia-cuda-runtime-cu12 nvidia-cublas-cu12 nvidia-cusolver-cu12 nvidia-cusparse-cu12 cuquantum-cu12
The example is here : https://colab.research.google.com/drive/1bXwlFyfoJmAw2nrMZDN8oYe8PAgqV8Co?usp=sharing
I think this is a bug in GCC 11 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100438 Please try using other version of compiler
The problem is fixed and merged but qiskit-aer-gpu is not released on PyPI. Please refer to #1882 and build from source until new qiskit-aer-gpu will be released.