OpenCV with Jetson Nano Slow Webcam frame rate

Hi
I used pre-installed opencv on jetson nano with python to read my webcam. It was smooth and with high frame rate.
This week, I decided to install OpenCV from source to use CUDA and to be able to use OpenCV in C++. After installing new OpenCV, I ran same python code to test the OpenCV but the frame rate dropped a lot and showed stuttering streaming from webcam.
Why the frame rate is dropped? is there any solution for that?
I used this link to install OpenCV 4.5.0:

Hi,
Do you run gstreamer command in cv2.VideoCapture()? Generally we run like this:
V4l2src using OpenCV Gstreamer is not working in Jetson Xavier NX - #3 by DaneLLL

And for using CUDA filters, we suggest run gstreamer pipeline and map NvBuffer to cv::gpu::gpuMat. Please check this sample:
Nano not using GPU with gstreamer/python. Slow FPS, dropped frames - #8 by DaneLLL

1 Like

Thank you for your replay. I tried the first link for CPU and it worked.
I followed the instruction in second link but I installed opencv-gpu and it installed without error. but when I download the gst_cv_gpumat file and run:

CUDA_VER=10.0 make

I got this error:

Compiling: gst_cv_gpumat.cpp
g++ -I/usr/src/tegra_multimedia_api/include -I/usr/local/cuda-10.0/include `pkg-config --cflags gstreamer-1.0 opencv4)` -c gst_cv_gpumat.cpp -o gst_cv_gpumat.o
gst_cv_gpumat.cpp:6:10: fatal error: nvbuf_utils.h: No such file or directory
 #include "nvbuf_utils.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
Makefile:48: recipe for target 'gst_cv_gpumat.o' failed
make: *** [gst_cv_gpumat.o] Error 1

I tried to find the header using:

sudo find . -name nvbuf_utils

on both root and home directories but I couldn’t find it.

After including several headers in MakFile file in gst_cv_gpumat folder, I got this error:

babak@babak-desktop:~/Documents/cpp_projetcs/gst_cv_gpumat$ CUDA_VER=10.0 make
Compiling: gst_cv_gpumat.cpp
g++ -I/usr/src/tegra_multimedia_api/include -I/usr/local/cuda-10.0/include -I/usr/src/jetson_multimedia_api/include -I/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/uapi/linux -I/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include -I/usr/local/cuda-10.2/targets/aarch64-linux/include `pkg-config --cflags gstreamer-1.0 opencv4)` -c gst_cv_gpumat.cpp -o gst_cv_gpumat.o
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:97:8: error: ‘size_t’ does not name a type; did you mean ‘div_t’?
 extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
        ^~~~~~
        div_t
/usr/include/stdlib.h:212:36: error: ‘size_t’ has not been declared
 extern int strfromd (char *__dest, size_t __size, const char *__format,
                                    ^~~~~~
/usr/include/stdlib.h:216:36: error: ‘size_t’ has not been declared
 extern int strfromf (char *__dest, size_t __size, const char *__format,
                                    ^~~~~~
/usr/include/stdlib.h:220:36: error: ‘size_t’ has not been declared
 extern int strfroml (char *__dest, size_t __size, const char *__format,
                                    ^~~~~~
/usr/include/stdlib.h:232:38: error: ‘size_t’ has not been declared
 extern int strfromf32 (char *__dest, size_t __size, const char * __format,
                                      ^~~~~~
/usr/include/stdlib.h:238:38: error: ‘size_t’ has not been declared
 extern int strfromf64 (char *__dest, size_t __size, const char * __format,
                                      ^~~~~~
/usr/include/stdlib.h:244:39: error: ‘size_t’ has not been declared
 extern int strfromf128 (char *__dest, size_t __size, const char * __format,
                                       ^~~~~~
/usr/include/stdlib.h:250:39: error: ‘size_t’ has not been declared
 extern int strfromf32x (char *__dest, size_t __size, const char * __format,
                                       ^~~~~~
/usr/include/stdlib.h:256:39: error: ‘size_t’ has not been declared
 extern int strfromf64x (char *__dest, size_t __size, const char * __format,
                                       ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:411:4: error: ‘size_t’ has not been declared
    size_t __statelen) __THROW __nonnull ((2));
    ^~~~~~
/usr/include/stdlib.h:441:4: error: ‘size_t’ has not been declared
    size_t __statelen,
    ^~~~~~
/usr/include/stdlib.h:539:22: error: ‘size_t’ was not declared in this scope
 extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^~~~~~
/usr/include/stdlib.h:539:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:541:22: error: ‘size_t’ was not declared in this scope
 extern void *calloc (size_t __nmemb, size_t __size)
                      ^~~~~~
/usr/include/stdlib.h:541:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:541:38: error: ‘size_t’ was not declared in this scope
 extern void *calloc (size_t __nmemb, size_t __size)
                                      ^~~~~~
/usr/include/stdlib.h:541:38: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:541:51: error: expression list treated as compound expression in initializer [-fpermissive]
 extern void *calloc (size_t __nmemb, size_t __size)
                                                   ^
/usr/include/stdlib.h:549:36: error: ‘size_t’ has not been declared
 extern void *realloc (void *__ptr, size_t __size)
                                    ^~~~~~
/usr/include/stdlib.h:558:41: error: ‘size_t’ has not been declared
 extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
                                         ^~~~~~
/usr/include/stdlib.h:558:57: error: ‘size_t’ has not been declared
 extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
                                                         ^~~~~~
In file included from /usr/include/stdlib.h:566:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from gst_cv_gpumat.cpp:1:
/usr/include/alloca.h:32:22: error: ‘size_t’ was not declared in this scope
 extern void *alloca (size_t __size) __THROW;
                      ^~~~~~
/usr/include/alloca.h:32:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:572:22: error: ‘size_t’ was not declared in this scope
 extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^~~~~~
/usr/include/stdlib.h:572:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:577:45: error: ‘size_t’ has not been declared
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
                                             ^~~~~~
/usr/include/stdlib.h:577:65: error: ‘size_t’ has not been declared
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
                                                                 ^~~~~~
/usr/include/stdlib.h:583:29: error: ‘size_t’ was not declared in this scope
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                             ^~~~~~
/usr/include/stdlib.h:583:29: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:583:49: error: ‘size_t’ was not declared in this scope
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                                                 ^~~~~~
/usr/include/stdlib.h:583:49: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:583:62: error: expression list treated as compound expression in initializer [-fpermissive]
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                                                              ^
/usr/include/stdlib.h:818:9: error: ‘size_t’ has not been declared
         size_t __nmemb, size_t __size, __compar_fn_t __compar)
         ^~~~~~
/usr/include/stdlib.h:818:25: error: ‘size_t’ has not been declared
         size_t __nmemb, size_t __size, __compar_fn_t __compar)
                         ^~~~~~
/usr/include/stdlib.h:827:34: error: ‘size_t’ has not been declared
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
                                  ^~~~~~
/usr/include/stdlib.h:827:50: error: ‘size_t’ has not been declared
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
                                                  ^~~~~~
/usr/include/stdlib.h:830:36: error: ‘size_t’ has not been declared
 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
                                    ^~~~~~
/usr/include/stdlib.h:830:52: error: ‘size_t’ has not been declared
 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
                                                    ^~~~~~
/usr/include/stdlib.h:901:6: error: ‘size_t’ has not been declared
      size_t __len) __THROW __nonnull ((3, 4, 5));
      ^~~~~~
/usr/include/stdlib.h:904:6: error: ‘size_t’ has not been declared
      size_t __len) __THROW __nonnull ((3, 4, 5));
      ^~~~~~
/usr/include/stdlib.h:908:31: error: ‘size_t’ has not been declared
       char *__restrict __buf, size_t __len)
                               ^~~~~~
/usr/include/stdlib.h:912:31: error: ‘size_t’ has not been declared
       char *__restrict __buf, size_t __len)
                               ^~~~~~
/usr/include/stdlib.h:919:36: error: ‘size_t’ has not been declared
 extern int mblen (const char *__s, size_t __n) __THROW;
                                    ^~~~~~
/usr/include/stdlib.h:923:34: error: ‘size_t’ has not been declared
      const char *__restrict __s, size_t __n) __THROW;
                                  ^~~~~~
/usr/include/stdlib.h:930:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbstowcs (wchar_t *__restrict  __pwcs,
        ^~~~~~
        ssize_t
/usr/include/stdlib.h:933:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcstombs (char *__restrict __s,
        ^~~~~~
        ssize_t
/usr/include/stdlib.h:995:46: error: ‘size_t’ has not been declared
 extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
                                              ^~~~~~
In file included from gst_cv_gpumat.cpp:1:0:
/usr/include/c++/7/cstdlib:154:11: error: ‘::mbstowcs’ has not been declared
   using ::mbstowcs;
           ^~~~~~~~
/usr/include/c++/7/cstdlib:171:11: error: ‘::wcstombs’ has not been declared
   using ::wcstombs;
           ^~~~~~~~
In file included from gst_cv_gpumat.cpp:2:0:
/usr/include/c++/7/cstring:75:11: error: ‘::memchr’ has not been declared
   using ::memchr;
           ^~~~~~
/usr/include/c++/7/cstring:76:11: error: ‘::memcmp’ has not been declared
   using ::memcmp;
           ^~~~~~
/usr/include/c++/7/cstring:77:11: error: ‘::memcpy’ has not been declared
   using ::memcpy;
           ^~~~~~
/usr/include/c++/7/cstring:78:11: error: ‘::memmove’ has not been declared
   using ::memmove;
           ^~~~~~~
/usr/include/c++/7/cstring:79:11: error: ‘::memset’ has not been declared
   using ::memset;
           ^~~~~~
/usr/include/c++/7/cstring:80:11: error: ‘::strcat’ has not been declared
   using ::strcat;
           ^~~~~~
/usr/include/c++/7/cstring:81:11: error: ‘::strcmp’ has not been declared
   using ::strcmp;
           ^~~~~~
/usr/include/c++/7/cstring:82:11: error: ‘::strcoll’ has not been declared
   using ::strcoll;
           ^~~~~~~
/usr/include/c++/7/cstring:83:11: error: ‘::strcpy’ has not been declared
   using ::strcpy;
           ^~~~~~
/usr/include/c++/7/cstring:84:11: error: ‘::strcspn’ has not been declared
   using ::strcspn;
           ^~~~~~~
/usr/include/c++/7/cstring:85:11: error: ‘::strerror’ has not been declared
   using ::strerror;
           ^~~~~~~~
/usr/include/c++/7/cstring:86:11: error: ‘::strlen’ has not been declared
   using ::strlen;
           ^~~~~~
/usr/include/c++/7/cstring:87:11: error: ‘::strncat’ has not been declared
   using ::strncat;
           ^~~~~~~
/usr/include/c++/7/cstring:88:11: error: ‘::strncmp’ has not been declared
   using ::strncmp;
           ^~~~~~~
/usr/include/c++/7/cstring:89:11: error: ‘::strncpy’ has not been declared
   using ::strncpy;
           ^~~~~~~
/usr/include/c++/7/cstring:90:11: error: ‘::strspn’ has not been declared
   using ::strspn;
           ^~~~~~
/usr/include/c++/7/cstring:91:11: error: ‘::strtok’ has not been declared
   using ::strtok;
           ^~~~~~
/usr/include/c++/7/cstring:92:11: error: ‘::strxfrm’ has not been declared
   using ::strxfrm;
           ^~~~~~~
/usr/include/c++/7/cstring:93:11: error: ‘::strchr’ has not been declared
   using ::strchr;
           ^~~~~~
/usr/include/c++/7/cstring:94:11: error: ‘::strpbrk’ has not been declared
   using ::strpbrk;
           ^~~~~~~
/usr/include/c++/7/cstring:95:11: error: ‘::strrchr’ has not been declared
   using ::strrchr;
           ^~~~~~~
/usr/include/c++/7/cstring:96:11: error: ‘::strstr’ has not been declared
   using ::strstr;
           ^~~~~~
In file included from /usr/include/c++/7/cwchar:44:0,
                 from /usr/include/c++/7/bits/postypes.h:40,
                 from /usr/include/c++/7/iosfwd:40,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/wchar.h:93:38: error: ‘size_t’ has not been declared
     const wchar_t *__restrict __src, size_t __n)
                                      ^~~~~~
/usr/include/wchar.h:102:38: error: ‘size_t’ has not been declared
     const wchar_t *__restrict __src, size_t __n)
                                      ^~~~~~
/usr/include/wchar.h:109:63: error: ‘size_t’ has not been declared
 extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
                                                               ^~~~~~
/usr/include/wchar.h:118:4: error: ‘size_t’ has not been declared
    size_t __n) __THROW;
    ^~~~~~
/usr/include/wchar.h:126:6: error: ‘size_t’ has not been declared
      size_t __n, locale_t __loc) __THROW;
      ^~~~~~
/usr/include/wchar.h:135:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsxfrm (wchar_t *__restrict __s1,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:150:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:187:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
        ^~~~~~
        ssize_t
/usr/include/wchar.h:191:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
        ^~~~~~
        ssize_t
/usr/include/wchar.h:222:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__;
        ^~~~~~
        ssize_t
/usr/include/wchar.h:240:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
        ^~~~~~
        ssize_t
/usr/include/wchar.h:247:59: error: ‘size_t’ has not been declared
 extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
                                                           ^~~~~~
/usr/include/wchar.h:250:10: error: ‘size_t’ has not been declared
          size_t __n)
          ^~~~~~
/usr/include/wchar.h:258:63: error: ‘size_t’ has not been declared
 extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
                                                               ^~~~~~
/usr/include/wchar.h:263:37: error: ‘size_t’ has not been declared
     const wchar_t *__restrict __s2, size_t __n) __THROW;
                                     ^~~~~~
/usr/include/wchar.h:267:63: error: ‘size_t’ has not been declared
 extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)
                                                               ^~~~~~
/usr/include/wchar.h:271:53: error: ‘size_t’ has not been declared
 extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                                     ^~~~~~
/usr/include/wchar.h:277:38: error: ‘size_t’ has not been declared
      const wchar_t *__restrict __s2, size_t __n)
                                      ^~~~~~
/usr/include/wchar.h:296:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbrtowc (wchar_t *__restrict __pwc,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:301:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:305:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t __mbrlen (const char *__restrict __s, size_t __n,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:307:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbrlen (const char *__restrict __s, size_t __n,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:337:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbsrtowcs (wchar_t *__restrict __dst,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:343:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsrtombs (char *__restrict __dst,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:351:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:357:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsnrtombs (char *__restrict __dst,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:371:42: error: ‘size_t’ has not been declared
 extern int wcswidth (const wchar_t *__s, size_t __n) __THROW;
                                          ^~~~~~
/usr/include/wchar.h:557:38: error: ‘size_t’ has not been declared
     const wchar_t *__restrict __src, size_t __n)
                                      ^~~~~~
/usr/include/wchar.h:567:53: error: ‘size_t’ has not been declared
 extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW;
                                                     ^~~~~~
/usr/include/wchar.h:590:47: error: ‘size_t’ has not been declared
 extern int swprintf (wchar_t *__restrict __s, size_t __n,
                                               ^~~~~~
/usr/include/wchar.h:611:48: error: ‘size_t’ has not been declared
 extern int vswprintf (wchar_t *__restrict __s, size_t __n,
                                                ^~~~~~
/usr/include/wchar.h:835:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:842:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
        ^~~~~~
        ssize_t
In file included from /usr/include/c++/7/bits/postypes.h:40:0,
                 from /usr/include/c++/7/iosfwd:40,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/c++/7/cwchar:151:11: error: ‘::mbrlen’ has not been declared
   using ::mbrlen;
           ^~~~~~
/usr/include/c++/7/cwchar:152:11: error: ‘::mbrtowc’ has not been declared
   using ::mbrtowc;
           ^~~~~~~
/usr/include/c++/7/cwchar:154:11: error: ‘::mbsrtowcs’ has not been declared
   using ::mbsrtowcs;
           ^~~~~~~~~
/usr/include/c++/7/cwchar:176:11: error: ‘::wcrtomb’ has not been declared
   using ::wcrtomb;
           ^~~~~~~
/usr/include/c++/7/cwchar:181:11: error: ‘::wcscspn’ has not been declared
   using ::wcscspn;
           ^~~~~~~
/usr/include/c++/7/cwchar:182:11: error: ‘::wcsftime’ has not been declared
   using ::wcsftime;
           ^~~~~~~~
/usr/include/c++/7/cwchar:183:11: error: ‘::wcslen’ has not been declared
   using ::wcslen;
           ^~~~~~
/usr/include/c++/7/cwchar:187:11: error: ‘::wcsrtombs’ has not been declared
   using ::wcsrtombs;
           ^~~~~~~~~
/usr/include/c++/7/cwchar:188:11: error: ‘::wcsspn’ has not been declared
   using ::wcsspn;
           ^~~~~~
/usr/include/c++/7/cwchar:196:11: error: ‘::wcsxfrm’ has not been declared
   using ::wcsxfrm;
           ^~~~~~~
In file included from /usr/include/c++/7/bits/exception_ptr.h:38:0,
                 from /usr/include/c++/7/exception:142,
                 from /usr/include/c++/7/ios:39,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/c++/7/bits/cxxabi_init_exception.h:63:32: error: ‘size_t’ was not declared in this scope
       __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
                                ^~~~~~
/usr/include/c++/7/bits/cxxabi_init_exception.h:63:32: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/exception:142:0,
                 from /usr/include/c++/7/ios:39,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/c++/7/bits/exception_ptr.h: In function ‘std::__exception_ptr::exception_ptr std::make_exception_ptr(_Ex)’:
/usr/include/c++/7/bits/exception_ptr.h:182:67: error: ‘__cxxabiv1::__cxa_allocate_exception’ cannot be used as a function
       void* __e = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ex));
                                                                   ^
In file included from /usr/include/c++/7/ios:40:0,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/c++/7/bits/char_traits.h: In static member function ‘static std::size_t std::char_traits<wchar_t>::length(const char_type*)’:
/usr/include/c++/7/bits/char_traits.h:431:11: error: ‘wcslen’ was not declared in this scope
    return wcslen(__s);
           ^~~~~~
/usr/include/c++/7/bits/char_traits.h:431:11: note: suggested alternative: ‘wcstoq’
    return wcslen(__s);
           ^~~~~~
           wcstoq
In file included from /usr/include/linux/posix_types.h:5:0,
                 from /usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/uapi/linux/types.h:13,
                 from /usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/types.h:5,
                 from /usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/uapi/linux/time.h:4,
                 from /usr/include/pthread.h:24,
                 from /usr/include/aarch64-linux-gnu/c++/7/bits/gthr-default.h:35,
                 from /usr/include/aarch64-linux-gnu/c++/7/bits/gthr.h:148,
                 from /usr/include/c++/7/ext/atomicity.h:35,
                 from /usr/include/c++/7/bits/ios_base.h:39,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h: At global scope:
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h:10:2: error: expected identifier before ‘false’
  false = 0,
  ^~~~~
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h:10:2: error: expected ‘}’ before ‘false’
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h:10:2: error: expected unqualified-id before ‘false’
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h:12:1: error: expected declaration before ‘}’ token
 };
 ^
Makefile:51: recipe for target 'gst_cv_gpumat.o' failed
make: *** [gst_cv_gpumat.o] Error 1

Hi,
Please change

-I/usr/src/tegra_multimedia_api/include

to

-I/usr/src/jetson_multimedia_api/include

And give it a try. The path is changed in later releases.

I changed it and got new error:

babak@babak-desktop:~/Documents/cpp_projetcs/gst_cv_gpumat$ CUDA_VER=10.0 make
Compiling: gst_cv_gpumat.cpp
g++ -I/usr/src/jetson_multimedia_api/include -I/usr/local/cuda-10.0/include -I/usr/src/jetson_multimedia_api/include -I/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/uapi/linux -I/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include -I/usr/local/cuda-10.2/targets/aarch64-linux/include `pkg-config --cflags gstreamer-1.0 opencv4)` -c gst_cv_gpumat.cpp -o gst_cv_gpumat.o
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:97:8: error: ‘size_t’ does not name a type; did you mean ‘div_t’?
 extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
        ^~~~~~
        div_t
/usr/include/stdlib.h:212:36: error: ‘size_t’ has not been declared
 extern int strfromd (char *__dest, size_t __size, const char *__format,
                                    ^~~~~~
/usr/include/stdlib.h:216:36: error: ‘size_t’ has not been declared
 extern int strfromf (char *__dest, size_t __size, const char *__format,
                                    ^~~~~~
/usr/include/stdlib.h:220:36: error: ‘size_t’ has not been declared
 extern int strfroml (char *__dest, size_t __size, const char *__format,
                                    ^~~~~~
/usr/include/stdlib.h:232:38: error: ‘size_t’ has not been declared
 extern int strfromf32 (char *__dest, size_t __size, const char * __format,
                                      ^~~~~~
/usr/include/stdlib.h:238:38: error: ‘size_t’ has not been declared
 extern int strfromf64 (char *__dest, size_t __size, const char * __format,
                                      ^~~~~~
/usr/include/stdlib.h:244:39: error: ‘size_t’ has not been declared
 extern int strfromf128 (char *__dest, size_t __size, const char * __format,
                                       ^~~~~~
/usr/include/stdlib.h:250:39: error: ‘size_t’ has not been declared
 extern int strfromf32x (char *__dest, size_t __size, const char * __format,
                                       ^~~~~~
/usr/include/stdlib.h:256:39: error: ‘size_t’ has not been declared
 extern int strfromf64x (char *__dest, size_t __size, const char * __format,
                                       ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:411:4: error: ‘size_t’ has not been declared
    size_t __statelen) __THROW __nonnull ((2));
    ^~~~~~
/usr/include/stdlib.h:441:4: error: ‘size_t’ has not been declared
    size_t __statelen,
    ^~~~~~
/usr/include/stdlib.h:539:22: error: ‘size_t’ was not declared in this scope
 extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^~~~~~
/usr/include/stdlib.h:539:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:541:22: error: ‘size_t’ was not declared in this scope
 extern void *calloc (size_t __nmemb, size_t __size)
                      ^~~~~~
/usr/include/stdlib.h:541:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:541:38: error: ‘size_t’ was not declared in this scope
 extern void *calloc (size_t __nmemb, size_t __size)
                                      ^~~~~~
/usr/include/stdlib.h:541:38: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:541:51: error: expression list treated as compound expression in initializer [-fpermissive]
 extern void *calloc (size_t __nmemb, size_t __size)
                                                   ^
/usr/include/stdlib.h:549:36: error: ‘size_t’ has not been declared
 extern void *realloc (void *__ptr, size_t __size)
                                    ^~~~~~
/usr/include/stdlib.h:558:41: error: ‘size_t’ has not been declared
 extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
                                         ^~~~~~
/usr/include/stdlib.h:558:57: error: ‘size_t’ has not been declared
 extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
                                                         ^~~~~~
In file included from /usr/include/stdlib.h:566:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from gst_cv_gpumat.cpp:1:
/usr/include/alloca.h:32:22: error: ‘size_t’ was not declared in this scope
 extern void *alloca (size_t __size) __THROW;
                      ^~~~~~
/usr/include/alloca.h:32:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:572:22: error: ‘size_t’ was not declared in this scope
 extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^~~~~~
/usr/include/stdlib.h:572:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:577:45: error: ‘size_t’ has not been declared
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
                                             ^~~~~~
/usr/include/stdlib.h:577:65: error: ‘size_t’ has not been declared
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
                                                                 ^~~~~~
/usr/include/stdlib.h:583:29: error: ‘size_t’ was not declared in this scope
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                             ^~~~~~
/usr/include/stdlib.h:583:29: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:583:49: error: ‘size_t’ was not declared in this scope
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                                                 ^~~~~~
/usr/include/stdlib.h:583:49: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/stdlib.h:583:62: error: expression list treated as compound expression in initializer [-fpermissive]
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                                                              ^
/usr/include/stdlib.h:818:9: error: ‘size_t’ has not been declared
         size_t __nmemb, size_t __size, __compar_fn_t __compar)
         ^~~~~~
/usr/include/stdlib.h:818:25: error: ‘size_t’ has not been declared
         size_t __nmemb, size_t __size, __compar_fn_t __compar)
                         ^~~~~~
/usr/include/stdlib.h:827:34: error: ‘size_t’ has not been declared
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
                                  ^~~~~~
/usr/include/stdlib.h:827:50: error: ‘size_t’ has not been declared
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
                                                  ^~~~~~
/usr/include/stdlib.h:830:36: error: ‘size_t’ has not been declared
 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
                                    ^~~~~~
/usr/include/stdlib.h:830:52: error: ‘size_t’ has not been declared
 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
                                                    ^~~~~~
/usr/include/stdlib.h:901:6: error: ‘size_t’ has not been declared
      size_t __len) __THROW __nonnull ((3, 4, 5));
      ^~~~~~
/usr/include/stdlib.h:904:6: error: ‘size_t’ has not been declared
      size_t __len) __THROW __nonnull ((3, 4, 5));
      ^~~~~~
/usr/include/stdlib.h:908:31: error: ‘size_t’ has not been declared
       char *__restrict __buf, size_t __len)
                               ^~~~~~
/usr/include/stdlib.h:912:31: error: ‘size_t’ has not been declared
       char *__restrict __buf, size_t __len)
                               ^~~~~~
/usr/include/stdlib.h:919:36: error: ‘size_t’ has not been declared
 extern int mblen (const char *__s, size_t __n) __THROW;
                                    ^~~~~~
/usr/include/stdlib.h:923:34: error: ‘size_t’ has not been declared
      const char *__restrict __s, size_t __n) __THROW;
                                  ^~~~~~
/usr/include/stdlib.h:930:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbstowcs (wchar_t *__restrict  __pwcs,
        ^~~~~~
        ssize_t
/usr/include/stdlib.h:933:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcstombs (char *__restrict __s,
        ^~~~~~
        ssize_t
/usr/include/stdlib.h:995:46: error: ‘size_t’ has not been declared
 extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
                                              ^~~~~~
In file included from gst_cv_gpumat.cpp:1:0:
/usr/include/c++/7/cstdlib:154:11: error: ‘::mbstowcs’ has not been declared
   using ::mbstowcs;
           ^~~~~~~~
/usr/include/c++/7/cstdlib:171:11: error: ‘::wcstombs’ has not been declared
   using ::wcstombs;
           ^~~~~~~~
In file included from gst_cv_gpumat.cpp:2:0:
/usr/include/c++/7/cstring:75:11: error: ‘::memchr’ has not been declared
   using ::memchr;
           ^~~~~~
/usr/include/c++/7/cstring:76:11: error: ‘::memcmp’ has not been declared
   using ::memcmp;
           ^~~~~~
/usr/include/c++/7/cstring:77:11: error: ‘::memcpy’ has not been declared
   using ::memcpy;
           ^~~~~~
/usr/include/c++/7/cstring:78:11: error: ‘::memmove’ has not been declared
   using ::memmove;
           ^~~~~~~
/usr/include/c++/7/cstring:79:11: error: ‘::memset’ has not been declared
   using ::memset;
           ^~~~~~
/usr/include/c++/7/cstring:80:11: error: ‘::strcat’ has not been declared
   using ::strcat;
           ^~~~~~
/usr/include/c++/7/cstring:81:11: error: ‘::strcmp’ has not been declared
   using ::strcmp;
           ^~~~~~
/usr/include/c++/7/cstring:82:11: error: ‘::strcoll’ has not been declared
   using ::strcoll;
           ^~~~~~~
/usr/include/c++/7/cstring:83:11: error: ‘::strcpy’ has not been declared
   using ::strcpy;
           ^~~~~~
/usr/include/c++/7/cstring:84:11: error: ‘::strcspn’ has not been declared
   using ::strcspn;
           ^~~~~~~
/usr/include/c++/7/cstring:85:11: error: ‘::strerror’ has not been declared
   using ::strerror;
           ^~~~~~~~
/usr/include/c++/7/cstring:86:11: error: ‘::strlen’ has not been declared
   using ::strlen;
           ^~~~~~
/usr/include/c++/7/cstring:87:11: error: ‘::strncat’ has not been declared
   using ::strncat;
           ^~~~~~~
/usr/include/c++/7/cstring:88:11: error: ‘::strncmp’ has not been declared
   using ::strncmp;
           ^~~~~~~
/usr/include/c++/7/cstring:89:11: error: ‘::strncpy’ has not been declared
   using ::strncpy;
           ^~~~~~~
/usr/include/c++/7/cstring:90:11: error: ‘::strspn’ has not been declared
   using ::strspn;
           ^~~~~~
/usr/include/c++/7/cstring:91:11: error: ‘::strtok’ has not been declared
   using ::strtok;
           ^~~~~~
/usr/include/c++/7/cstring:92:11: error: ‘::strxfrm’ has not been declared
   using ::strxfrm;
           ^~~~~~~
/usr/include/c++/7/cstring:93:11: error: ‘::strchr’ has not been declared
   using ::strchr;
           ^~~~~~
/usr/include/c++/7/cstring:94:11: error: ‘::strpbrk’ has not been declared
   using ::strpbrk;
           ^~~~~~~
/usr/include/c++/7/cstring:95:11: error: ‘::strrchr’ has not been declared
   using ::strrchr;
           ^~~~~~~
/usr/include/c++/7/cstring:96:11: error: ‘::strstr’ has not been declared
   using ::strstr;
           ^~~~~~
In file included from /usr/include/c++/7/cwchar:44:0,
                 from /usr/include/c++/7/bits/postypes.h:40,
                 from /usr/include/c++/7/iosfwd:40,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/wchar.h:93:38: error: ‘size_t’ has not been declared
     const wchar_t *__restrict __src, size_t __n)
                                      ^~~~~~
/usr/include/wchar.h:102:38: error: ‘size_t’ has not been declared
     const wchar_t *__restrict __src, size_t __n)
                                      ^~~~~~
/usr/include/wchar.h:109:63: error: ‘size_t’ has not been declared
 extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
                                                               ^~~~~~
/usr/include/wchar.h:118:4: error: ‘size_t’ has not been declared
    size_t __n) __THROW;
    ^~~~~~
/usr/include/wchar.h:126:6: error: ‘size_t’ has not been declared
      size_t __n, locale_t __loc) __THROW;
      ^~~~~~
/usr/include/wchar.h:135:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsxfrm (wchar_t *__restrict __s1,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:150:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:187:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
        ^~~~~~
        ssize_t
/usr/include/wchar.h:191:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
        ^~~~~~
        ssize_t
/usr/include/wchar.h:222:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__;
        ^~~~~~
        ssize_t
/usr/include/wchar.h:240:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
        ^~~~~~
        ssize_t
/usr/include/wchar.h:247:59: error: ‘size_t’ has not been declared
 extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
                                                           ^~~~~~
/usr/include/wchar.h:250:10: error: ‘size_t’ has not been declared
          size_t __n)
          ^~~~~~
/usr/include/wchar.h:258:63: error: ‘size_t’ has not been declared
 extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
                                                               ^~~~~~
/usr/include/wchar.h:263:37: error: ‘size_t’ has not been declared
     const wchar_t *__restrict __s2, size_t __n) __THROW;
                                     ^~~~~~
/usr/include/wchar.h:267:63: error: ‘size_t’ has not been declared
 extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)
                                                               ^~~~~~
/usr/include/wchar.h:271:53: error: ‘size_t’ has not been declared
 extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                                     ^~~~~~
/usr/include/wchar.h:277:38: error: ‘size_t’ has not been declared
      const wchar_t *__restrict __s2, size_t __n)
                                      ^~~~~~
/usr/include/wchar.h:296:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbrtowc (wchar_t *__restrict __pwc,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:301:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:305:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t __mbrlen (const char *__restrict __s, size_t __n,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:307:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbrlen (const char *__restrict __s, size_t __n,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:337:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbsrtowcs (wchar_t *__restrict __dst,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:343:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsrtombs (char *__restrict __dst,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:351:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:357:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsnrtombs (char *__restrict __dst,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:371:42: error: ‘size_t’ has not been declared
 extern int wcswidth (const wchar_t *__s, size_t __n) __THROW;
                                          ^~~~~~
/usr/include/wchar.h:557:38: error: ‘size_t’ has not been declared
     const wchar_t *__restrict __src, size_t __n)
                                      ^~~~~~
/usr/include/wchar.h:567:53: error: ‘size_t’ has not been declared
 extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW;
                                                     ^~~~~~
/usr/include/wchar.h:590:47: error: ‘size_t’ has not been declared
 extern int swprintf (wchar_t *__restrict __s, size_t __n,
                                               ^~~~~~
/usr/include/wchar.h:611:48: error: ‘size_t’ has not been declared
 extern int vswprintf (wchar_t *__restrict __s, size_t __n,
                                                ^~~~~~
/usr/include/wchar.h:835:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
        ^~~~~~
        ssize_t
/usr/include/wchar.h:842:8: error: ‘size_t’ does not name a type; did you mean ‘ssize_t’?
 extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
        ^~~~~~
        ssize_t
In file included from /usr/include/c++/7/bits/postypes.h:40:0,
                 from /usr/include/c++/7/iosfwd:40,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/c++/7/cwchar:151:11: error: ‘::mbrlen’ has not been declared
   using ::mbrlen;
           ^~~~~~
/usr/include/c++/7/cwchar:152:11: error: ‘::mbrtowc’ has not been declared
   using ::mbrtowc;
           ^~~~~~~
/usr/include/c++/7/cwchar:154:11: error: ‘::mbsrtowcs’ has not been declared
   using ::mbsrtowcs;
           ^~~~~~~~~
/usr/include/c++/7/cwchar:176:11: error: ‘::wcrtomb’ has not been declared
   using ::wcrtomb;
           ^~~~~~~
/usr/include/c++/7/cwchar:181:11: error: ‘::wcscspn’ has not been declared
   using ::wcscspn;
           ^~~~~~~
/usr/include/c++/7/cwchar:182:11: error: ‘::wcsftime’ has not been declared
   using ::wcsftime;
           ^~~~~~~~
/usr/include/c++/7/cwchar:183:11: error: ‘::wcslen’ has not been declared
   using ::wcslen;
           ^~~~~~
/usr/include/c++/7/cwchar:187:11: error: ‘::wcsrtombs’ has not been declared
   using ::wcsrtombs;
           ^~~~~~~~~
/usr/include/c++/7/cwchar:188:11: error: ‘::wcsspn’ has not been declared
   using ::wcsspn;
           ^~~~~~
/usr/include/c++/7/cwchar:196:11: error: ‘::wcsxfrm’ has not been declared
   using ::wcsxfrm;
           ^~~~~~~
In file included from /usr/include/c++/7/bits/exception_ptr.h:38:0,
                 from /usr/include/c++/7/exception:142,
                 from /usr/include/c++/7/ios:39,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/c++/7/bits/cxxabi_init_exception.h:63:32: error: ‘size_t’ was not declared in this scope
       __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
                                ^~~~~~
/usr/include/c++/7/bits/cxxabi_init_exception.h:63:32: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from gst_cv_gpumat.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   ‘std::size_t’
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/exception:142:0,
                 from /usr/include/c++/7/ios:39,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/c++/7/bits/exception_ptr.h: In function ‘std::__exception_ptr::exception_ptr std::make_exception_ptr(_Ex)’:
/usr/include/c++/7/bits/exception_ptr.h:182:67: error: ‘__cxxabiv1::__cxa_allocate_exception’ cannot be used as a function
       void* __e = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ex));
                                                                   ^
In file included from /usr/include/c++/7/ios:40:0,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/include/c++/7/bits/char_traits.h: In static member function ‘static std::size_t std::char_traits<wchar_t>::length(const char_type*)’:
/usr/include/c++/7/bits/char_traits.h:431:11: error: ‘wcslen’ was not declared in this scope
    return wcslen(__s);
           ^~~~~~
/usr/include/c++/7/bits/char_traits.h:431:11: note: suggested alternative: ‘wcstoq’
    return wcslen(__s);
           ^~~~~~
           wcstoq
In file included from /usr/include/linux/posix_types.h:5:0,
                 from /usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/uapi/linux/types.h:13,
                 from /usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/types.h:5,
                 from /usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/uapi/linux/time.h:4,
                 from /usr/include/pthread.h:24,
                 from /usr/include/aarch64-linux-gnu/c++/7/bits/gthr-default.h:35,
                 from /usr/include/aarch64-linux-gnu/c++/7/bits/gthr.h:148,
                 from /usr/include/c++/7/ext/atomicity.h:35,
                 from /usr/include/c++/7/bits/ios_base.h:39,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from gst_cv_gpumat.cpp:3:
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h: At global scope:
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h:10:2: error: expected identifier before ‘false’
  false = 0,
  ^~~~~
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h:10:2: error: expected ‘}’ before ‘false’
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h:10:2: error: expected unqualified-id before ‘false’
/usr/src/linux-headers-4.9.253-tegra-ubuntu18.04_aarch64/kernel-4.9/include/linux/stddef.h:12:1: error: expected declaration before ‘}’ token
 };
 ^
Makefile:51: recipe for target 'gst_cv_gpumat.o' failed
make: *** [gst_cv_gpumat.o] Error 1

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Hi,
We don’t hit the error on Jetpacl 4.5.1(r32.5.1):

nvidia@nano:~/gst_cv_gpumat$ head -1 /etc/nv_tegra_release
# R32 (release), REVISION: 5.1, GCID: 26202423, BOARD: t210ref, EABI: aarch64, DATE: Fri Feb 19 16:45:52 UTC 2021
nvidia@nano:~/gst_cv_gpumat$ CUDA_VER=10.2 make
Compiling: gst_cv_gpumat.cpp
g++ -I/usr/src/jetson_multimedia_api/include -I/usr/local/cuda-10.2/include `pkg-config --cflags gstreamer-1.0 opencv4)` -c gst_cv_gpumat.cpp -o gst_cv_gpumat.o
Linking: gst_cv_gpumat
g++ -o gst_cv_gpumat gst_cv_gpumat.o -I/usr/src/jetson_multimedia_api/include -I/usr/local/cuda-10.2/include `pkg-config --cflags gstreamer-1.0 opencv4)` -Wall -std=c++11 -L/usr/lib/aarch64-linux-gnu/tegra/ -lEGL -lGLESv2 -L/usr/lib/aarch64-linux-gnu/tegra/ -lcuda -lnvbuf_utils -L/usr/local/cuda-10.2/lib64/ -lcudart  `pkg-config --libs gstreamer-1.0 opencv4

Please share which version you use.