4
$\begingroup$

I'm trying to run quantum circuit simulations with Qiskit Aer using GPU acceleration (specifically an NVIDIA A100) in Google Colab Pro.

Here's a simplified example I'm running:

from qiskit import QuantumCircuit, transpile
from qiskit_aer import AerSimulator

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.save_statevector()

simulator = AerSimulator(method='statevector', device='GPU')
circ = transpile(qc, simulator)
result = simulator.run(circ).result()
state = result.get_statevector(0)
print(state)

This works when I use device='CPU', but when using device='GPU', I frequently get the error:

RuntimeError: Simulation device "GPU" is not supported on this system

I'm using Google Colab Pro with a confirmed A100 GPU available (!nvidia-smi confirms this). I have installed Qiskit Aer with GPU support using:

!pip install qiskit-aer-gpu

Still, I often lose GPU access after reconnecting or restarting the runtime.


Questions:

  1. How can I ensure that Qiskit AerSimulator consistently uses the GPU (A100) in Google Colab?
  2. Are there any CUDA or system-level dependencies required beyond the pip package?
  3. Is there a reliable workaround for this GPU support issue in Colab?

Environment:

  • Google Colab Pro
  • GPU: NVIDIA A100
  • Python: 3.11
  • Qiskit: latest (August 2025)

Any insight or working configuration would be greatly appreciated!

$\endgroup$

1 Answer 1

5
$\begingroup$

I found the solution! ? Since Google Colab often runs in a CUDA-enabled GPU environment, the fix is to install the GPU-compatible version of Qiskit Aer:

!pip install qiskit-aer-gpu-cu11

Additional note: I also noticed that sometimes Colab connects you to a server that doesn't allow executing these instructions properly—even with the correct packages installed. I didn’t change anything in the code; I just restarted the Colab runtime and reinstalled the GPU version of Aer, and it started working again.

$\endgroup$

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.