Skip to content

Installation fail? #1

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

Closed
rizwanishaq opened this issue Apr 12, 2021 · 5 comments
Closed

Installation fail? #1

rizwanishaq opened this issue Apr 12, 2021 · 5 comments

Comments

@rizwanishaq
Copy link

rizwanishaq commented Apr 12, 2021

Hi,
I am trying to install nvcodec-python using pip3 install pynvcodec
but getting follow error

ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/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-brzhijz7
       cwd: /tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/
  Complete output (18 lines):
  running bdist_wheel
  running build
  running build_ext
  mkdir -p build/tests
  mkdir -p build/lib
  nvcc -DCUDNN  --compiler-options "-fPIC -lstdc++ -pthread -lm" -c src/cuvid/Utils/ColorSpace.cu -o build/lib/libcolor_space.a
  building 'nvcodec' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/src
  creating build/temp.linux-x86_64-3.6/src/cuvid
  creating build/temp.linux-x86_64-3.6/src/cuvid/NvDecoder
  creating build/temp.linux-x86_64-3.6/src/cuvid/NvEncoder
  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 -Isrc -Isrc/cuvid -I/usr/local/cuda/include -I/usr/include/python3.6m -c nvcodec-python.cpp -o build/temp.linux-x86_64-3.6/nvcodec-python.o
  nvcodec-python.cpp:9:10: fatal error: numpy/arrayobject.h: No existe el archivo o el directorio
   #include <numpy/arrayobject.h>
            ^~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pynvcodec
  Running setup.py clean for pynvcodec
Failed to build pynvcodec
Installing collected packages: pynvcodec
    Running setup.py install for pynvcodec ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/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-xzsy4hlb/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/pynvcodec
         cwd: /tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/
    Complete output (18 lines):
    running install
    running build
    running build_ext
    mkdir -p build/tests
    mkdir -p build/lib
    nvcc -DCUDNN  --compiler-options "-fPIC -lstdc++ -pthread -lm" -c src/cuvid/Utils/ColorSpace.cu -o build/lib/libcolor_space.a
    building 'nvcodec' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    creating build/temp.linux-x86_64-3.6/src/cuvid
    creating build/temp.linux-x86_64-3.6/src/cuvid/NvDecoder
    creating build/temp.linux-x86_64-3.6/src/cuvid/NvEncoder
    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 -Isrc -Isrc/cuvid -I/usr/local/cuda/include -I/usr/include/python3.6m -c nvcodec-python.cpp -o build/temp.linux-x86_64-3.6/nvcodec-python.o
    nvcodec-python.cpp:9:10: fatal error: numpy/arrayobject.h: No existe el archivo o el directorio
     #include <numpy/arrayobject.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_6qoob7a/pynvcodec_f921b7bb823244d4a8992d6bfb54d1dc/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-xzsy4hlb/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/pynvcodec Check the logs for full command output.

I am using Ubuntu 18.04, with python 3.6 and cuda version of 11.1, with Tesla V4 GPUs.

@zeng-qinghui
Copy link
Contributor

zeng-qinghui commented Apr 18, 2021

The build needs "numpy/arrayobject.h".
I added include_dir of numpy to setup.py in version 0.0.6. Could you try again?

@zeng-qinghui zeng-qinghui pinned this issue Apr 18, 2021
@rizwanishaq
Copy link
Author

now, when I did the test, I am getting Segment violation (generated core).

@zeng-qinghui
Copy link
Contributor

now, when I did the test, I am getting Segment violation (generated core).

Can you show me your test code ?

@rizwanishaq
Copy link
Author

rizwanishaq commented Apr 20, 2021


from nvcodec import VideoSource, VideoDecoder, VideoEncoder

import numpy as np
import cv2
 

if __name__=="__main__":
    video_stream = cv2.VideoCapture("00021.mp4")
    encFile = open("test.h264", "wb")
    encoder = VideoEncoder(width=224, height=224)

    while True:
        success, frame = video_stream.read()
        if not success:
            break
        frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)

        packets = encoder.encode(frame)
        print(packets)
        
        encFile.write(packet)
    
    
    
    encFile.close()
    

@zeng-qinghui
Copy link
Contributor

Installation with mistake in test code.

encoder = VideoEncoder(width=224, height=224)

should be

encoder = VideoEncoder(224, 224)

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

2 participants