# Lightning GPU 0.25 on Jetson Xavier NX

**URL:** <https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033>\
**Category:** PennyLane Help\
**Created:** [July 15, 2022, 11:26pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033 "2022-07-15T23:26:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [July 15, 2022, 11:26pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/1 "2022-07-15T23:26:36Z")

</div>

Hello:

I have installed PennyLane Lightning GPU 0.25 with the cuQuantum SDK  
in a python 3.10 conda environment on a Jetson Xavier NX Development  
Kit with a Volta GPU (Ubuntu 20.04.4 LTS OS). When I run the following  
code (as python test.py):

test.py contents:

from pennylane import numpy as np  
import pennylane as qml  
from pennylane.templates.layers import StronglyEntanglingLayers  
from numpy.random import random

n\_wires=22  
dev = qml.device(“lightning.gpu”, wires=n\_wires)

@qml.qnode(dev, diff\_method=“adjoint”)  
def circuit(weights):  
qml.StronglyEntanglingLayers(weights, wires=list(range(n\_wires)))  
return [qml.expval(qml.PauliZ(i)) for i in range(n\_wires)]

param\_shape = qml.StronglyEntanglingLayers.shape(n\_layers=2, n\_wires=22)  
params = np.random.random(param\_shape)  
jac = qml.jacobian(circuit)(params)

I get the output:

pennylane\_lightning\_gpu/lightning\_gpu.py:77: UserWarning: No module named ‘pennylane\_lightning\_gpu.lightning\_gpu\_qubit\_ops’  
warn(str(e), UserWarning)  
/home/arthurlobo/pennylane-lightning-gpu/pennylane\_lightning\_gpu/lightning\_gpu.py:422: RuntimeWarning:  
!!!#####################################################################################  
!!!  
!!! WARNING: INSUFFICIENT SUPPORT DETECTED FOR GPU DEVICE WITH `lightning.gpu`  
!!! DEFAULTING TO CPU DEVICE `lightning.qubit`  
!!!  
!!!#####################################################################################

warn(

How can I get the code to run on the lightning.gpu device?  
Where can I find the module: pennylane\_lightning\_gpu.lightning\_gpu\_qubit\_ops?

Output of qml.about():

Name: PennyLane  
Version: 0.24.0  
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.  
Home-page: [https://github.com/XanaduAI/pennylane](https://github.com/XanaduAI/pennylane)  
Author:  
Author-email:  
License: Apache License 2.0  
Location: /home/art/anaconda3/envs/qml\_py310/lib/python3.10/site-packages  
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, retworkx, scipy, semantic-version, toml  
Required-by: PennyLane-Lightning, PennyLane-Lightning-GPU

Platform info: Linux-5.10.65-tegra-aarch64-with-glibc2.31  
Python version: 3.10.4  
Numpy version: 1.22.3  
Scipy version: 1.8.1  
Installed devices:

- lightning.gpu (PennyLane-Lightning-GPU-0.25.0.dev0)
- lightning.qubit (PennyLane-Lightning-0.24.0)
- default.gaussian (PennyLane-0.24.0)
- default.mixed (PennyLane-0.24.0)
- default.qubit (PennyLane-0.24.0)
- default.qubit.autograd (PennyLane-0.24.0)
- default.qubit.jax (PennyLane-0.24.0)
- default.qubit.tf (PennyLane-0.24.0)
- default.qubit.torch (PennyLane-0.24.0)

---

<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:** [July 18, 2022, 8:48pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/2 "2022-07-18T20:48:22Z")

</div>

Hi @art, welcome to the forum!

I see that you’re using the development version of lightning.gpu. Do you get the same problem when using version 0.24.1? Also, what version of cuQuantum have you got installed?

---

<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:** [July 18, 2022, 9:25pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/3 "2022-07-18T21:25:25Z")

</div>

Hi @art, my colleague Ali had 2 additional suggestions:

1 - Update the `LD_LIBRARY_PATH` environment variable as follows before running test.py:

```
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/complete/path/to/cuquantum-sdk/lib/

```

Without updating `LD_LIBRARY_PATH` , the lightning.gpu cannot figure out where the library exists and it switches to lightning.qubit instead 🙂

2 - Double-check the commands used to build lightning.gpu. For example, building the library using `python setup.py` should be like the following:

```
python setup.py build_ext --cuquantum=/path/to/cuquantum-sdk 
python setup.py install

```

Please let me know if this solves your problem!

---

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [July 19, 2022, 1:53am UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/4 "2022-07-19T01:53:17Z")

</div>

@CatalinaAlbornoz my cuQuantum SDK version is 22.05, LD\_LIBRARY\_PATH includes the cuQuantum SDK libraries (such as libcustatevec.so, libcutensornet.so etc), built lightning\_gpu 0.24.1 with the commands:

cmake -BBuild -DCUQUANTUM\_SDK=path to sdk  
cmake --build ./Build --verbose  
python -m pip install wheel  
python setup.py build\_ext --cuquantum=path to sdk  
python setup.py bdist\_wheel

and ran the test code with the same error message as shown:

python test.py  
Name: PennyLane  
Version: 0.24.0  
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.  
Home-page: [https://github.com/XanaduAI/pennylane](https://github.com/XanaduAI/pennylane)  
Author:  
Author-email:  
License: Apache License 2.0  
Location: /home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages  
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, retworkx, scipy, semantic-version, toml  
Required-by: PennyLane-Lightning, PennyLane-Lightning-GPU

Platform info: Linux-5.10.65-tegra-aarch64-with-glibc2.31  
Python version: 3.10.4  
Numpy version: 1.22.3  
Scipy version: 1.8.1  
Installed devices:

- lightning.gpu (PennyLane-Lightning-GPU-0.24.1)

- default.gaussian (PennyLane-0.24.0)

- default.mixed (PennyLane-0.24.0)

- default.qubit (PennyLane-0.24.0)

- default.qubit.autograd (PennyLane-0.24.0)

- default.qubit.jax (PennyLane-0.24.0)

- default.qubit.tf (PennyLane-0.24.0)

- default.qubit.torch (PennyLane-0.24.0)

- lightning.qubit (PennyLane-Lightning-0.24.0)  
/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/lightning\_gpu.py:73: UserWarning: No module named ‘pennylane\_lightning\_gpu.lightning\_gpu\_qubit\_ops’  
warn(str(e), UserWarning)  
/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/lightning\_gpu.py:413: RuntimeWarning:  
!!!#####################################################################################  
!!!  
!!! WARNING: INSUFFICIENT SUPPORT DETECTED FOR GPU DEVICE WITH `lightning.gpu`  
!!! DEFAULTING TO CPU DEVICE `lightning.qubit`  
!!!  
!!!#####################################################################################

This time I used the Jetson AGX Xavier Developer Kit.

Output of make test-python:

make test-python  
python3 -I -m pytest tests --tb=short  
===================================================================== test session starts =====================================================================  
platform linux – Python 3.10.4, pytest-7.1.2, pluggy-1.0.0  
rootdir: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1  
plugins: mock-3.8.2, flaky-3.7.0  
collected 564 items / 1 skipped

tests/test\_adjoint\_jacobian.py … [21%]  
…sss… [27%]  
tests/test\_apply.py … [50%]  
…s [69%]  
tests/test\_comparison.py … [77%]  
tests/test\_gates.py .s…s…ss…s…ss…s…s…s.s…s…ss…s…s…ss…s…ss…s…s…s.s…s…ss… [97%]  
tests/test\_sample.py … [98%]  
tests/test\_var.py … [100%]

====================================================================== warnings summary =======================================================================  
tests/test\_adjoint\_jacobian.py::test\_qchem\_expvalcost\_correct  
/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/vqe/vqe.py:153: UserWarning: ExpvalCost is deprecated, use qml.expval() instead. For optimizing Hamiltonian measurements with measuring commuting terms in parallel, use the grouping\_type keyword in qml.Hamiltonian.  
warnings.warn(

tests/test\_gates.py: 110 warnings  
/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/ops/qubit/non\_parametric\_ops.py:1954: UserWarning: The control\_wires keyword will be removed soon. Use wires = (control\_wires, target\_wire) instead. See the documentation for more information.  
warnings.warn(

================================================== 532 passed, 33 skipped, 111 warnings in 71.06s (0:01:11) ===================================================  
pl-device-test --device lightning.gpu --skip-ops --shots=20000  
===================================================================== test session starts =====================================================================  
platform linux – Python 3.10.4, pytest-7.1.2, pluggy-1.0.0  
rootdir: /home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests, configfile: pytest.ini  
plugins: mock-3.8.2, flaky-3.7.0  
collected 372 items

…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_compare\_default\_qubit.py sssssssss [2%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_gates.py … [11%]  
… [52%]  
… [60%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_gates\_with\_expval.py … [66%]  
… [79%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_measurements.py …s…sss… [86%]  
…sss.ssss…ss.ss…ss [95%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_properties.py …s.X… [97%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_tracker.py sss [98%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_wires.py … [100%]

====================================================================== warnings summary =======================================================================  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/ops/qubit/non\_parametric\_ops.py:1954  
/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/ops/qubit/non\_parametric\_ops.py:1954: UserWarning: The control\_wires keyword will be removed soon. Use wires = (control\_wires, target\_wire) instead. See the documentation for more information.  
warnings.warn(

=================================================== 341 passed, 30 skipped, 1 xpassed, 1 warning in 14.90s ====================================================  
pl-device-test --device lightning.gpu --shots=None --skip-ops  
===================================================================== test session starts =====================================================================  
platform linux – Python 3.10.4, pytest-7.1.2, pluggy-1.0.0  
rootdir: /home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests, configfile: pytest.ini  
plugins: mock-3.8.2, flaky-3.7.0  
collected 372 items

…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_compare\_default\_qubit.py sssss… [2%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_gates.py … [11%]  
… [52%]  
… [60%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_gates\_with\_expval.py … [66%]  
… [79%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_measurements.py …sss… [86%]  
…ssssssssssss.ss…ss [95%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_properties.py …s.X… [97%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_tracker.py sss [98%]  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/devices/tests/test\_wires.py … [100%]

====================================================================== warnings summary =======================================================================  
…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/ops/qubit/non\_parametric\_ops.py:1954  
/home/arthurlobo/.conda/envs/qml\_py310/lib/python3.10/site-packages/pennylane/ops/qubit/non\_parametric\_ops.py:1954: UserWarning: The control\_wires keyword will be removed soon. Use wires = (control\_wires, target\_wire) instead. See the documentation for more information.  
warnings.warn(

=================================================== 343 passed, 28 skipped, 1 xpassed, 1 warning in 10.04s ====================================================

Output of deviceQuery command:

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: “Xavier”  
CUDA Driver Version / Runtime Version 11.4 / 11.4  
CUDA Capability Major/Minor version number: 7.2  
Total amount of global memory: 14907 MBytes (15631454208 bytes)  
(008) Multiprocessors, (064) CUDA Cores/MP: 512 CUDA Cores  
GPU Max Clock rate: 1377 MHz (1.38 GHz)  
Memory Clock rate: 1377 Mhz  
Memory Bus Width: 256-bit  
L2 Cache Size: 524288 bytes  
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)  
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers  
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers  
Total amount of constant memory: 65536 bytes  
Total amount of shared memory per block: 49152 bytes  
Total shared memory per multiprocessor: 98304 bytes  
Total number of registers available per block: 65536  
Warp size: 32  
Maximum number of threads per multiprocessor: 2048  
Maximum number of threads per block: 1024  
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)  
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)  
Maximum memory pitch: 2147483647 bytes  
Texture alignment: 512 bytes  
Concurrent copy and kernel execution: Yes with 1 copy engine(s)  
Run time limit on kernels: No  
Integrated GPU sharing Host Memory: Yes  
Support host page-locked memory mapping: Yes  
Alignment requirement for Surfaces: Yes  
Device has ECC support: Disabled  
Device supports Unified Addressing (UVA): Yes  
Device supports Managed Memory: Yes  
Device supports Compute Preemption: Yes  
Supports Cooperative Kernel Launch: Yes  
Supports MultiDevice Co-op Kernel Launch: Yes  
Device PCI Domain ID / Bus ID / location ID: 0 / 0 / 0  
Compute Mode:  
\< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) \>

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 11.4, CUDA Runtime Version = 11.4, NumDevs = 1  
Result = PASS

---

<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:** [July 20, 2022, 12:56am UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/5 "2022-07-20T00:56:21Z")

</div>

Hi @art,

It looks like an installation problem because the error says that it can’t find “lightning\_gpu\_qubit\_ops”. Can you please try the following?

1 - Create a new virtual environment  
2 - Install PennyLane v0.24 using `python -m pip install pennylane`  
3 - Install cuQuantum v 22.05 using `python -m pip install cuquantum-python`  
4 - Install pennylane-lightning-gpu using `python -m pip install pennylane-lightning[gpu]`  
5 - Try running the simplest code possible:

```
import pennylane as qml
dev = qml.device("lightning.gpu", wires=1)
@qml.qnode(dev)
def circuit():
    qml.PauliX(0)
    return qml.expval(qml.PauliZ(0))
circuit()

```

Please let me know if you still get the warning after this change.

---

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [July 20, 2022, 2:44am UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/6 "2022-07-20T02:44:26Z")

</div>

@CatalinaAlbornoz I created a new conda environment and followed the three python -m pip install steps. I still get the same warning with the simple code.

I ran “make test-cpp” which created lightning\_gpu\_qubit\_ops.cpython-310-aarch64-linux-gnu.so (~47 MB) in the BuildTests folder which could be the missing lightning\_gpu\_qubit\_ops module.

However I got errors when linking the runner\_gpu executable. I have included messages from the “make test-cpp” - from the point where lightning\_gpu\_qubit\_ops is created to the runner\_gpu link errors. Those appear to be custatevec library functions which are not found. I had also  
copied the custatevec and cutensornet libraries to /usr/local/cuda-11.4/lib64 from the cuQuantum install directory.

make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[74%] Building CXX object CMakeFiles/lightning\_gpu\_qubit\_ops.dir/pennylane\_lightning\_gpu/src/bindings/Bindings.cpp.o  
[75%] Linking CXX shared module lightning\_gpu\_qubit\_ops.cpython-310-aarch64-linux-gnu.so  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[75%] Built target **lightning\_gpu\_qubit\_ops**  
make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[76%] Building CXX object \_deps/pennylane\_lightning-build/CMakeFiles/lightning\_qubit\_ops.dir/pennylane\_lightning/src/bindings/Bindings.cpp.o  
[77%] Linking CXX shared module lightning\_qubit\_ops.cpython-310-aarch64-linux-gnu.so  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[77%] Built target lightning\_qubit\_ops  
make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[77%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/compile\_time\_tests.dir/compile\_time\_tests.cpp.o  
[78%] Linking CXX executable compile\_time\_tests  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[78%] Built target compile\_time\_tests  
make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[79%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/CreateAllWires.cpp.o  
[79%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_AdjDiff.cpp.o  
[80%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_AlgUtil.cpp.o  
[81%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_CompilerSupport.cpp.o  
[81%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_DynamicDispatcher.cpp.o  
[82%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_Error.cpp.o  
[83%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_GateImplementations\_CompareKernels.cpp.o  
[83%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_GateImplementations\_Generator.cpp.o  
[84%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_GateImplementations\_Inverse.cpp.o  
[84%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_GateImplementations\_Matrix.cpp.o  
[85%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_GateImplementations\_Nonparam.cpp.o  
[86%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_GateImplementations\_Param.cpp.o  
[86%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_GateUtil.cpp.o  
[87%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_Internal.cpp.o  
[88%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_KernelMap.cpp.o  
[88%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_Kokkos\_Sparse.cpp.o  
[89%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_LinearAlgebra.cpp.o  
[89%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_Measures.cpp.o  
[90%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_Measures\_Sparse.cpp.o  
[91%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_Observables.cpp.o  
[91%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_OpToMemberFuncPtr.cpp.o  
[92%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_RuntimeInfo.cpp.o  
[93%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_StateVecAdjDiff.cpp.o  
[93%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_StateVectorManagedCPU.cpp.o  
[94%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_StateVectorRawCPU.cpp.o  
[94%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/Test\_Util.cpp.o  
[95%] Building CXX object \_deps/pennylane\_lightning-build/pennylane\_lightning/src/tests/CMakeFiles/runner.dir/runner\_main.cpp.o  
[96%] Linking CXX executable runner  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[96%] Built target runner  
make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[3]: Entering directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
[96%] Building CXX object pennylane\_lightning\_gpu/src/tests/CMakeFiles/runner\_gpu.dir/runner\_main.cpp.o  
[97%] Building CXX object pennylane\_lightning\_gpu/src/tests/CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_NonParam.cpp.o  
[98%] Building CXX object pennylane\_lightning\_gpu/src/tests/CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_Param.cpp.o  
[98%] Building CXX object pennylane\_lightning\_gpu/src/tests/CMakeFiles/runner\_gpu.dir/Test\_AdjointDiffGPU.cpp.o  
[99%] Building CXX object pennylane\_lightning\_gpu/src/tests/CMakeFiles/runner\_gpu.dir/Test\_GateCache.cpp.o  
[100%] Linking CXX executable runner\_gpu  
/usr/bin/ld: CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged<float>::applyDeviceMatrixGate(float2 const*, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, bool)': /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:1075: undefined reference to `custatevecApplyMatrixGetWorkspaceSize’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:1095: undefined reference to `custatevecApplyMatrix' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:1095: undefined reference to `custatevecApplyMatrix’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:1075: undefined reference to `custatevecApplyMatrixGetWorkspaceSize' /usr/bin/ld: CMakeFiles/runner_gpu.dir/Test_StateVectorCudaManaged_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged::applyDeviceMatrixGate(double2 const\*, std::vector\<unsigned long, std::allocator \> const&, std::vector\<unsigned long, std::allocator \> const&, bool)’:  
/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:1075: undefined reference to `custatevecApplyMatrixGetWorkspaceSize' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:1095: undefined reference to `custatevecApplyMatrix’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:1095: undefined reference to `custatevecApplyMatrix' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:1075: undefined reference to `custatevecApplyMatrixGetWorkspaceSize’  
/usr/bin/ld: CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged<float>::~StateVectorCudaManaged()': /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:221: undefined reference to `custatevecDestroy’  
/usr/bin/ld: CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged<float>::~StateVectorCudaManaged()': /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:221: undefined reference to `custatevecDestroy’  
/usr/bin/ld: CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged<double>::~StateVectorCudaManaged()': /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:221: undefined reference to `custatevecDestroy’  
/usr/bin/ld: CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged<double>::~StateVectorCudaManaged()': /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:221: undefined reference to `custatevecDestroy’  
/usr/bin/ld: CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged<float>::applyParametricPauliGate(std::vector<std:: __cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__ cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<unsigned long, std::allocator<unsigned long> >, std::vector<unsigned long, std::allocator<unsigned long> >, float, bool)': /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:1016: undefined reference to `custatevecApplyPauliRotation’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:1016: undefined reference to `custatevecApplyPauliRotation' /usr/bin/ld: CMakeFiles/runner_gpu.dir/Test_StateVectorCudaManaged_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged::applyParametricPauliGate(std::vector\<std::\_\_cxx11::basic\_string\<char, std::char\_traits, std::allocator \>, std::allocator\<std::\_\_cxx11::basic\_string\<char, std::char\_traits, std::allocator \> \> \> const&, std::vector\<unsigned long, std::allocator \>, std::vector\<unsigned long, std::allocator \>, double, bool)’:  
/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:1016: undefined reference to `custatevecApplyPauliRotation' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:1016: undefined reference to `custatevecApplyPauliRotation’  
/usr/bin/ld: CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged<double>::StateVectorCudaManaged(unsigned long)': /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:200: undefined reference to `custatevecCreate’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:200: undefined reference to `custatevecCreate' /usr/bin/ld: CMakeFiles/runner_gpu.dir/Test_StateVectorCudaManaged_NonParam.cpp.o: in function `Pennylane::StateVectorCudaManaged::StateVectorCudaManaged(unsigned long)’:  
/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:200: undefined reference to `custatevecCreate' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:200: undefined reference to `custatevecCreate’  
/usr/bin/ld: CMakeFiles/runner\_gpu.dir/Test\_StateVectorCudaManaged\_Param.cpp.o: in function `Pennylane::StateVectorCudaManaged<float>::generate_samples(unsigned long)': /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:893: undefined reference to `custatevecSamplerCreate’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:903: undefined reference to `custatevecSamplerPreprocess' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:907: undefined reference to `custatevecSamplerSample’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:913: undefined reference to `custatevecSamplerDestroy' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:893: undefined reference to `custatevecSamplerCreate’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:913: undefined reference to `custatevecSamplerDestroy' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:907: undefined reference to `custatevecSamplerSample’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:903: undefined reference to `custatevecSamplerPreprocess' /usr/bin/ld: CMakeFiles/runner_gpu.dir/Test_StateVectorCudaManaged_Param.cpp.o: in function `Pennylane::StateVectorCudaManaged::generate\_samples(unsigned long)’:  
/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:893: undefined reference to `custatevecSamplerCreate' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:903: undefined reference to `custatevecSamplerPreprocess’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:907: undefined reference to `custatevecSamplerSample' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:913: undefined reference to `custatevecSamplerDestroy’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:893: undefined reference to `custatevecSamplerCreate' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:913: undefined reference to `custatevecSamplerDestroy’  
/usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp:907: undefined reference to `custatevecSamplerSample' /usr/bin/ld: /media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane_lightning_gpu/src/simulator/StateVectorCudaManaged.hpp:903: undefined reference to `custatevecSamplerPreprocess’  
collect2: error: ld returned 1 exit status  
make[3]: \*\*\* [pennylane\_lightning\_gpu/src/tests/CMakeFiles/runner\_gpu.dir/build.make:176: pennylane\_lightning\_gpu/src/tests/runner\_gpu] Error 1  
make[3]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[2]: \*\*\* [CMakeFiles/Makefile2:1675: pennylane\_lightning\_gpu/src/tests/CMakeFiles/runner\_gpu.dir/all] Error 2  
make[2]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make[1]: \*\*\* [Makefile:146: all] Error 2  
make[1]: Leaving directory ‘/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/BuildTests’  
make: \*\*\* [Makefile:79: test-cpp] Error 2

---

<div class="post-metadata">

**Author:** ![mlxd](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/mlxd/32/526_2.png) [@mlxd](https://discuss.pennylane.ai/u/mlxd)\
**Post date:** [July 21, 2022, 2:09pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/7 "2022-07-21T14:09:06Z")

</div>

Hi @art thanks for trying out `lightning.gpu` on a Jetson device. Though, it is also worth mentioning that the library is written mostly for V100 and A100 GPUs, so the performance on an embedded platform may be limited as most workloads we focus on are FP64 rather than FP32.

We have not attempted to use `lightning.gpu` on any ARM-based hardware just yet, and so we cannot make any guarantees yet about how to get it working.

We do have some ideas that we will explore first, and aim to offer a suggestion as soon as we can confirm if they will work or not. In the mean-time, it should be possible to install cuquantum directly into the building Python env with `pip install cuquantum`, and have it available during the compilation stage.

We will post here again once we have a potential solution.

---

<div class="post-metadata">

**Author:** ![mlxd](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/mlxd/32/526_2.png) [@mlxd](https://discuss.pennylane.ai/u/mlxd)\
**Post date:** [July 22, 2022, 8:34pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/8 "2022-07-22T20:34:00Z")

</div>

Hi @art we were not able to verify this locally, but I may suggest trying the following until we can offer ARM wheels for LightningGPU.

* * *

- In the Lightning GPU repository, patch the [Dockerfile](https://github.com/PennyLaneAI/pennylane-lightning-gpu/blob/b4cb5c3c5367ccfb219ae72debfac2fd1bc524e6/docker/Dockerfile#L3) builder from `quay.io/pypa/manylinux2014_x86_64` to `quay.io/pypa/manylinux2014_aarch64`.
- Install docker/podman locally, and attempt to build using [these instructions](https://github.com/PennyLaneAI/pennylane-lightning-gpu#build-locally-with-docker).

* * *

If this works, please feel free to let us know. In the mean-time, we will aim to support ARM wheels for LightningGPU.

---

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [July 26, 2022, 9:41pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/9 "2022-07-26T21:41:57Z")

</div>

@mlxd Following are the first few lines in the Dockerfile. I also commented out the cuda-rhel7.repo download since it applies to x86\_64.  
The Jetson AGX already has cuda-11.4 from the JetPack 5.0.1 install of the NVIDIA SDK Manager.

Dockerfile:  
FROM [quay.io/pypa/manylinux2014\_aarch64](http://quay.io/pypa/manylinux2014_aarch64)

commented out - install missing packages  
commented out - RUN yum-config-manager --add-repo [https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86\_64/cuda-rhel7.repo](https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo) -y   
commented out - && yum clean all   
commented out - && yum -y install cuda cmake git openssh wget

RUN yum -y install cmake git openssh wget # removed cuda from here

However I get “failed to find nvcc” errors when running the docker build.  
nvcc is in /usr/local/cuda-11.4/bin and setting the cmake CUDAToolkit\_ROOT variable does not help.

running build\_ext  
░█░░░▀█▀░█▀▀░█░█░▀█▀░█▀█░▀█▀░█▀█░█▀▀░░░░█▀▀░█▀█░█░█  
░█░░░░█░░█░█░█▀█░░█░░█░█░░█░░█░█░█░█░░░░█░█░█▀▀░█░█  
░▀▀▀░▀▀▀░▀▀▀░▀░▀░░▀░░▀░▀░▀▀▀░▀░▀░▀▀▀░▀░░▀▀▀░▀░░░▀▀▀

– The CXX compiler identification is GNU 10.2.1  
– The C compiler identification is GNU 10.2.1  
CMake Error at /opt/\_internal/pipx/venvs/cmake/lib/python3.9/site-packages/cmake/data/share/cmake-3.22/Modules/CMakeDetermineCUDACompiler.cmake:179 (message):  
**Failed to find nvcc.**

**Compiler requires the CUDA toolkit. Please set the CUDAToolkit\_ROOT  
variable.**  
Call Stack (most recent call first):  
CMakeLists.txt:16 (project)

– Configuring incomplete, errors occurred!  
See also “/pennylane-lightning-gpu/build/temp.linux-aarch64-3.10/CMakeFiles/CMakeOutput.log”.  
See also “/pennylane-lightning-gpu/build/temp.linux-aarch64-3.10/CMakeFiles/CMakeError.log”.  
Traceback (most recent call last):  
File “/pennylane-lightning-gpu/setup.py”, line 149, in   
setup(classifiers=classifiers, \*\*(info))  
File “/pennylane-lightning-gpu/pyenv3.10/lib/python3.10/site-packages/setuptools/ **init**.py”, line 153, in setup  
return distutils.core.setup(\*\*attrs)  
File “/opt/\_internal/cpython-3.10.5/lib/python3.10/distutils/core.py”, line 148, in setup  
dist.run\_commands()  
File “/opt/\_internal/cpython-3.10.5/lib/python3.10/distutils/dist.py”, line 966, in run\_commands  
self.run\_command(cmd)  
File “/opt/\_internal/cpython-3.10.5/lib/python3.10/distutils/dist.py”, line 985, in run\_command  
cmd\_obj.run()  
File “/pennylane-lightning-gpu/pyenv3.10/lib/python3.10/site-packages/setuptools/command/build\_ext.py”, line 79, in run  
\_build\_ext.run(self)  
File “/opt/\_internal/cpython-3.10.5/lib/python3.10/distutils/command/build\_ext.py”, line 340, in run  
self.build\_extensions()  
File “/opt/\_internal/cpython-3.10.5/lib/python3.10/distutils/command/build\_ext.py”, line 449, in build\_extensions  
self.\_build\_extensions\_serial()  
File “/opt/\_internal/cpython-3.10.5/lib/python3.10/distutils/command/build\_ext.py”, line 474, in \_build\_extensions\_serial  
self.build\_extension(ext)  
File “/pennylane-lightning-gpu/setup.py”, line 87, in build\_extension  
subprocess.check\_call(  
File “/opt/\_internal/cpython-3.10.5/lib/python3.10/subprocess.py”, line 369, in check\_call  
raise CalledProcessError(retcode, cmd)  
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘/pennylane-lightning-gpu’, ‘-DCMAKE\_LIBRARY\_OUTPUT\_DIRECTORY=/pennylane-lightning-gpu/build/lib.linux-aarch64-3.10/pennylane\_lightning\_gpu’, ‘-DPYTHON\_EXECUTABLE=/pennylane-lightning-gpu/pyenv3.10/bin/python3’, ‘-DCMAKE\_BUILD\_TYPE=RelWithDebInfo’, ‘-GNinja’, ‘-DCMAKE\_MAKE\_PROGRAM=/pennylane-lightning-gpu/pyenv3.10/bin/ninja’, ‘-DCMAKE\_CUDA\_COMPILER=/usr/local/cuda/bin/nvcc’, ‘-DENABLE\_CLANG\_TIDY=0’]’ returned non-zero exit status 1.

---

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [July 27, 2022, 1:25am UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/10 "2022-07-27T01:25:16Z")

</div>

The CMake errors in the last post were due to the CUDA install location not being visible inside the docker build container. After copying the CUDA toolkit directory to the pennylane lightning-gpu directory the “COPY ./ /pennylane-lightning-gpu” inside the Dockerfile makes the CUDA toolkit folders available for the docker build. Also CUDAToolkit\_ROOT, CMAKE\_CUDA\_COMPILER, CUDA\_TOOLKIT\_ROOT\_DIR and CUQUANTUM\_SDK variables need to be set relative to the container path /pennylane-lightning-gpu in setup.py.

Lightning-gpu wheels for Python 3.7-3.10 are built.

Last few lines of the docker build:

—\> Running in bda48adc4921  
INFO:auditwheel.main\_repair:Repairing PennyLane\_Lightning\_GPU-0.24.1-cp310-cp310-linux\_aarch64.whl  
INFO:auditwheel.wheeltools:Previous filename tags: linux\_aarch64  
INFO:auditwheel.wheeltools:New filename tags: manylinux\_2\_17\_aarch64, manylinux2014\_aarch64  
INFO:auditwheel.wheeltools:Previous WHEEL info tags: cp310-cp310-linux\_aarch64  
INFO:auditwheel.wheeltools:New WHEEL info tags: cp310-cp310-manylinux\_2\_17\_aarch64, cp310-cp310-manylinux2014\_aarch64  
INFO:auditwheel.main\_repair:  
Fixed-up wheel written to /wheelhouse/PennyLane\_Lightning\_GPU-0.24.1-cp310-cp310-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.whl  
Excluding [‘libcudart.so.11.0’, ‘libcublasLt.so.11’, ‘libcublas.so.11’, ‘libcustatevec.so.1’]  
INFO:auditwheel.main\_repair:Repairing PennyLane\_Lightning\_GPU-0.24.1-cp37-cp37m-linux\_aarch64.whl  
INFO:auditwheel.wheeltools:Previous filename tags: linux\_aarch64  
INFO:auditwheel.wheeltools:New filename tags: manylinux\_2\_17\_aarch64, manylinux2014\_aarch64  
INFO:auditwheel.wheeltools:Previous WHEEL info tags: cp37-cp37m-linux\_aarch64  
INFO:auditwheel.wheeltools:New WHEEL info tags: cp37-cp37m-manylinux\_2\_17\_aarch64, cp37-cp37m-manylinux2014\_aarch64  
Excluding [‘libcudart.so.11.0’, ‘libcublasLt.so.11’, ‘libcublas.so.11’, ‘libcustatevec.so.1’]  
INFO:auditwheel.main\_repair:  
Fixed-up wheel written to /wheelhouse/PennyLane\_Lightning\_GPU-0.24.1-cp37-cp37m-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.whl  
INFO:auditwheel.main\_repair:Repairing PennyLane\_Lightning\_GPU-0.24.1-cp38-cp38-linux\_aarch64.whl  
INFO:auditwheel.wheeltools:Previous filename tags: linux\_aarch64  
INFO:auditwheel.wheeltools:New filename tags: manylinux\_2\_17\_aarch64, manylinux2014\_aarch64  
INFO:auditwheel.wheeltools:Previous WHEEL info tags: cp38-cp38-linux\_aarch64  
INFO:auditwheel.wheeltools:New WHEEL info tags: cp38-cp38-manylinux\_2\_17\_aarch64, cp38-cp38-manylinux2014\_aarch64  
INFO:auditwheel.main\_repair:  
Fixed-up wheel written to /wheelhouse/PennyLane\_Lightning\_GPU-0.24.1-cp38-cp38-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.whl  
Excluding [‘libcudart.so.11.0’, ‘libcublasLt.so.11’, ‘libcublas.so.11’, ‘libcustatevec.so.1’]  
INFO:auditwheel.main\_repair:Repairing PennyLane\_Lightning\_GPU-0.24.1-cp39-cp39-linux\_aarch64.whl  
INFO:auditwheel.wheeltools:Previous filename tags: linux\_aarch64  
INFO:auditwheel.wheeltools:New filename tags: manylinux\_2\_17\_aarch64, manylinux2014\_aarch64  
INFO:auditwheel.wheeltools:Previous WHEEL info tags: cp39-cp39-linux\_aarch64  
INFO:auditwheel.wheeltools:New WHEEL info tags: cp39-cp39-manylinux\_2\_17\_aarch64, cp39-cp39-manylinux2014\_aarch64  
INFO:auditwheel.main\_repair:  
Fixed-up wheel written to /wheelhouse/PennyLane\_Lightning\_GPU-0.24.1-cp39-cp39-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.whl  
Excluding [‘libcudart.so.11.0’, ‘libcublasLt.so.11’, ‘libcublas.so.11’, ‘libcustatevec.so.1’]  
Removing intermediate container bda48adc4921  
—\> fa8e127df52e  
Successfully built fa8e127df52e  
Successfully tagged lightning-gpu-wheels:latest

docker image ls  
REPOSITORY TAG IMAGE ID CREATED SIZE  
lightning-gpu-wheels latest fa8e127df52e 29 minutes ago 9.16GB

ls -lt wheelhouse  
-rw-r–r-- 1 root root 16506230 Jul 27 01:01 PennyLane\_Lightning\_GPU-0.24.1-cp310-cp310-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.whl  
-rw-r–r-- 1 root root 16255981 Jul 27 01:01 PennyLane\_Lightning\_GPU-0.24.1-cp37-cp37m-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.whl  
-rw-r–r-- 1 root root 16454057 Jul 27 01:01 PennyLane\_Lightning\_GPU-0.24.1-cp38-cp38-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.whl  
-rw-r–r-- 1 root root 16536699 Jul 27 01:01 PennyLane\_Lightning\_GPU-0.24.1-cp39-cp39-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.whl

After installing the 3.10 wheel and running the script:  
import pennylane as qml  
dev = qml.device(“lightning.gpu”, wires=1)  
@qml.qnode(dev)  
def circuit():  
qml.PauliX(0)  
return qml.expval(qml.PauliZ(0))  
circuit()

I get the same warning:

/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/lightning\_gpu.py:73: UserWarning: No module named ‘pennylane\_lightning\_gpu.lightning\_gpu\_qubit\_ops’  
warn(str(e), UserWarning)  
/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/lightning\_gpu.py:413: RuntimeWarning:  
!!!#####################################################################################  
!!!  
!!! WARNING: INSUFFICIENT SUPPORT DETECTED FOR GPU DEVICE WITH `lightning.gpu`  
!!! DEFAULTING TO CPU DEVICE `lightning.qubit`  
!!!  
!!!#####################################################################################

warn(

make test-python  
outputs an undefined symbol warning:

…/…/…/…/home/arthurlobo/.conda/envs/qml\_py310\_b/lib/python3.10/site-packages/pennylane\_lightning\_gpu/lightning\_gpu.py:73  
/home/arthurlobo/.conda/envs/qml\_py310\_b/lib/python3.10/site-packages/pennylane\_lightning\_gpu/lightning\_gpu.py:73: UserWarning: /home/arthurlobo/.conda/envs/qml\_py310\_b/lib/python3.10/site-packages/pennylane\_lightning\_gpu/lightning\_gpu\_qubit\_ops.cpython-310-aarch64-linux-gnu.so: undefined symbol: custatevecSamplerDestroy

---

<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:** [July 27, 2022, 11:01pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/11 "2022-07-27T23:01:40Z")

</div>

Hi @art, this looks like it’s still related to CUDA because the error says `undefined symbol: custatevecSamplerDestroy`

It may be related to the ARM architecture.

---

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [July 28, 2022, 12:36am UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/12 "2022-07-28T00:36:05Z")

</div>

@CatalinaAlbornoz the custatevecSamplerDestroy function is defined in the cuQuantum libcustatevec.so.1.0.0.41.so library:

From readelf -sW of the .so file (to display the symbol table):  
Num: Value Size Type Bind Vis Ndx Name  
.  
.  
.  
20538: 00000000000a7308 536 FUNC GLOBAL DEFAULT 12 custatevecSamplerDestroy  
.  
.  
.  
but is not getting linked in the docker build.

---

<div class="post-metadata">

**Author:** ![mlxd](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/mlxd/32/526_2.png) [@mlxd](https://discuss.pennylane.ai/u/mlxd)\
**Post date:** [July 29, 2022, 2:03pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/13 "2022-07-29T14:03:19Z")

</div>

Hi @art  
When we build the wheels for PennyLane we explicitly strip out any CUDA-based libraries from the final product. We do this as it ensures users can install the libraries on their preferred machine, and the dynamic libs should be picked up at runtime (assuming they are on the user’s path).

It looks to me that the cuquantum library is not available on your system we trying to run the above example, or if it is available the binary cannot see it. With the latest cuQuantum release, the path to the libraries in the `pip install cuquantum` install method move from `lib` to `lib64`. It may be possible that the fix we added for this is not present yet in the version you have cloned for compilation.

Can you try explicitly setting the `LD_LIBRARY_PATH` environment variable to the location of the cuquantum libs on your system (as well as the other associated CUDA libs) and see if that makes a difference to the above issue at run-time?

---

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [July 29, 2022, 4:05pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/14 "2022-07-29T16:05:32Z")

</div>

@mlxd thanks for pointing out the .so dynamic vs .a static distinction. I knew it but phrased my question incorrectly. Checking on the LD\_LIBRARY\_PATH variable.

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [July 29, 2022, 9:45pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/15 "2022-07-29T21:45:08Z")

</div>

Definitely get back to us when you’ve checked!

---

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [August 1, 2022, 10:43pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/16 "2022-08-01T22:43:11Z")

</div>

@isaacdevlugt the CUDA 11.7 and cuQuantum 22.07 libraries (including libcustatevec.so) are in

~/.conda/envs/qml\_py38/lib (LD\_LIBRARY\_PATH variable was set to this path)

and the pennylane lightning gpu libraries:  
lightning\_gpu\_qubit\_ops.cpython-38-aarch64-linux-gnu.so and lightning\_qubit\_ops.cpython-38-aarch64-linux-gnu.so

are in

~/.conda/envs/qml\_py38/lib/python3.8/site-packages/pennylane\_lightning\_gpu

where qml\_py38 is my python 3.8 conda environment created  
specifically to install cupy-cuda11x (pip install cupy-cuda11x -f [https://pip.cupy.dev/aarch64](https://pip.cupy.dev/aarch64)). I ended up having to uninstall cupy-cuda11x since it conflicts with the cupy 11.0 installed when cuQuantum was installed (conda install -c conda-forge cuquantum-python==22.07).

I get a custatevec not initialized error. Following is the output from the  
test script:

Name: PennyLane  
Version: 0.24.0  
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.  
Home-page: [https://github.com/XanaduAI/pennylane](https://github.com/XanaduAI/pennylane)  
Author:  
Author-email:  
License: Apache License 2.0  
Location: /home/arthurlobo/.conda/envs/qml\_py38/lib/python3.8/site-packages  
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, retworkx, scipy, semantic-version, toml  
Required-by: PennyLane-Lightning, PennyLane-Lightning-GPU

Platform info: Linux-5.10.65-tegra-aarch64-with-glibc2.26  
Python version: 3.8.13  
Numpy version: 1.19.5  
Scipy version: 1.9.0  
Installed devices:

- lightning.gpu (PennyLane-Lightning-GPU-0.24.1)
- lightning.qubit (PennyLane-Lightning-0.24.0)
- default.gaussian (PennyLane-0.24.0)
- default.mixed (PennyLane-0.24.0)
- default.qubit (PennyLane-0.24.0)
- default.qubit.autograd (PennyLane-0.24.0)
- default.qubit.jax (PennyLane-0.24.0)
- default.qubit.tf (PennyLane-0.24.0)
- default.qubit.torch (PennyLane-0.24.0)  
Traceback (most recent call last):  
File “test2.py”, line 3, in   
dev = qml.device(“lightning.gpu”, wires=1)  
File “/home/arthurlobo/.conda/envs/qml\_py38/lib/python3.8/site-packages/pennylane/ **init**.py”, line 316, in device  
dev = plugin\_device\_class(\*args, \*\*options)  
File “/media/arthurlobo/QML/pennylane-lightning-gpu-0.24.1/pennylane\_lightning\_gpu/lightning\_gpu.py”, line 109, in **init**  
self.\_gpu\_state = \_gpu\_dtype(self.\_state.dtype)(self.\_state)  
pennylane\_lightning\_gpu.lightning\_gpu\_qubit\_ops.PLException: [/pennylane-lightning-gpu/pennylane\_lightning\_gpu/src/simulator/StateVectorCudaManaged.hpp][Line:200][Method:StateVectorCudaManaged]: Error in PennyLane Lightning: custatevec not initialized

---

<div class="post-metadata">

**Author:** ![art](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/art/32/1126_2.png) [@art](https://discuss.pennylane.ai/u/art)\
**Post date:** [August 2, 2022, 12:51am UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/17 "2022-08-02T00:51:57Z")

</div>

For the earlier python 3.10 environment  
“pytest tests” from the cuQuantum/python directory runs.  
(Ref: [https://docs.nvidia.com/cuda/cuquantum/python/README.html#running](https://docs.nvidia.com/cuda/cuquantum/python/README.html#running))

test session starts =============================================================  
platform linux – Python 3.10.4, pytest-7.1.2, pluggy-1.0.0  
rootdir: /media/arthurlobo/QML/cuQuantum/python  
plugins: mock-3.8.2, flaky-3.7.0  
collected 30031 items

tests/cuquantum\_tests/custatevec\_tests/test\_custatevec.py …EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [0%]  
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE [0%]  
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEsssss [1%]  
sssssssssssEEEEssssssssEEEE…F [1%]  
tests/cuquantum\_tests/cutensornet\_tests/test\_circuit\_converter.py ssssssss [1%]  
tests/cuquantum\_tests/cutensornet\_tests/test\_contract.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [1%]  
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [1%]  
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [2%]  
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [2%]  
.  
.  
.  
.  
currently at 22%

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [August 3, 2022, 1:20pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/18 "2022-08-03T13:20:39Z")

</div>

Hey @art! Thanks for providing this information. I can confirm that our performance team (including @mlxd) is looking into this further. We will update you as soon as we can!

---

<div class="post-metadata">

**Author:** ![mlxd](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/mlxd/32/526_2.png) [@mlxd](https://discuss.pennylane.ai/u/mlxd)\
**Post date:** [August 8, 2022, 8:07pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/19 "2022-08-08T20:07:02Z")

</div>

Hi @art  
Just to jump back onto this: there was a CUDA context leaked which caused the above errors, as no new GPU RAM was able to be allocated. This will be fixed for the upcoming release of Lightning GPU and go live at the start of next week. I’ll tag here once the PR is merged into the main branch if you wish to explore this early.

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [August 8, 2022, 9:06pm UTC](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033/20 "2022-08-08T21:06:57Z")

</div>

@mlxd Nice! 💪

[Next page](https://discuss.pennylane.ai/t/lightning-gpu-0-25-on-jetson-xavier-nx/2033.md?page=2)
