NVIDIA / nvtx-plugins

Python bindings for NVTX
https://docs.nvidia.com/deeplearning/frameworks/nvtx-plugins/user-guide/docs/en/stable/
Apache License 2.0
66 stars 15 forks source link

Problems installing from pypi with tf >= 2.2 #18

Closed zaccharieramzi closed 3 years ago

zaccharieramzi commented 4 years ago

When installing nvtx-plugins from pypi with pip install nvtx-plugins, I have the following error:

Building wheels for collected packages: nvtx-plugins
  Building wheel for nvtx-plugins (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ilc5zap1/nvtx-plugins/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ilc5zap1/nvtx-plugins/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-mgcuvvq0
       cwd: /tmp/pip-install-ilc5zap1/nvtx-plugins/
  Complete output (55 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/nvtx
  creating build/lib.linux-x86_64-3.6/nvtx/plugins
  creating build/lib.linux-x86_64-3.6/nvtx/plugins/tf
  copying nvtx_plugins/python/nvtx/plugins/tf/ops.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
  copying nvtx_plugins/python/nvtx/plugins/tf/estimator.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
  copying nvtx_plugins/python/nvtx/plugins/tf/package_info.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
  copying nvtx_plugins/python/nvtx/plugins/tf/__init__.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
  copying nvtx_plugins/python/nvtx/plugins/tf/ext_utils.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
  copying nvtx_plugins/python/nvtx/plugins/tf/base_callbacks.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
  creating build/lib.linux-x86_64-3.6/nvtx/plugins/tf/keras
  copying nvtx_plugins/python/nvtx/plugins/tf/keras/layers.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf/keras
  copying nvtx_plugins/python/nvtx/plugins/tf/keras/callbacks.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf/keras
  copying nvtx_plugins/python/nvtx/plugins/tf/keras/__init__.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf/keras
  running egg_info
  writing nvtx_plugins/python/nvtx_plugins.egg-info/PKG-INFO
  writing dependency_links to nvtx_plugins/python/nvtx_plugins.egg-info/dependency_links.txt
  writing requirements to nvtx_plugins/python/nvtx_plugins.egg-info/requires.txt
  writing top-level names to nvtx_plugins/python/nvtx_plugins.egg-info/top_level.txt
  reading manifest file 'nvtx_plugins/python/nvtx_plugins.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.so' under directory 'nvtx_plugins/'
  warning: no files found matching '*.lds'
  writing manifest file 'nvtx_plugins/python/nvtx_plugins.egg-info/SOURCES.txt'
  running build_ext
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c++11 -fPIC -O2 -Wall -I/usr/include/python3.6m -I/volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/include/python3.6m -c build/temp.linux-x86_64-3.6/test_compile/test_cpp_flags.cc -o build/temp.linux-x86_64-3.6/test_compile/test_cpp_flags.o
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/test_compile/test_cpp_flags.o -o build/temp.linux-x86_64-3.6/test_compile/test_cpp_flags.so
  x86_64-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/python3.6m -I/volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/include/python3.6m -c build/temp.linux-x86_64-3.6/test_compile/test_link_flags.cc -o build/temp.linux-x86_64-3.6/test_compile/test_link_flags.o
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/test_compile/test_link_flags.o -o build/temp.linux-x86_64-3.6/test_compile/test_link_flags.so
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c++11 -fPIC -O2 -Wall -I/usr/local/cuda/include -I/usr/include/python3.6m -I/volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/include/python3.6m -c build/temp.linux-x86_64-3.6/test_compile/test_cuda.cc -o build/temp.linux-x86_64-3.6/test_compile/test_cuda.o
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/test_compile/test_cuda.o -L/usr/local/cuda/lib -L/usr/local/cuda/lib64 -lcudart -o build/temp.linux-x86_64-3.6/test_compile/test_cuda.so
  ===========================================================================================
  INFO: Compiler /usr/bin/g++ (version 5.4.0 20160609) is not usable for this TensorFlow installation. Require g++ (version >=7.3.1 20180303, <999).
  ===========================================================================================
  ===========================================================================================
  INFO: Compiler /usr/bin/g++-5 (version 5.4.0 20160609) is not usable for this TensorFlow installation. Require g++ (version >=7.3.1 20180303, <999).
  ===========================================================================================
  ===========================================================================================
  INFO: Unable to build TensorFlow plugin, will skip it.

  Traceback (most recent call last):
    File "/tmp/pip-install-ilc5zap1/nvtx-plugins/setup_utils.py", line 372, in build_extensions
      build_tf_extension(self, extension, options)
    File "/tmp/pip-install-ilc5zap1/nvtx-plugins/setup_utils.py", line 464, in build_tf_extension
      'Could not find compiler compatible with this TensorFlow installation.\n'
  distutils.errors.DistutilsPlatformError: Could not find compiler compatible with this TensorFlow installation.
  Please check the NVTX-Plugins Github Repository for recommended compiler versions.
  To force a specific compiler version, set CC and CXX environment variables.

  ===========================================================================================
  error: TensorFlow plugin: `nvtx.plugins.tf.lib.nvtx_ops` failed to build. Aborting.
  ----------------------------------------
  ERROR: Failed building wheel for nvtx-plugins
  Running setup.py clean for nvtx-plugins
Failed to build nvtx-plugins
Installing collected packages: nvtx-plugins
    Running setup.py install for nvtx-plugins ... error
    ERROR: Command errored out with exit status 1:
     command: /volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ilc5zap1/nvtx-plugins/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ilc5zap1/nvtx-plugins/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-cbio1ooi/install-record.txt --single-version-externally-managed --compile --install-headers /volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/include/site/python3.6/nvtx-plugins
         cwd: /tmp/pip-install-ilc5zap1/nvtx-plugins/
    Complete output (55 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/nvtx
    creating build/lib.linux-x86_64-3.6/nvtx/plugins
    creating build/lib.linux-x86_64-3.6/nvtx/plugins/tf
    copying nvtx_plugins/python/nvtx/plugins/tf/ops.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
    copying nvtx_plugins/python/nvtx/plugins/tf/estimator.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
    copying nvtx_plugins/python/nvtx/plugins/tf/package_info.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
    copying nvtx_plugins/python/nvtx/plugins/tf/__init__.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
    copying nvtx_plugins/python/nvtx/plugins/tf/ext_utils.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
    copying nvtx_plugins/python/nvtx/plugins/tf/base_callbacks.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf
    creating build/lib.linux-x86_64-3.6/nvtx/plugins/tf/keras
    copying nvtx_plugins/python/nvtx/plugins/tf/keras/layers.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf/keras
    copying nvtx_plugins/python/nvtx/plugins/tf/keras/callbacks.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf/keras
    copying nvtx_plugins/python/nvtx/plugins/tf/keras/__init__.py -> build/lib.linux-x86_64-3.6/nvtx/plugins/tf/keras
    running egg_info
    writing nvtx_plugins/python/nvtx_plugins.egg-info/PKG-INFO
    writing dependency_links to nvtx_plugins/python/nvtx_plugins.egg-info/dependency_links.txt
    writing requirements to nvtx_plugins/python/nvtx_plugins.egg-info/requires.txt
    writing top-level names to nvtx_plugins/python/nvtx_plugins.egg-info/top_level.txt
    reading manifest file 'nvtx_plugins/python/nvtx_plugins.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.so' under directory 'nvtx_plugins/'
    warning: no files found matching '*.lds'
    writing manifest file 'nvtx_plugins/python/nvtx_plugins.egg-info/SOURCES.txt'
    running build_ext
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c++11 -fPIC -O2 -Wall -I/usr/include/python3.6m -I/volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/include/python3.6m -c build/temp.linux-x86_64-3.6/test_compile/test_cpp_flags.cc -o build/temp.linux-x86_64-3.6/test_compile/test_cpp_flags.o
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/test_compile/test_cpp_flags.o -o build/temp.linux-x86_64-3.6/test_compile/test_cpp_flags.so
    x86_64-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/python3.6m -I/volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/include/python3.6m -c build/temp.linux-x86_64-3.6/test_compile/test_link_flags.cc -o build/temp.linux-x86_64-3.6/test_compile/test_link_flags.o
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/test_compile/test_link_flags.o -o build/temp.linux-x86_64-3.6/test_compile/test_link_flags.so
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c++11 -fPIC -O2 -Wall -I/usr/local/cuda/include -I/usr/include/python3.6m -I/volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/include/python3.6m -c build/temp.linux-x86_64-3.6/test_compile/test_cuda.cc -o build/temp.linux-x86_64-3.6/test_compile/test_cuda.o
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/test_compile/test_cuda.o -L/usr/local/cuda/lib -L/usr/local/cuda/lib64 -lcudart -o build/temp.linux-x86_64-3.6/test_compile/test_cuda.so
    ===========================================================================================
    INFO: Compiler /usr/bin/g++ (version 5.4.0 20160609) is not usable for this TensorFlow installation. Require g++ (version >=7.3.1 20180303, <999).
    ===========================================================================================
    ===========================================================================================
    INFO: Compiler /usr/bin/g++-5 (version 5.4.0 20160609) is not usable for this TensorFlow installation. Require g++ (version >=7.3.1 20180303, <999).
    ===========================================================================================
    ===========================================================================================
    INFO: Unable to build TensorFlow plugin, will skip it.

    Traceback (most recent call last):
      File "/tmp/pip-install-ilc5zap1/nvtx-plugins/setup_utils.py", line 372, in build_extensions
        build_tf_extension(self, extension, options)
      File "/tmp/pip-install-ilc5zap1/nvtx-plugins/setup_utils.py", line 464, in build_tf_extension
        'Could not find compiler compatible with this TensorFlow installation.\n'
    distutils.errors.DistutilsPlatformError: Could not find compiler compatible with this TensorFlow installation.
    Please check the NVTX-Plugins Github Repository for recommended compiler versions.
    To force a specific compiler version, set CC and CXX environment variables.

    ===========================================================================================
    error: TensorFlow plugin: `nvtx.plugins.tf.lib.nvtx_ops` failed to build. Aborting.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ilc5zap1/nvtx-plugins/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ilc5zap1/nvtx-plugins/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-cbio1ooi/install-record.txt --single-version-externally-managed --compile --install-headers /volatile/home/Zaccharie/workspace/fastmri-reproducible-benchmark/venv/include/site/python3.6/nvtx-plugins Check the logs for full command output.

I tried with both tf 2.2 and 2.3rc0. I am using Ubuntu 16.04, and my g++ version is 5.4, since I see it can be a problem.

I see that I am supposed to "check the NVTX-Plugins Github Repository for recommended compiler versions." but I didn't find the ressource for that.

I saw that something had already been fixed in that domain (https://github.com/NVIDIA/nvtx-plugins/pull/16), but not sure if it has been released yet.

I guess I just need to install g++ 7.3, but since I am having some difficulties in doing so I wanted to know for sure. I also think maybe this should be made clear in the docs.

DEKHTIARJonathan commented 4 years ago

Your error is pretty explicit:

Compiler /usr/bin/g++ (version 5.4.0 20160609) is not usable for this TensorFlow installation. Require g++ (version >=7.3.1 20180303, <999).

Just install g++ 7.3.1: sudo apt install g++-7 -y