Pennylane lightning on GH200

Hi I’m want to run a simulation on my GH200 (Grace Hopper Nvidia). The GH200 has arm architecture. When trying to build lightning from the source I get the following errors, It’s important to note I’m running this in a cuquantum container provided by nvidia:
(cuquantum-24.03) cuquantum@7806514dd020:~/pennylane-lightning$ sudo PL_BACKEND=“lightning_qubit” pip install -e . -vv
Using pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
Non-user install because site-packages writeable
Created temporary directory: /tmp/pip-ephem-wheel-cache-xq198xy3
Created temporary directory: /tmp/pip-req-tracker-flf3bk8o
Initialized build tracking at /tmp/pip-req-tracker-flf3bk8o
Created build tracker: /tmp/pip-req-tracker-flf3bk8o
Entered build tracker: /tmp/pip-req-tracker-flf3bk8o
Created temporary directory: /tmp/pip-install-2aowf85z
Obtaining file:///home/cuquantum/pennylane-lightning
Added file:///home/cuquantum/pennylane-lightning to build tracker ‘/tmp/pip-req-tracker-flf3bk8o’
Running setup.py (path:/home/cuquantum/pennylane-lightning/setup.py) egg_info for package from file:///home/cuquantum/pennylane-lightning
Created temporary directory: /tmp/pip-pip-egg-info-jfksd9qt
Running command python setup.py egg_info
/usr/lib/python3/dist-packages/setuptools/dist.py:493: UserWarning: Normalizing ‘0.37.0-dev18’ to ‘0.37.0.dev18’
warnings.warn(tmpl.format(**locals()))
running egg_info
creating /tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info
writing /tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info/dependency_links.txt
writing entry points to /tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info/entry_points.txt
writing requirements to /tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info/requires.txt
writing top-level names to /tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info/top_level.txt
writing manifest file ‘/tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info/SOURCES.txt’
reading manifest file ‘/tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no files found matching ‘pennylane_lightning/lightning_qpu/lightning_gpu.toml’
adding license file ‘LICENSE’
writing manifest file ‘/tmp/pip-pip-egg-info-jfksd9qt/PennyLane_Lightning.egg-info/SOURCES.txt’
Preparing metadata (setup.py) … done
Source in /home/cuquantum/pennylane-lightning has version 0.37.0.dev18, which satisfies requirement PennyLane-Lightning==0.37.0.dev18 from file:///home/cuquantum/pennylane-lightning
Removed PennyLane-Lightning==0.37.0.dev18 from file:///home/cuquantum/pennylane-lightning from build tracker ‘/tmp/pip-req-tracker-flf3bk8o’
Requirement already satisfied: pennylane>=0.34 in /usr/local/lib/python3.10/dist-packages (from PennyLane-Lightning==0.37.0.dev18) (0.36.0)
Requirement already satisfied: rustworkx in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (0.14.2)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (4.12.0)
Requirement already satisfied: numpy<2.0 in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (1.26.4)
Requirement already satisfied: semantic-version>=2.7 in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (2.10.0)
Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (3.3)
Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (2.32.2)
Requirement already satisfied: autoray>=0.6.1 in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (0.6.12)
Requirement already satisfied: scipy in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (1.13.1)
Requirement already satisfied: cachetools in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (5.3.3)
Requirement already satisfied: autograd in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (1.6.2)
Requirement already satisfied: toml in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (0.10.2)
Requirement already satisfied: appdirs in /usr/local/lib/python3.10/dist-packages (from pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (1.4.4)
Requirement already satisfied: future>=0.15.2 in /usr/local/lib/python3.10/dist-packages (from autograd->pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (1.0.0)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (2.2.1)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (2024.2.2)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->pennylane>=0.34->PennyLane-Lightning==0.37.0.dev18) (3.7)
Created temporary directory: /tmp/pip-unpack-z5ii51e9
Installing collected packages: PennyLane-Lightning
Running setup.py develop for PennyLane-Lightning
Running command python setup.py develop
/usr/lib/python3/dist-packages/setuptools/dist.py:493: UserWarning: Normalizing ‘0.37.0-dev18’ to ‘0.37.0.dev18’
warnings.warn(tmpl.format(**locals()))
running develop
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
writing PennyLane_Lightning.egg-info/PKG-INFO
writing dependency_links to PennyLane_Lightning.egg-info/dependency_links.txt
writing entry points to PennyLane_Lightning.egg-info/entry_points.txt
writing requirements to PennyLane_Lightning.egg-info/requires.txt
writing top-level names to PennyLane_Lightning.egg-info/top_level.txt
reading manifest file ‘PennyLane_Lightning.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no files found matching ‘pennylane_lightning/lightning_qpu/lightning_gpu.toml’
adding license file ‘LICENSE’
writing manifest file ‘PennyLane_Lightning.egg-info/SOURCES.txt’
running build_ext
error: [Errno 2] No such file or directory: ‘cmake’
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /usr/bin/python3 -c '
exec(compile('"'"''"'"''"'"'
# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
#   import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
#   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
#     manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize

try:
    import setuptools
except ImportError as error:
    print(
        "ERROR: Can not execute `setup.py` since setuptools is not available in "
        "the build environment.",
        file=sys.stderr,
    )
    sys.exit(1)

__file__ = %r
sys.argv[0] = __file__

if os.path.exists(__file__):
    filename = __file__
    with tokenize.open(__file__) as f:
        setup_py_code = f.read()
else:
    filename = "<auto-generated setuptools caller>"
    setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/home/cuquantum/pennylane-lightning/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
cwd: /home/cuquantum/pennylane-lightning/

error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Exception information:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py”, line 165, in exc_logging_wrapper
status = run_func(*args)
File “/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py”, line 205, in wrapper
return func(self, options, args)
File “/usr/lib/python3/dist-packages/pip/_internal/commands/install.py”, line 405, in run
installed = install_given_reqs(
File “/usr/lib/python3/dist-packages/pip/_internal/req/init.py”, line 73, in install_given_reqs
requirement.install(
File “/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py”, line 743, in install
install_editable_legacy(
File “/usr/lib/python3/dist-packages/pip/_internal/operations/install/editable_legacy.py”, line 43, in install_editable
call_subprocess(
File “/usr/lib/python3/dist-packages/pip/_internal/utils/subprocess.py”, line 224, in call_subprocess
raise error
pip._internal.exceptions.InstallationSubprocessError: python setup.py develop exited with 1
Removed build tracker: ‘/tmp/pip-req-tracker-flf3bk8o’

Hi @giladqm

I believe the answer provided to your question at Using docker pennylane-lightning-gpu on GH200 · Issue #742 · PennyLaneAI/pennylane-lightning · GitHub should help with the above issue.

Let us know if you need any thing else.