# Pennylane lightning.gpu error

**URL:** <https://discuss.pennylane.ai/t/pennylane-lightning-gpu-error/4634>\
**Category:** PennyLane Help\
**Created:** [May 19, 2024, 9:26pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-gpu-error/4634 "2024-05-19T21:26:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![QuantumMan](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/quantumman/32/2509_2.png) [@QuantumMan](https://discuss.pennylane.ai/u/QuantumMan)\
**Post date:** [May 19, 2024, 9:26pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-gpu-error/4634/1 "2024-05-19T21:26:50Z")

</div>

Even though the compilation shows it is using 12.0 cuda versions and tools, somehow lightning.gpu plugin built from source is still looking for cudart.11.0 library. Any thoughts? how I can debug this problem?

```auto
import pennylane as qml
import jax
import jax.numpy as jnp

n_qubits=10

def standard_parametric(weights, n_qubits, n_registers, circuit_depth):
    number_trainable_parameters = 0
    count = 0
    for _ in range(circuit_depth):
        for k in range(n_qubits):
            qml.RY(weights[count], wires=k)
            count += 1
        for k in range(n_qubits-1):
            qubit_1 = k
            qubit_2 = k + 1
            qml.IsingYY(weights[count], wires=[qubit_1, qubit_2])
            count += 1

        for k in range(n_qubits-1):
            control_qubit = k
            target_qubit = k+1
            qml.CRY(weights[count], wires=[control_qubit, target_qubit])
            count += 1
    number_trainable_parameters = count

def qnode_fn(weights):
    standard_parametric(weights, n_qubits, n_registers=1,
                        circuit_depth=2)
    return qml.sample()

dummy_device = qml.device("lightning.gpu", wires=n_qubits, shots=1)
dummy_qnode = qml.QNode(qnode_fn, dummy_device, diff_method=None, interface="jax")
print(dummy_qnode(jnp.zeros((1,))))

```

If you want help with diagnosing an error, please put the full error message below:

```auto
/global/u1/p/prmantha/pennylane-lightning/pennylane_lightning/lightning_gpu/lightning_gpu.py:94: UserWarning: libcudart.so.11.0: cannot open shared object file: No such file or directory
  warn(str(e), UserWarning)
Traceback (most recent call last):
  File "/global/u1/p/prmantha/qugen/apps/logistics/test_qml.py", line 35, in <module>
    dummy_device = qml.device("lightning.gpu", wires=n_qubits, shots=1)
  File "/global/common/software/m4408/pmantha/qugen_env/lib/python3.9/site-packages/pennylane/ __init__.py", line 393, in device
    dev = plugin_device_class(*args, **options)
  File "/global/u1/p/prmantha/pennylane-lightning/pennylane_lightning/lightning_gpu/lightning_gpu.py", line 254, in __init__
    super(). __init__ (wires, shots=shots, c_dtype=c_dtype)
  File "/global/u1/p/prmantha/pennylane-lightning/pennylane_lightning/core/lightning_base.py", line 74, in __init__
    raise ImportError(
ImportError: Pre-compiled binaries for lightning.gpu are not available. To manually compile from source, follow the instructions at https://pennylane-lightning.readthedocs.io/en/latest/installation.html.
![Screenshot 2024-05-19 at 2.23.03 PM|690x256](upload://ywme6oIJoPjeZd9xO7dGWblWFqX.png)

```

And, finally, make sure to include the versions of your packages. Specifically, show us the output of `qml.about()`.

````auto
Version: 0.36.0
Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
Home-page: https://github.com/PennyLaneAI/pennylane
Author: 
Author-email: 
License: Apache License 2.0
Location: /global/common/software/m4408/pmantha/qugen_env/lib/python3.9/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, rustworkx, scipy, semantic-version, toml, typing-extensions
Required-by: PennyLane_Lightning, PennyLane_Lightning_GPU, qugen

Platform info: Linux-5.14.21-150400.24.81_12.0.87-cray_shasta_c-x86_64-with-glibc2.31
Python version: 3.9.12
Numpy version: 1.26.4
Scipy version: 1.13.0
Installed devices:
- default.clifford (PennyLane-0.36.0)
- default.gaussian (PennyLane-0.36.0)
- default.mixed (PennyLane-0.36.0)
- default.qubit (PennyLane-0.36.0)
- default.qubit.autograd (PennyLane-0.36.0)
- default.qubit.jax (PennyLane-0.36.0)
- default.qubit.legacy (PennyLane-0.36.0)
- default.qubit.tf (PennyLane-0.36.0)
- default.qubit.torch (PennyLane-0.36.0)
- default.qutrit (PennyLane-0.36.0)
- default.qutrit.mixed (PennyLane-0.36.0)
- null.qubit (PennyLane-0.36.0)
- lightning.qubit (-ennyLane-Lightning-0.36.0)
- lightning.qubit (PennyLane-Lightning-0.36.0)
- lightning.gpu (PennyLane-Lightning-GPU-0.36.0)```
````

---

<div class="post-metadata">

**Author:** ![QuantumMan](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/quantumman/32/2509_2.png) [@QuantumMan](https://discuss.pennylane.ai/u/QuantumMan)\
**Post date:** [May 19, 2024, 9:27pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-gpu-error/4634/2 "2024-05-19T21:27:46Z")

</div>

![Screenshot 2024-05-19 at 2.23.03 PM](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/2X/f/f1f25097981b08b654b56c8a84feced0947336cb.png)

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [May 22, 2024, 9:43pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-gpu-error/4634/3 "2024-05-22T21:43:12Z")

</div>

Hi @QuantumMan,

Thank you for your message. If possible I would recommend creating a new virtual environment with Miniconda.

In this new environment make sure to run `python -m pip install pennylane pennylane-lightning-gpu --upgrade` to ensure the version is the most recent (v0.36.0 as of writing). Once this is installed and up to date, you can try `pip install custatevec-cu12` to bring in the CUDA 12 variant of the NVIDIA cuQuantum custatevec library.

Please let me know if the problem persists in the new environment too.
