@@ -33,35 +33,46 @@ CUDA Quantum can be used to compile and run quantum programs on a CPU-only
3333system, but a GPU is highly recommended and necessary to use the some of the
3434simulators. The GPU-based simulators included in the CUDA Quantum Python wheels
3535require an existing CUDA installation. Additionally, multi-GPU simulators
36- require an existing MPI installation.
36+ require an existing CUDA-aware MPI installation.
3737
38- In most cases, the CUDA and MPI dependencies can be installed via package
39- manager. On Ubuntu 22.04, for example, the following commands install all
40- optional CUDA dependencies:
38+ To install the necessary dependencies, we recommend using
39+ [ Conda] ( https://docs.conda.io/en/latest/ ) . If you are not already using Conda,
40+ you can install a minimal version following the instructions
41+ [ here] ( https://docs.conda.io/projects/miniconda/en/latest/index.html ) .
42+ The following commands will create and activate a complete environment for
43+ CUDA Quantum with all its dependencies:
4144
4245``` console
43- arch=x86_64 # set this to sbsa for ARM processors
44- sudo apt-get update && sudo apt-get install -y wget
45- wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$arch/cuda-keyring_1.0-1_all.deb
46- sudo dpkg -i cuda-keyring_1.0-1_all.deb && rm cuda-keyring_1.0-1_all.deb
47- sudo apt-get update && sudo apt-get install -y cuda-toolkit-11.8
46+ conda create -y -n cuda-quantum python==3.10 pip
47+ conda install -y -n cuda-quantum -c "nvidia/label/cuda-11.8.0" cuda
48+ conda install -y -n cuda-quantum -c conda-forge mpi4py openmpi
49+ conda env config vars set -n cuda-quantum LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CONDA_PREFIX/envs/cuda-quantum/lib"
50+ conda run -n cuda-quantum pip install cuda-quantum
51+ conda activate cuda-quantum
4852```
4953
50- Detailed instructions for how to install the complete CUDA toolkit on different
51- operating systems can be found in the [ CUDA
52- documentation] ( https://docs.nvidia.com/cuda/ ) .
53-
54- If you have several GPUs available but no MPI installation yet, we recommend
55- taking a look at the [ OpenMPI documentation] ( https://docs.open-mpi.org/ )
56- and installing [ mpi4py] ( https://mpi4py.readthedocs.io/ ) .
57- On Ubuntu 22.04, for example, the following commands install the necessary MPI
58- libraries:
54+ You must configure MPI by setting the following environment variables:
5955
6056``` console
61- sudo apt-get update && sudo apt-get install -y libopenmpi-dev libpython3-dev gcc
62- python3 -m pip install mpi4py
57+ export OMPI_MCA_opal_cuda_support=true OMPI_MCA_btl='^openib'
6358```
6459
60+ * If you do not set these variables you may encounter a segmentation fault.*
61+
62+ ** Important** : It is * not* sufficient to set these variable within the conda
63+ environment, like the commands above do for ` LD_LIBRARY_PATH ` .
64+ To avoid having to set them every time you launch a new
65+ shell, we recommend adding them to ` ~/.profile `
66+ (create the file if it does not exist).
67+
68+ MPI uses [ SSH] ( https://en.wikipedia.org/wiki/Secure_Shell ) or
69+ [ RSH] ( https://en.wikipedia.org/wiki/Remote_Shell ) to communicate with
70+ each node unless another resource manager, such as
71+ [ SLURM] ( https://slurm.schedmd.com/overview.html ) , is used.
72+ If you are encountering an error "The value of the MCA parameter
73+ ` plm_rsh_agent ` was set to a path that could not be found",
74+ please make sure you have an SSH Client installed.
75+
6576## Running CUDA Quantum
6677
6778You should now be able to import CUDA Quantum and start building quantum
0 commit comments