zhouyuchong / gst-nvinfer-custom

Custom gst-nvinfer for alignment in Deepstream
22 stars 12 forks source link

getting this error "opencv2/opencv.hpp: No such file or directory" while trying to build #10

Closed ahmedmuzammilAI closed 3 months ago

ahmedmuzammilAI commented 5 months ago
gstnvinfer.cpp:28:10: fatal error: opencv2/opencv.hpp: No such file or directory
   28 | #include <opencv2/opencv.hpp>
compilation terminated.
make: *** [Makefile:55: gstnvinfer.o] Error 1

please help! Thank you.

zhouyuchong commented 5 months ago

@ahmedmuzammilAI Make sure the path of opencv is correct in Makefile. 1 2

ahmedmuzammilAI commented 5 months ago

Will check! thanks a lot!

ahmedmuzammilAI commented 5 months ago

Hi, I searched for the right path where opencv was installed but I cannot find it. I'm using docker container and when I go to this path "/usr/lib/x86_64-linux-gnu/pkgconfig/" I cannot find "opencv4.pc" file. and I also can't find opencv in path "/usr/include/". Although I checked if opencv is installed and it is installed with CUDA support. Can you please help me out! Thanks again!!

this is my output from python, hope it helps:

Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__file__
'/usr/local/lib/python3.10/dist-packages/cv2/__init__.py'
>>> cv2.cuda.printCudaDeviceInfo(0)
*** CUDA Device Query (Runtime API) version (CUDART static linking) *** 

Device count: 1

Device 0: "NVIDIA GeForce RTX 4060 Laptop GPU"
  CUDA Driver Version / Runtime Version          12.20 / 12.20
  CUDA Capability Major/Minor version number:    8.9
  Total amount of global memory:                 7940 MBytes (8325824512 bytes)
  GPU Clock Speed:                               2.25 GHz
  Max Texture Dimension Size (x,y,z)             1D=(131072), 2D=(131072,65536), 3D=(16384,16384,16384)
  Max Layered Texture Size (dim) x layers        1D=(32768) x 2048, 2D=(32768,32768) x 2048
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per block:           1024
  Maximum sizes of each dimension of a block:    1024 x 1024 x 64
  Maximum sizes of each dimension of a grid:     2147483647 x 65535 x 65535
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and execution:                 Yes with 2 copy engine(s)
  Run time limit on kernels:                     Yes
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Concurrent kernel execution:                   Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support enabled:                No
  Device is using TCC driver mode:               No
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Bus ID / PCI location ID:           1 / 0
  Compute Mode:
      Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) 

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version  = 12.20, CUDA Runtime Version = 12.20, NumDevs = 1
zhouyuchong commented 5 months ago

@ahmedmuzammilAI You should install opencv separately.