-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[qiskit-aer-gpu] ImportError: libcustatevec.so.1 #1874
Comments
Now Aer uses cuquantum PiPy package and I'm wondering that this is an issue to use the package. Line 59 in b4e393c
|
Should the #1877 have fixed this one? Still facing the same issue when trying to use the qiskit-aer-gpu python package |
The problem is fixed and merged but qiskit-aer-gpu is not released on PyPI. |
Hi @doichanj , I have been able to build from source for the qiskit-aer-gpu as you mentioned in #1882 , and until the end of that notebook everything ran fine and I saw no problems. However, when I try to import AerSimulator to see if I can access the 'tensor_network' methods, I could not do so. I'll be grateful if you could help me with this. |
I added test script to run with |
Thanks a lot for your help! It does work for me! |
Hi @doichanj ! I am also having a similar trouble building the Qiskit-Aer from source. I tried to follow the steps as were provided in the google collab link. I am using Cuda toolkit version 12.2, Python version 3.11 and Operating system Ubuntu 22.04 When I run the command I reach to this point
Before getting the following errors
I would be very grateful for any guidance you can shed on this! |
Please try building with option |
Thanks @doichanj for the tip! The building now reached 66% before stopping due to another issue which I've detailed here. I decided to remove and reinstall Ubuntu 22.04 to start from scratch. I've configured my Ubuntu in such a way to match what I saw on the Google collab:
I've followed the steps from the google collab, pip installing the cu11 versions of the Nvidia libraries since my Cuda version is 11.8. When it comes to building, I run with the added Python Cuda Root option as you suggested: The build manages to reach :
before it gives the following error and stops the build process
I tried to search online for fixes for the |
I think this is a bug in GCC 11 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100438 |
@doichanj Thank you for all the help. Unfortunately, I was still unable to make the relevant fix. However, since my deadline for this project is due next Friday, I've been able to find ways around needing the GPU version. Out of curiosity, when is the fixed version of the library going to be released on PyPi? |
We are planning to include this fix in 0.13.0 release. Before installing by pip, other required packages should be installed manually, as following The example is here : https://colab.research.google.com/drive/1bXwlFyfoJmAw2nrMZDN8oYe8PAgqV8Co?usp=sharing |
This is a validation report. I tried to build SummaryIn short, build process essentially successes except a small problem (will be referred later). Of course we no longer need to set additional paths to Detail$ docker run -it --rm --gpus all python311:ubuntu22-cuda121
# pip install qiskit-aer
# pip uninstall -y qiskit-aer
# git clone https://github.com/Qiskit/qiskit-aer
# pip install nvidia-cuda-runtime-cu12 nvidia-cublas-cu12 nvidia-cusolver-cu12 nvidia-cusparse-cu12 cuquantum-cu12
# pip install -r qiskit-aer/requirements-dev.txt
# pip install pybind11 and then # cd qiskit-aer
# python ./setup.py bdist_wheel -- -DAER_THRUST_BACKEND=CUDA -DCMAKE_VERBOSE_MAKEFILE=true -DAER_DEBUG=false -DAER_MPI=false -DCMAKE_CUDA_FLAGS=-std=c++14 -DAER_PYTHON_CUDA_ROOT=/usr/local -- which will fail due to: ---
CMake Error at /usr/local/lib/python3.11/site-packages/cmake/data/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find BLAS (missing: BLAS_LIBRARIES)
--- so we may need to do the following procedure in addition (if needed): # apt update && apt install -y libopenblas-dev I retried: # cd qiskit-aer
# python ./setup.py bdist_wheel -- -DAER_THRUST_BACKEND=CUDA -DCMAKE_VERBOSE_MAKEFILE=true -DAER_DEBUG=false -DAER_MPI=false -DCMAKE_CUDA_FLAGS=-std=c++14 -DAER_PYTHON_CUDA_ROOT=/usr/local -- which successfully finished after several (about 5~10) minutes. So I installed # pip install -U dist/* Finally I tested with two (CPU and cuTensorNet) simulators of sim = AerSimulator(method='statevector') and sim_gpu = AerSimulator(method='tensor_network', device='GPU') and both are OK. I also tested with: sim_gpu_cusv = AerSimulator(method='statevector', device='GPU', cuStateVec_enable=True) and this is also OK. >>> print(result_gpu_cusv.to_dict()['results'][0]['metadata']['cuStateVec_enable'])
True |
@doichanj and @gluca99 I have found that the installation problem to do with "custatevec.h" is due to the missing cuQuantum and cuTensor. Once these two NVIDIA products are installed then all of the required components and headers can be found, and the qiskit-aer-gpu compiles fine (well, with lots and lots warnings). Perhaps, this needs to be added to qiskit-aer-gpu documentation as a requirement (it may be obvious for some but not for others). |
I am as well still encountering this issue. I recreated a conda environment and specifically pip installed the qiskit-aer-gpu-cu11 package, but the custatevec.h file is still missing. Has there been any update? |
Now the latest version of Aer is 0.13.1 but the latest GPU distribution is not published yet because of PyPI's new authorization. This problem should be fixed on the latest Aer |
Do you have any other advice as to how to fix the file missing error? I pip installed the qiskit-aer-gpu and installed the cuQuantum and cuTensor as the previous response said. However, I am still encountering this error. Could it perhaps be due to the cuda environment or something similar? |
I put GPU distributions of Aer 0.13.1 on release page, https://github.com/Qiskit/qiskit-aer/releases |
Thanks for the reply. I am locally installing it to the computer, and then doing pip install "filename.whl", but I believe the python versions might be incompatible as I am getting the "'filename.whl' is not a supported wheel on this platform". |
i'm waiting for this solution. |
in my case, the library is in here: |
In case anyone is looking for a potential solution I have one. Running on Rocky Linux 8.8 with Cuda 12.2 This works
Additionally, some problems with symengine for example:
See symengine/symengine.py#474
|
Informations
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.
Traceback (most recent call last):
File "", line 1, in
...
ImportError: libcustatevec.so.1: cannot open shared object file: No such file or directory
Steps to reproduce the problem
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 stepspip 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"
.)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:The text was updated successfully, but these errors were encountered: