Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building wheel for nvtx (PEP 517) ... error #43

Closed
reeva-mishra opened this issue May 19, 2021 · 13 comments
Closed

Building wheel for nvtx (PEP 517) ... error #43

reeva-mishra opened this issue May 19, 2021 · 13 comments

Comments

@reeva-mishra
Copy link

reeva-mishra commented May 19, 2021

I am trying to install nvtx on Jetson Nano. However, I get the error:

ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpbbid0wvf
       cwd: /tmp/pip-install-r4jbfqi6/nvtx_522b0ae8d511499ab4698e708b64cfe1
  Complete output (26 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.6
  creating build/lib.linux-aarch64-3.6/nvtx
  copying nvtx/nvtx.py -> build/lib.linux-aarch64-3.6/nvtx
  copying nvtx/__init__.py -> build/lib.linux-aarch64-3.6/nvtx
  copying nvtx/colors.py -> build/lib.linux-aarch64-3.6/nvtx
  creating build/lib.linux-aarch64-3.6/nvtx/utils
  copying nvtx/utils/__init__.py -> build/lib.linux-aarch64-3.6/nvtx/utils
  copying nvtx/utils/cached.py -> build/lib.linux-aarch64-3.6/nvtx/utils
  creating build/lib.linux-aarch64-3.6/nvtx/_lib
  copying nvtx/_lib/__init__.py -> build/lib.linux-aarch64-3.6/nvtx/_lib
  copying nvtx/_lib/lib.pxd -> build/lib.linux-aarch64-3.6/nvtx/_lib
  running build_ext
  building 'nvtx._lib.lib' extension
  creating build/temp.linux-aarch64-3.6
  creating build/temp.linux-aarch64-3.6/nvtx
  creating build/temp.linux-aarch64-3.6/nvtx/_lib
  aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/usr/include/python3.6m -c nvtx/_lib/lib.c -o build/temp.linux-aarch64-3.6/nvtx/_lib/lib.o
  nvtx/_lib/lib.c:632:10: fatal error: nvtx3/nvToolsExt.h: No such file or directory
   #include "nvtx3/nvToolsExt.h"
            ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for nvtx
Failed to build nvtx
ERROR: Could not build wheels for nvtx which use PEP 517 and cannot be installed directly

I would appreciate some help on this. Thanks.

@shwina
Copy link
Contributor

shwina commented May 19, 2021

Hi @reeva-mishra. Thanks for reporting. Could you please provide the commands that reproduce this error for you?

@PonyMaY
Copy link

PonyMaY commented Sep 22, 2021

Hi @shwina! We also have met this issue. We just use python -m pip install nvtx to install nvtx on Jetson NX. And we also meet the PEP 517 error.

@shwina
Copy link
Contributor

shwina commented Sep 22, 2021

Ah, looks like it's because there's no built wheels for aarch64-linux-gnu-gcc on PyPI. I'll look further into this.

In the meantime, is using conda at all an option for you?

conda install -c conda-forge nvtx

Otherwise, cloning the dev branch and building from source is an alternative (assumes you have Cython installed):

git clone -b dev https://github.com/NVIDIA/NVTX
cd NVTX/python
C_INCLUDE_PATH=../c/include/ python  setup.py build_ext
python setup.py install

@PonyMaY
Copy link

PonyMaY commented Sep 23, 2021

Otherwise, cloning the dev branch and building from source is an alternative (assumes you have Cython installed):

Thank you for your quick reply! I choose this method to solve. But it still get wrong with aarch64-linux-gnu-gcc. The log is written below:

python3 setup.py build_ext --inplace
running build_ext
building 'nvtx._lib.lib' extension
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/usr/include/python3.6m -c nvtx/_lib/lib.c -o build/temp.linux-aarch64-3.6/nvtx/_lib/lib.o
nvtx/_lib/lib.c:640:10: fatal error: nvtx3/nvToolsExt.h: No such file or directory
#include "nvtx3/nvToolsExt.h"
^~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

@shwina
Copy link
Contributor

shwina commented Sep 23, 2021

My apologies @PonyMaY - my instructions assumed that one has the NVTX C library header installed already. I've edited the commands to include setting the C_INCLUDE_PATH to the location of the header. Since the C library is header-only, this is the only change you will need. Could you please try the updated command to see if that works? Sorry for the trouble.

@PonyMaY
Copy link

PonyMaY commented Sep 23, 2021

@shwina Sorry to bother you again. I have used the newest command you provided, but the same issue came when i run this linepython -m pip install . It still meets wrong with error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

@shwina
Copy link
Contributor

shwina commented Sep 24, 2021

Thanks @PonyMaY -- I've (again) tweaked the commands a bit to use python setup.py install instead of pip install. Apparently, using pip install . forces a rebuild for some reason. Could you please try now?

@PonyMaY
Copy link

PonyMaY commented Sep 25, 2021

Thank you @shwina for your help! Now it's successful to install.

@schegde
Copy link

schegde commented Oct 13, 2021

Thank you @shwina! I had the same issue on Jetson AGX Xavier, but installing from dev branch source (with additonal pip install Cython before that) did the job.

@mzy97
Copy link

mzy97 commented Nov 2, 2021

Ah, looks like it's because there's no built wheels for aarch64-linux-gnu-gcc on PyPI. I'll look further into this.

In the meantime, is using conda at all an option for you?

conda install -c conda-forge nvtx

Otherwise, cloning the dev branch and building from source is an alternative (assumes you have Cython installed):

git clone -b dev https://github.com/NVIDIA/NVTX
cd NVTX/python
C_INCLUDE_PATH=../c/include/ python  setup.py build_ext
python setup.py install

Hi, I followed this tutorial and successful build the nvtx module, but when import it in python, it raise this error:

isaac@isaac-desktop:~/NVTX/python$ python3
Python 3.7.5 (default, Feb 23 2021, 13:22:40)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nvtx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/isaac/NVTX/python/nvtx/__init__.py", line 7, in <module>
    from nvtx.nvtx import (
  File "/home/isaac/NVTX/python/nvtx/nvtx.py", line 12, in <module>
    from nvtx._lib import (
  File "/home/isaac/NVTX/python/nvtx/_lib/__init__.py", line 7, in <module>
    from nvtx._lib.lib import (
ModuleNotFoundError: No module named 'nvtx._lib.lib'
>>>

@shwina

@ustinian99
Copy link

Ah, looks like it's because there's no built wheels for aarch64-linux-gnu-gcc on PyPI. I'll look further into this.
In the meantime, is using conda at all an option for you?

conda install -c conda-forge nvtx

Otherwise, cloning the dev branch and building from source is an alternative (assumes you have Cython installed):

git clone -b dev https://github.com/NVIDIA/NVTX
cd NVTX/python
C_INCLUDE_PATH=../c/include/ python  setup.py build_ext
python setup.py install

Hi, I followed this tutorial and successful build the nvtx module, but when import it in python, it raise this error:

isaac@isaac-desktop:~/NVTX/python$ python3
Python 3.7.5 (default, Feb 23 2021, 13:22:40)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nvtx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/isaac/NVTX/python/nvtx/__init__.py", line 7, in <module>
    from nvtx.nvtx import (
  File "/home/isaac/NVTX/python/nvtx/nvtx.py", line 12, in <module>
    from nvtx._lib import (
  File "/home/isaac/NVTX/python/nvtx/_lib/__init__.py", line 7, in <module>
    from nvtx._lib.lib import (
ModuleNotFoundError: No module named 'nvtx._lib.lib'
>>>

@shwina

@mzy97
Hi! I had the same problem. Could you tell me how to solve it?

@shwina
Copy link
Contributor

shwina commented Aug 17, 2022

NVTX should now have wheels for aarch64. I'm closing this issue, but please feel free to reopen if there are any issues still.

@shwina shwina closed this as completed Aug 17, 2022
@erwincoumans
Copy link

Similar issue to build NVTX on Windows, I fixed it by adding the include_dirs line to setup.py:

'''
setup(
name="nvtx",
version="0.2.5",
description="PyNVTX - Python code annotation library",
url="https://github.com/NVIDIA/nvtx",
author="NVIDIA Corporation",
license="Apache 2.0",
include_dirs=["C:/Program Files/NVIDIA Corporation/Nsight Systems 2022.4.1/target-windows-x64/nvtx/include"],
'''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants