Tx2-4g r32.3.1 nvivafilter performance

Added stock nvivafilter cuda-process=true customer-lib-name="libnvsample_cudaprocess.so frame count went from 30 fps to 24-25 fps, is this working correctly?

Thanks,
Terry

Hi,

Are you using a pipeline similar to this?
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Faccelerated_gstreamer.html%23wwpID0E0AI0HA

Thanks.

yes

Terry

any time frame for more info please.
Terry

Hi,
Adding cuda-process=true takes GPU usage. Please run sudo tegrastats to check if GPU runs at high loading and triggers performance drop.

you should of ask if I had CUDA installed, used “info” in jtop and CUDA is not installed,

How can I install CUDA without using the sdkmanager?

Thanks,
Terry

Hi,
We have SDK Manager for version control of software packages. Suggest you use it to avoid release version conflict.

installed CUDA, and built and ran some of the demo’s that show gpu usage in jtop, but nvivafilter still does not show any gpu use.

How do I debug this? What can I do to determine why nvivafilter is not using gpu.

Help please

Terry

further debugging I have found.

0:00:02.792303158 30943 0x558d0e8190 WARN nvivafilter gstnvivafilter.c:1487:gst_nvivafilter_stop: gs
t_nvivafilter_stop: could not find function deinit in libnvsample_cudaprocess.so, /usr/lib/aarch64-linux-gnu/libnv
sample_cudaprocess.so: undefined symbol: deinit

Terry

this is how I am using it. trying to determine if I can add things in a stream, so it is not attached to an EGLsink, it appears to work but it is not using the GPU,

! nvvidconv name=b ! ‘video/x-raw(memory:NVMM),width=(int)1920,height=(int)1080’
! nvivafilter cuda-process=true customer-lib-name=“libnvsample_cudaprocess.so”
! ‘video/x-raw(memory:NVMM),width=(int)1920,height=(int)1080’
! nvv4l2h264enc maxperf-enable=1 bitrate=8000000
! ‘video/x-h264, stream-format=(string)byte-stream’
! h264parse \

Also is there some documentation on how to compile and add the sample code to the system? This zip file only has a file with the cu suffix, no makefile or readme to help

Thanks,
Terry

Hi,
There is nvsample_cudaprocess_src.tbz2 in the source code package:
https://developer.nvidia.com/embedded/linux-tegra
L4T Driver Package (BSP) Sources
You may refer to README in the package.

I think I am making a mistake, because I am trying to use it to modify video that is being recorded, and I want a filter that does modifications to a NVMM to a NVMM. nvivafilter assumes I believe that the sink will be a GPU attached device, so that is why it is not working like I expected.

Is there a nvivafilter type filter to allow me to implement fast clockoverlay and fast gdkpixbufoverlay functions. Clockoverly and gdkpixbufoverlay do not play well with NVMM they function but eat too much CPU time. I tried to use nvivafilter, and failed.

Thanks,
Terry

Hi,
You may set post-process=true and use cairo APIs in post_process(). Below is pseudo code for reference:

if (sformat[0] == COLOR_FORMAT_RGBA) {
    rgba = (unsigned char *)sBaseAddr[0];
    rgba += ((spitch[0] * yoffset) + xoffset);
    cairo_surface_t *surface;
    cairo_t *cairo_context;
    PangoLayout *layout = NULL;
    PangoFontDescription *desc = NULL;
    char font_size_buffer[256];
    char display_text[256];

    surface = cairo_image_surface_create_for_data
            ((unsigned char *)sBaseAddr[0], CAIRO_FORMAT_ARGB32, swidth[0],
             sheight[0], spitch[0]);
    cairo_context = cairo_create (surface);

    layout = pango_cairo_create_layout (cairo_context);
    snprintf(font_size_buffer, 256, "%s %d",
        "Arial", 18);
    desc = pango_font_description_from_string (font_size_buffer);
    pango_layout_set_font_description (layout, desc);
    snprintf(display_text, 256, "%s",
        "Hello, world.");
    pango_layout_set_text (layout, display_text, -1);
    cairo_set_source_rgba (cairo_context, 1.0, 0, 1.0, 1.0);
    pango_cairo_update_layout (cairo_context, layout);
    cairo_move_to(cairo_context, 256, 256);
    pango_cairo_show_layout (cairo_context, layout);
    pango_font_description_free (desc);
    g_object_unref(layout);

    cairo_destroy (cairo_context);
    cairo_surface_destroy (surface);
  }

thanks,

the README says.

  1. Install the NVIDIA® CUDA® toolkit. (e.g version 8.0)

    Download package <CUDA® Toolkit for L4T> from the following website:
    https://developer.nvidia.com/embedded/downloads
    Ensure that the package name is consistent with the Linux userspace.

    Extract the package with the following command:
    $ sudo dpkg -i <CUDA® Toolkit for L4T>

    Install the package with the following commands:
    sudo apt-get update sudo apt-get install cuda-toolkit-

    NOTE: Use proper cuda toolkit version with above installation command. (for e.g. cuda-toolkit-8.0
    )

Went to https://developer.nvidia.com/embedded/downloads did not find any cuda files. no files had CUDA or cuda in the name, no toolkit either

Can I get better load CUDA toolkit instructions please.

Thanks
Terry

Hi,
The CUDA packages are installed through SDKManager and please ignore the steps.

using sdkmanager to load Target components has run my tx2-4g out of disk space, and now I am in living he… fighting disk space and sudo apt-get failures.