Pennylane Lightning GPU not working

Hi, I am currently using NVIDIA DGX A100 GPU. When I am running the code using Lightning GPU, I am getting the error. The code I am running is:

wires=4
dev4 = qml.device('lightning.gpu', wires=wires )
@qml.qnode(dev4)
def CONVCircuit(phi, wires, i=0):
    """
    quantum convolution Node
    """
    # parameter
    theta = np.pi / 2
    qml.Rot(phi[0]*2*np.pi/255,phi[1]*2*np.pi/255,phi[2]*2*np.pi/255, wires=0)
    qml.Rot(phi[3]*2*np.pi/255,phi[4]*2*np.pi/255,phi[5]*2*np.pi/255, wires=1)
    qml.Rot(phi[6]*2*np.pi/255,phi[7]*2*np.pi/255,phi[8]*2*np.pi/255, wires=2)
    qml.Rot(phi[9]*2*np.pi/255,phi[10]*2*np.pi/255,phi[11]*2*np.pi/255, wires=3)

    qml.RX(np.pi, wires=0)
    qml.RX(np.pi, wires=1)
    qml.RX(np.pi, wires=2)
    qml.RX(np.pi, wires=3)

    qml.CRZ(theta, wires=[1, 0])
    qml.CRZ(theta, wires=[3, 2])
    qml.CRX(theta, wires=[1, 0])
    qml.CRX(theta, wires=[3, 2])
    qml.CRZ(theta, wires=[2, 0])
    qml.CRX(theta, wires=[2, 0])

    # Expectation value
    measurement = qml.expval(qml.PauliZ(wires=0))

    return measurement

The full error message is below:

PLException: [/project/pennylane_lightning_gpu/src/util/DataBuffer.hpp][Line:37][Method:DataBuffer]: Error in PennyLane Lightning: the provided PTX was compiled with an unsupported toolchain.

The output of qml.about() is:

Name: PennyLane
Version: 0.28.0
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: https://github.com/XanaduAI/pennylane
Author: 
Author-email: 
License: Apache License 2.0
Location: /dgxb_home/se21pphy004/miniconda3/envs/myenv/lib/python3.8/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, retworkx, scipy, semantic-version, toml
Required-by: PennyLane-Lightning, PennyLane-Lightning-GPU

Platform info:           Linux-5.4.0-144-generic-x86_64-with-glibc2.17
Python version:          3.8.17
Numpy version:           1.24.3
Scipy version:           1.10.1
Installed devices:
- default.gaussian (PennyLane-0.28.0)
- default.mixed (PennyLane-0.28.0)
- default.qubit (PennyLane-0.28.0)
- default.qubit.autograd (PennyLane-0.28.0)
- default.qubit.jax (PennyLane-0.28.0)
- default.qubit.tf (PennyLane-0.28.0)
- default.qubit.torch (PennyLane-0.28.0)
- default.qutrit (PennyLane-0.28.0)
- null.qubit (PennyLane-0.28.0)
- lightning.qubit (PennyLane-Lightning-0.28.0)
- lightning.gpu (PennyLane-Lightning-GPU-0.28.0)

The nvcc version is:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_Sep_13_19:13:29_PDT_2021
Cuda compilation tools, release 11.5, V11.5.50
Build cuda_11.5.r11.5/compiler.30411180_0

Can anyone tell me what I should add, remove or upgrade any packages?

Hi @mass_of_15, I see you had a similar problem a few months ago.
Is there any chance the instructions here or here already help you? :slight_smile:

If not, let me know and we’ll see what we can do — but it would be really helpful if you could share the (full) runnable Python file with us. That way we can check the details.

Hi @Ivana_at_Xanadu, The instructions were helpful when I used DGX V100; now, I am using DGX A100 as the university has upgraded its DGX systems. Is it because of the compatibility issue between Pennylane and the DGX server?
Also, the code is the same as given here in my first post: Pennylane-Lightning GPU.

HI @mass_of_15

Can you request the CUDA toolchain to be updated to 11.7/11.8 on the system you are running – for the best support with the Ampere architecture, you may need a newer version of the toolchain.

I’d also suggest upgrading your version of PennyLane to the latest (0.31), and ensuring you are using the CUDA 11 version of cuQuantum (python -m pip install custatevec-cu11).

2 Likes