Disable logs from nv modules


I see that there are some logs from decoder/render/encoder modules when initialized. Is there a way to disable these logs -

Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
[New Thread 0x7f837bf200 (LWP 13202)]
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
===== MSENC blits (mode: 2) into tiled surfaces =====

This is from h264 encoder. There are similar logs from decoder, video sink etc.

Please let me know if it can be disabled these logs some how.

I doubt I can answer the question, but knowing where you are seeing the logging would be useful. If it is via dmesg, then there are different places dmesg goes to, and each location can have log level information adjusted. This will not change what log level a message is actually noted as, and won’t stop the message from being in the kernel ring buffer.

If this is instead from the application itself going into a log file, then it would be a different question. There may be some combination of the application, external user space libraries, and kernel drivers involved, so knowing specifically which logs would help.

I’m using the gstreamer plugins omxh264dec, omxh264enc from the command line. These prints are logged in the terminal. I have an application which uses these plugins and I want to remove these prints. I looked into the gst-omx plugin source, and these prints are not in that module but from some nv modules called from omxh264dec plugins.

If this is sent to the stderr stream then just redirect it as a temporary workaround. Example using “2>/dev/null” syntax (I don’t know what your command is, just pretend your non-root user is getting an error for reading content which you don’t have permission for):

# Showing error:
cat /etc/sshd/*
# Removing stderr:
cat /etc/sshd/* <b>2>/dev/null</b>

And of course there may be a way to stop messages directly from the driver or syslog facility, but maybe stderr redirect will work until there is a better answer.

Hi Linuxdev,

Thanks for the reply. But this would route all logs to /dev/null. In my usecase, there are other logs which I don’t want to lose. I’m looking for an environment variable kind of setting that could disable these logs.

Syslog itself can be set to show different “levels” of messages, but this is for a “class” of log levels. See:

See also “man dmesg” and “man syslogd”.

If you are lucky enough that the driver in question can have its particular log level hidden by setting log levels to show only more critical levels than the particular message, while simultaneously not losing messages you want from everything else at hidden log level, then just change this default log level.

If the particular driver itself needs to change log levels, then probably you’d need the source code.

More information on the particular use case of what is showing up where might help…sometimes other tools like grep can be combined with redirects if a specific application (versus a driver) is showing the logs.

This is the gstreamer pipeline -

root@tegra-ubuntu:# gst-launch-1.0 videotestsrc ! omxh264enc ! fakesink

Setting pipeline to PAUSED …

Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is PREROLLING …
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
===== MSENC blits (mode: 1) into tiled surfaces =====

Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock

handling interrupt.
Interrupt: Stopping pipeline …
Execution ended after 0:00:00.708902343
Setting pipeline to PAUSED …
Offset 0 Frame - 0 0 0 1 50
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

I want to disable the logs in bold. I am using this (omxh264enc) plugin in my application, hence I need to remove these logs, but logs from my application should not get removed.

Just to confirm, you want that part of the message to not show up from the console which starts the application (probably)? Or is this in a log file (probably not)?

If this is going to stdout you can filter those specific lines (it is a minor tweak if the message is to stderr):

root@tegra-ubuntu:# gst-launch-1.0 videotestsrc ! omxh264enc ! fakesink \
| egrep -v '^(Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and|MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is PREROLLING ...|Framerate set to : 30 at vxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4|===== MSENC =====|NvMMLiteBlockCreate : Block : BlockType = 4|===== MSENC blits [(]mode: 1[)] into tiled surfaces =====)'

What this does is pipe stdout to egrep…the ‘-v’ option inverts matching and blocks lines which match. This is regular expression matching with the pipe character ‘|’ between lines as a “logical OR” in order to do this as a single line (I may have made a mistake on where line ends are because the text I quoted might have had line wrap I miscalculated). This an be tweaked for your case (if you use the forum icon for block quote ("</>") around your text listing it’ll do proper line breaks…the pencil icon in upper right will let you edit your post…hover the mouse over the upper right corner quote icon to see more).

In the case of this being output via stderr instead of stdout you’d modify by adding a “2>&1” prior to piping to egrep:

root@tegra-ubuntu:# gst-launch-1.0 videotestsrc ! omxh264enc ! fakesink \
<b>2>&1</b> | egrep -v ...snip...

This is a means of stopping output to be visible without ever modifying drivers or system log levels.