Closed sirgeorgesawcon closed 9 months ago
Can you confirm that you have the necessary CUDA runtime libraries installed? This error matches the note in documentation - https://nvidia.github.io/cuda-quantum/latest/using/simulators.html. Also refer https://nvidia.github.io/cuda-quantum/latest/install.html#dependencies-and-compatibility
Yes, I have installed all the necessary pacakges:
I believe the error is due to the fact that it's still not available for windows OS. Although I am using windows subsytem for Linux, but I think it's not compatible for that either.
Although I am using windows subsytem for Linux, but I think it's not compatible for that either.
I regularly use WSL for cuda-quantum development and am able to use the GPU backends. To verify that it can work for you, would you be willing to try it in the Docker images? If so, here is something worth trying:
docker pull nvcr.io/nvidia/cuda-quantum:0.5.0
container=$(docker run -itd --gpus all nvcr.io/nvidia/cuda-quantum:0.5.0)
docker exec -it $container bash
# Run this command from within container, should produce something like `{ 0:491 1:509 }`
python3 examples/python/intro.py
# Outside container, cleanup
docker stop $container
docker rm $container
You will need the nvidia-container-toolkit
installed.
@sirgeorgesawcon I think the problem is that some libraries that the libnvqir-custatevec
simulator depends on are missing. In the Google Colab environment, I think this can be rectified by running the following commands prior to import cudaq
:
!wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
!dpkg -i cuda-keyring_1.0-1_all.deb
!apt-get update
!apt-get -y install libcublas-11-8 libcusolver-11-8 cuda-cudart-11-8
%pip install cuda-quantum
Please give this a try and let me know if it works for you. We probably need a better error message if this is indeed the problem you're experiencing.
Similar commands could be done to get the Python portion of CUDA Quantum running in a WSL environment, too, but you may need to uninstall and reinstall the cuda-quantum Python wheel after installing the libcublas (and others) packages.
Hi @bmhowe23 , Thanks, the above, the method works on google colab, although on my local device I'm facing the issue of !dpkg event not found
The file gets downloaded, but even if I do
sudo dpkg -i cuda-keyring_1.0-1_all.deb
It gives the error:
dpkg: error: cannot access archive 'cuda-keyring_1.0-1_all.deb': No such file or directory
But nvm, I'll experiment on google colab. Thanks for helping out.
Thanks, @sirgeorgesawcon. PR #1152, which will be incorporated into our upcoming 0.7.0 release, will gracefully fall back on a CPU-based simulator if any GPU driver/package issues are encountered, so thanks for reporting this issue. I'll close this issue, but feel free to open another one if you encounter any other issues.
I encountered the same issue on my local device. I followed the quick start. When I tried:
import cudaq
cudaq.set_target("nvidia")
it raised RuntimeError: Invalid simulator requested: custatevec_fp32
And after several attempts, I resolved it by:
sudo apt-get --yes install cuquantum
This resolved the problem for me. Hope that it will help others encountering the same issue.
I have encountered this many times while trying to get the installation working on Nvidia Grace Hopper.
It’s working with the following environment variables set but it is a non trivial install: PATH= /usr/local/cuda-12.4/bin:/opt/nvidia/cudaq/bin:/home/USER/miniconda3/envs/cuda-quant/bin:/home/USER/.local/bin:/home/USER/miniconda3/bin:/home/USER/miniconda3/condabin:/home/USER/miniconda3/bin:/usr/local/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin LD_LIBRARY_PATH= /usr/local/cuda-12.4/extras/CUPTI/lib64:/usr/local/cuda-12.4/lib64:/usr/local/cuda-12.4/lib64:/envs/cuda-quantum/lib
# packages in environment at /home/USER/miniconda3/envs/cuda-quant:
#
# Name Version Build Channel
_libgcc_mutex 0.1 anaconda_defaults
_openmp_mutex 5.1 1_gnu
_sysroot_linux-aarch64_curr_repodata_hack 4 h57d6b7b_14 conda-forge
absl-py 2.1.0 pypi_0 pypi
aiohttp 3.9.3 pypi_0 pypi
aiosignal 1.3.1 pypi_0 pypi
astpretty 3.0.0 pypi_0 pypi
async-timeout 4.0.3 pypi_0 pypi
attrs 23.2.0 pypi_0 pypi
audioread 3.0.1 pypi_0 pypi
binutils 2.40 h64c2a2e_0 conda-forge
binutils_impl_linux-aarch64 2.40 h870a726_0 conda-forge
binutils_linux-aarch64 2.40 h95d2017_3 conda-forge
blas 1.0 openblas
boto3 1.19.12 pypi_0 pypi
botocore 1.22.12 pypi_0 pypi
brotli 1.0.9 h998d150_7
brotli-bin 1.0.9 h998d150_7
brotli-python 1.0.9 py310h419075a_7
bzip2 1.0.8 h998d150_5
c-ares 1.19.1 h998d150_0
c-compiler 1.7.0 h31becfc_0 conda-forge
ca-certificates 2024.2.2 hcefe29a_0 conda-forge
cachetools 5.3.3 pypi_0 pypi
certifi 2024.2.2 pypi_0 pypi
cffi 1.16.0 pypi_0 pypi
charset-normalizer 3.3.2 pypi_0 pypi
click 8.1.7 pypi_0 pypi
cmake 3.26.4 h3bd60fd_0
colorama 0.4.6 pypi_0 pypi
contourpy 1.2.0 py310hb8fdbf2_0
coremltools 5.0b5 pypi_0 pypi
cuda 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-cccl 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-command-line-tools 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-compiler 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-cudart 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-cudart-dev 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-cudart-static 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-cuobjdump 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-cupti 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-cupti-static 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-cuxxfilt 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-documentation 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-driver-dev 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-gdb 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-libraries 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-libraries-dev 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-libraries-static 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-nsight-compute 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-nvcc 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-nvdisasm 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-nvml-dev 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-nvprune 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-nvrtc 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-nvrtc-dev 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-nvrtc-static 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-nvtx 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-profiler-api 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-quantum 0.7.0 pypi_0 pypi
cuda-runtime 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-sanitizer-api 12.4.99 0 nvidia/label/cuda-12.4.0
cuda-toolkit 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-tools 12.4.0 0 nvidia/label/cuda-12.4.0
cuda-version 11.8 hcce14f8_2
cuda-visual-tools 12.4.0 0 nvidia/label/cuda-12.4.0
cudatoolkit 11.8.0 hdd48f4a_13 conda-forge
cuquantum 23.10.0.6 h8af1aa0_3 conda-forge
cuquantum-cu11 23.10.0 pypi_0 pypi
curl 8.5.0 h6ac735f_0
custatevec 1.5.0 hc707ada_3 conda-forge
custatevec-cu11 1.5.0 pypi_0 pypi
cutensor 1.7.0.1 hc0e3c58_3 conda-forge
cutensor-cu11 1.7.0 pypi_0 pypi
cutensornet 2.3.0 mpi_openmpi_h6da911f_3 conda-forge
cutensornet-cu11 2.3.0 pypi_0 pypi
cxx-compiler 1.7.0 h2a328a1_0 conda-forge
cycler 0.11.0 pyhd3eb1b0_0
decorator 5.1.1 pypi_0 pypi
dill 0.3.8 pypi_0 pypi
exceptiongroup 1.2.0 pypi_0 pypi
execnet 2.0.2 pypi_0 pypi
expat 2.5.0 h419075a_0
expecttest 0.1.6 pypi_0 pypi
filelock 3.13.1 pypi_0 pypi
flatbuffers 2.0 pypi_0 pypi
fonttools 4.25.0 pyhd3eb1b0_0
freetype 2.12.1 h6df46f4_0
frozenlist 1.4.1 pypi_0 pypi
fsspec 2024.2.0 pypi_0 pypi
future 1.0.0 pypi_0 pypi
gcc 12.3.0 he80d746_3 conda-forge
gcc_impl_linux-aarch64 12.3.0 hcde2664_5 conda-forge
gcc_linux-aarch64 12.3.0 h9622932_3 conda-forge
gdbm 1.18 hf59d7a7_4
gds-tools 1.9.0.20 0 nvidia/label/cuda-12.4.0
geojson 2.5.0 pypi_0 pypi
gettext 0.21.0 h0cce8dc_1
ghstack 0.8.0 pypi_0 pypi
git 2.40.1 pl5340h372b8bf_1
google-auth 2.28.2 pypi_0 pypi
google-auth-oauthlib 1.0.0 pypi_0 pypi
graphlib-backport 1.1.0 pypi_0 pypi
grpcio 1.62.1 pypi_0 pypi
gxx 12.3.0 he80d746_3 conda-forge
gxx_impl_linux-aarch64 12.3.0 hcde2664_5 conda-forge
gxx_linux-aarch64 12.3.0 h3d1e521_3 conda-forge
hypothesis 5.35.1 pypi_0 pypi
icu 73.1 h419075a_0
idna 3.6 pypi_0 pypi
imageio 2.34.0 pypi_0 pypi
iniconfig 2.0.0 pypi_0 pypi
jinja2 3.1.3 pypi_0 pypi
jmespath 0.10.0 pypi_0 pypi
joblib 1.3.2 pypi_0 pypi
jpeg 9e h998d150_1
junitparser 2.1.1 pypi_0 pypi
kernel-headers_linux-aarch64 4.14.214 h1cb168f_14
kiwisolver 1.4.4 py310h419075a_0
krb5 1.20.1 h2e2fba8_1
lark 0.12.0 pypi_0 pypi
lazy-loader 0.3 pypi_0 pypi
lcms2 2.12 h5246980_0
ld_impl_linux-aarch64 2.40 h2d8c526_0 conda-forge
lerc 3.0 h22f4aa5_0
libblas 3.9.0 21_linuxaarch64_openblas conda-forge
libbrotlicommon 1.0.9 h998d150_7
libbrotlidec 1.0.9 h998d150_7
libbrotlienc 1.0.9 h998d150_7
libcublas 12.4.2.65 0 nvidia/label/cuda-12.4.0
libcublas-dev 12.4.2.65 0 nvidia/label/cuda-12.4.0
libcublas-static 12.4.2.65 0 nvidia/label/cuda-12.4.0
libcufft 11.2.0.44 0 nvidia/label/cuda-12.4.0
libcufft-dev 11.2.0.44 0 nvidia/label/cuda-12.4.0
libcufft-static 11.2.0.44 0 nvidia/label/cuda-12.4.0
libcufile 1.9.0.20 0 nvidia/label/cuda-12.4.0
libcufile-dev 1.9.0.20 0 nvidia/label/cuda-12.4.0
libcufile-static 1.9.0.20 0 nvidia/label/cuda-12.4.0
libcurand 10.3.5.119 0 nvidia/label/cuda-12.4.0
libcurand-dev 10.3.5.119 0 nvidia/label/cuda-12.4.0
libcurand-static 10.3.5.119 0 nvidia/label/cuda-12.4.0
libcurl 8.5.0 hfa2bbb0_0
libcusolver 11.6.0.99 0 nvidia/label/cuda-12.4.0
libcusolver-dev 11.6.0.99 0 nvidia/label/cuda-12.4.0
libcusolver-static 11.6.0.99 0 nvidia/label/cuda-12.4.0
libcusparse 12.3.0.142 0 nvidia/label/cuda-12.4.0
libcusparse-dev 12.3.0.142 0 nvidia/label/cuda-12.4.0
libcusparse-static 12.3.0.142 0 nvidia/label/cuda-12.4.0
libdeflate 1.17 h998d150_1
libedit 3.1.20230828 h998d150_0
libev 4.33 hfd63f10_1
libffi 3.4.4 h419075a_0
libgcc-devel_linux-aarch64 12.3.0 h8b5ab12_105 conda-forge
libgcc-ng 13.2.0 hf8544c7_5 conda-forge
libgfortran-ng 13.2.0 he9431aa_5 conda-forge
libgfortran5 13.2.0 h582850c_5 conda-forge
libgomp 13.2.0 hf8544c7_5 conda-forge
liblapack 3.9.0 21_linuxaarch64_openblas conda-forge
libllvm14 14.0.6 hb8fdbf2_3
libllvm17 17.0.6 h64b4ff8_0
libmagma 2.7.2 h2e22a8f_2 conda-forge
libmagma_sparse 2.7.2 h9f9e9bb_3 conda-forge
libnghttp2 1.57.0 hb788212_0
libnpp 12.2.5.2 0 nvidia/label/cuda-12.4.0
libnpp-dev 12.2.5.2 0 nvidia/label/cuda-12.4.0
libnpp-static 12.2.5.2 0 nvidia/label/cuda-12.4.0
libnsl 2.0.1 h31becfc_0 conda-forge
libnvfatbin 12.4.99 0 nvidia/label/cuda-12.4.0
libnvfatbin-dev 12.4.99 0 nvidia/label/cuda-12.4.0
libnvjitlink 12.4.99 0 nvidia/label/cuda-12.4.0
libnvjitlink-dev 12.4.99 0 nvidia/label/cuda-12.4.0
libnvjpeg 12.3.1.89 0 nvidia/label/cuda-12.4.0
libnvjpeg-dev 12.3.1.89 0 nvidia/label/cuda-12.4.0
libnvjpeg-static 12.3.1.89 0 nvidia/label/cuda-12.4.0
libopenblas 0.3.26 pthreads_h5a5ec62_0 conda-forge
libpng 1.6.39 h998d150_0
librosa 0.10.1 pypi_0 pypi
libsanitizer 12.3.0 h8ebda82_5 conda-forge
libsqlite 3.45.2 h194ca79_0 conda-forge
libssh2 1.10.0 h6ac735f_2
libstdcxx-devel_linux-aarch64 12.3.0 h8b5ab12_105 conda-forge
libstdcxx-ng 13.2.0 h9a76618_5 conda-forge
libtiff 4.5.1 h419075a_0
libuuid 2.38.1 hb4cce97_0 conda-forge
libuv 1.44.2 h998d150_0
libwebp-base 1.3.2 h998d150_0
libxcrypt 4.4.36 h31becfc_1 conda-forge
libxml2 2.10.4 h045d036_1
libzlib 1.2.13 h31becfc_5 conda-forge
llvm 17.0.6 h31887d6_0
llvmlite 0.38.1 pypi_0 pypi
lxml 5.0.0 pypi_0 pypi
lz4-c 1.9.4 h419075a_0
magma 2.7.2 h4902ff7_3 conda-forge
markdown 3.6 pypi_0 pypi
markupsafe 2.1.5 pypi_0 pypi
matplotlib 3.8.0 py310hd43f75c_0
matplotlib-base 3.8.0 py310hfb1e5ee_0
mpi 1.0 openmpi
mpi4py 3.1.5 py310h980cfce_1 conda-forge
mpmath 1.3.0 pypi_0 pypi
msgpack 1.0.8 pypi_0 pypi
multidict 6.0.5 pypi_0 pypi
multiprocess 0.70.16 pypi_0 pypi
munkres 1.1.4 py_0
mypy 1.8.0 pypi_0 pypi
mypy-extensions 1.0.0 pypi_0 pypi
ncurses 6.4 h419075a_0
networkx 2.8.8 pypi_0 pypi
ninja 1.10.2 hd43f75c_5
ninja-base 1.10.2 h59a28a9_5
nsight-compute 2024.1.0.13 0 nvidia/label/cuda-12.4.0
numba 0.55.2 pypi_0 pypi
numpy 1.26.4 py310he45c16d_0
numpy-base 1.26.4 py310h15d264d_0
oauthlib 3.2.2 pypi_0 pypi
onnx 1.15.0 pypi_0 pypi
openjpeg 2.4.0 hf3eb033_0
openmpi 4.1.6 h1f4154d_101 conda-forge
openssl 3.2.1 h31becfc_0 conda-forge
opt-einsum 3.3.0 pypi_0 pypi
optree 0.9.1 pypi_0 pypi
packaging 23.1 py310hd43f75c_0
pcre2 10.42 hcfaa891_0
perl 5.34.0 h998d150_2
pillow 10.2.0 py310h998d150_0
pip 23.3.1 py310hd43f75c_0
pluggy 1.4.0 pypi_0 pypi
pooch 1.8.1 pypi_0 pypi
protobuf 3.20.2 pypi_0 pypi
psutil 5.9.8 pypi_0 pypi
pyasn1 0.5.1 pypi_0 pypi
pyasn1-modules 0.3.0 pypi_0 pypi
pybind11 2.11.1 pypi_0 pypi
pycparser 2.21 pypi_0 pypi
pygments 2.15.0 pypi_0 pypi
pyparsing 3.0.9 py310hd43f75c_0
pysocks 1.7.1 py310hd43f75c_0
pytest 7.3.2 pypi_0 pypi
pytest-cpp 2.3.0 pypi_0 pypi
pytest-flakefinder 1.1.0 pypi_0 pypi
pytest-rerunfailures 14.0 pypi_0 pypi
pytest-xdist 3.3.1 pypi_0 pypi
python 3.10.13 hbbe8eec_1_cpython conda-forge
python-dateutil 2.8.2 pyhd3eb1b0_0
python_abi 3.10 4_cp310 conda-forge
pywavelets 1.4.1 pypi_0 pypi
pyyaml 6.0.1 py310h998d150_0
readline 8.2 h998d150_0
requests 2.31.0 pypi_0 pypi
requests-oauthlib 1.4.0 pypi_0 pypi
rhash 1.4.3 h6ac735f_0
rockset 1.0.3 pypi_0 pypi
rsa 4.9 pypi_0 pypi
s3transfer 0.5.2 pypi_0 pypi
scikit-image 0.20.0 pypi_0 pypi
scikit-learn 1.4.1.post1 pypi_0 pypi
scipy 1.8.1 pypi_0 pypi
setuptools 68.2.2 py310hd43f75c_0
six 1.16.0 pyhd3eb1b0_1
sortedcontainers 2.4.0 pypi_0 pypi
soundfile 0.12.1 pypi_0 pypi
soxr 0.3.7 pypi_0 pypi
sqlite 3.41.2 h998d150_0
sympy 1.12 pypi_0 pypi
sysroot_linux-aarch64 2.26 h4744778_14
tb-nightly 2.13.0a20230426 pypi_0 pypi
tbb 2021.8.0 hb8fdbf2_0
tensorboard 2.13.0 pypi_0 pypi
tensorboard-data-server 0.7.2 pypi_0 pypi
threadpoolctl 3.3.0 pypi_0 pypi
tifffile 2024.2.12 pypi_0 pypi
tk 8.6.13 h194ca79_0 conda-forge
torch 2.3.0a0+gita157a0d dev_0 <develop>
torch-mlir 0.0.1 pypi_0 pypi
torchvision 0.18.0a0+ba64d65 dev_0 <develop>
tornado 6.3.3 py310h998d150_0
tqdm 4.66.2 pypi_0 pypi
typing_extensions 4.9.0 py310hd43f75c_1
tzdata 2024a h04d1e81_0
unittest-xml-reporting 3.2.0 pypi_0 pypi
urllib3 1.26.18 pypi_0 pypi
werkzeug 3.0.1 pypi_0 pypi
wheel 0.41.2 py310hd43f75c_0
xdoctest 1.1.0 pypi_0 pypi
xz 5.4.6 h998d150_0
yaml 0.2.5 hfd63f10_0
yarl 1.9.4 pypi_0 pypi
z3-solver 4.12.2.0 pypi_0 pypi
zlib 1.2.13 h31becfc_5 conda-forge
zstd 1.5.5 h6a09583_0
(Note there is a local wheel build of torch here as well)
Required prerequisites
Describe the bug
Since
cuda-quantum
is only available for Linux OS, I tried using it on Google Colab. For CPU runtime, I ran the code:It installed perfectly.
Then running the code
Also gave the desired output.
But when I changed the runtime to GPU, and installed the
cuda-quantum
again. This time running the codegave me this error:
The full error being
It's evident that it's failing to import
pycudaq
in the__init__.py
file, which isThe error is in line 28
and this only arises when you are using an actual GPU runtime,
Steps to reproduce the bug
Step 1
Step 2
Make sure this is done in a GPU runtime, or with a machine with GPU.
Expected behavior
It should not show any error.
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
Suggestions
No response