3
$\begingroup$

I'm practicing with qiskit experiments. Try to work it with GPU installed in my system. But it takes 100% performance of CPU and didn't consider the GPU.

Kindly help me to run the qiskit codes with GPU.

Thanks..

$\endgroup$
3
  • 1
    $\begingroup$ Can you provide more details about what you want to do? Are you trying to simulate quantum circuits with more than 30 qubits? $\endgroup$ Commented Dec 20, 2022 at 9:41
  • $\begingroup$ Related question on StackOverflow: stackoverflow.com/questions/67480117/… $\endgroup$ Commented Dec 20, 2022 at 10:13
  • $\begingroup$ Hi, were you able to execute and if yes, what specs your GPU supports? As I am using Cuda 12.1 and GPU with CC 5.2 but I am getting error cudaErrorNoKernelImageForDevice $\endgroup$
    – aneela
    Commented May 5, 2023 at 10:12

1 Answer 1

4
$\begingroup$

According to qiskit-aer README, you can install qiskit-aer-gpu to utilize GPU for simulation. This package requires CUDA® 10.1 or newer previously installed. CUDA® itself would require a set of specific GPU drivers. On Linux, you can install by pip install qiskit-aer-gpu, on other platforms you need to build the package from source.

Note that qiskit-aer and qiskit-aer-gpu are mutually exclusive. They contain the same code but the latter supports CUDA. If you install both at the same it will interfere with each other. See this answer for more details.

Furthermore, you can use cusvaer or cuStateVec from NVIDIA’s cuQuantum SDK (requires CUDA as well) with Qiskit to utilize GPU for simulation. See some code examples here and the cuQuantum documentation.

$\endgroup$
4
  • $\begingroup$ This page states: "If you want to install our GPU supported simulators, you have to install this other package: pip install qiskit-aer-gpu This will overwrite your current qiskit-aer package installation giving you the same functionality found in the canonical qiskit-aer package, plus the ability to run the GPU supported simulators: statevector, density matrix, and unitary." If this information is correct (no need to uninstall qiskit-aer anymore), can you update your answer to reflect so please? $\endgroup$
    – Tristan Nemoz
    Commented Feb 19, 2023 at 15:11
  • $\begingroup$ I am not sure it’s needed to uninstall qiskit-aer and I can’t test I because I don’t have a machine with NVIDIA GPU… $\endgroup$ Commented Feb 20, 2023 at 13:01
  • $\begingroup$ No problem, I'll try to test it and will tell you the result. Don't hesitate to ping me if I forget to do so in several days, I think this question could be useful to a large number of people, so it might be worth the effort! $\endgroup$
    – Tristan Nemoz
    Commented Feb 20, 2023 at 13:18
  • $\begingroup$ That would be great. Thanks a lot! $\endgroup$ Commented Feb 20, 2023 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.