NvSciStream Sample Application

The NvSciStream sample application demonstrates how to use the NvSciStream API to build a simple stream.
Prerequisites
The sample application streams packets between a producer process and a consumer process via interprocess communication (IPC) channels. NvSciStream imposes some minimum requirements on the IPC channels to be able to transmit the required messages. The NvSciIpc channel must be created with at least 24K (24576) bytes per frame.
The NvSciIpc channels are configured via the device tree (DT) on QNX and via a plain text file, /etc/nvsciipc.cfg, on Linux. For more information on NvSciIpc configuration data, see the NvSciIpc Configuration Data chapter. The recommended NvSciIpc channels for this sample application are as follows:
INTER_PROCESS nvscistream_0 nvscistream_1 16 24576
INTER_PROCESS nvscistream_2 nvscistream_3 16 24576
INTER_PROCESS nvscistream_4 nvscistream_5 16 24576
INTER_PROCESS nvscistream_6 nvscistream_7 16 24576

NvSciStream Unicast Sample Application

On the standard platform, the unicast sample application streams packets from one NvMedia producer to a single CUDA consumer. On the safety platform, the unicast sample application streams packets from one CUDA producer to a single CUDA consumer.
The NvSciStream sample includes source code and a Makefile.
Building the sample application
1. On the host system, navigate to the sample application directory:
On Linux:
cd <top>/drive-t186ref-linux/samples/nvsci/nvscistream/unicast/
On standard QNX:
cd <top>/drive-t186ref-qnx/samples/nvsci/nvscistream/unicast/
On safety QNX:
cd <top>/drive-t186ref-qnx/samples/nvsci/nvscistream/unicast_safety/
Build the sample application:
make clean
make
 
Note:
On the standard platform, the pre-built sample application nvscistream_sample is in the same directory.
Options for the sample application
The NvSciStream Sample application supports the following command line switches:
Option
Meaning
Default
-p <ipc_endpoint1_name>
Specifies the IPC channel name of the producer process.
-c <ipc_endpoint2_name>
Specifies the IPC channel name of the consumer process.
-q <0/1>
Specifies the streaming type in the consumer process. Accepted values are 0 (Mailbox), and 1 (FIFO).
0
Running the sample application
1. On Linux, copy the sample application to the target filesystem:
cp <top>/drive-t186ref-linux/samples/nvsci/nvscistream/unicast/nvscistream_sample <top>/drive-t186ref-linux/targetfs/home/nvidia/
On standard QNX, copy the sample application to the target filesystem:
cp <top>/drive-t186ref-qnx/samples/nvsci/nvscistream/unicast/nvscistream_sample <top>/drive-t186ref-qnx/targetfs/samples
On safety QNX, copy the sample application to the target filesystem:
cp <top>/drive-t186ref-qnx/samples/nvsci/nvscistream/unicast_safety/nvscistream_safety_sample <top>/drive-t186ref-qnx/targetfs/samples
2. Run the sample application with the IPC channel <nvscistream_0, nvscistream_1>:
On the standard platform:
Producer process:
./nvscistream_sample -p nvscistream_0 &
Consumer process:
./nvscistream_sample -c nvscistream_1 -q 1
 
Note:
On Linux:
The nvscistream_sample application must be run as root user (with sudo).
If the nvscistream_sample application fails to open the IPC channel, cleaning up the NvSciIpc resources may help.
sudo rm -rf /dev/mqueue/*
sudo rm -rf /dev/shm/*
On the safety platform:
Producer process:
./nvscistream_safety_sample -p nvscistream_0 &
Consumer process:
./nvscistream_safety_sample -c nvscistream_1 -q 1

NvSciStream Multicast Sample Application

This sample application streams packets from one CUDA producer to multiple CUDA consumers.
The NvSciStream sample includes source code and a Makefile.
Building the sample application
1. On the host system, navigate to the sample application directory:
On Linux:
cd <top>/drive-t186ref-linux/samples/nvsci/nvscistream/multicast_safety/
On QNX:
cd <top>/drive-t186ref-qnx/samples/nvsci/nvscistream/multicast_safety/
2. Build the sample application:
make clean
make
Options for the sample application
The NvSciStream sample application supports the following command line switches:
Option
Meaning
Default
-p <list of ipc_endpoint_name>
Specifies the list of IPC channel names of the producer process. Each of them is paired with that used by one consumer process.
Used by the producer process.
-n <number of consumers>
Specifies the number of consumers that the producer process will be connected with.
Valid range is [1, 4].
Used by the producer process.
-c <ipc_endpoint2_name>
Specifies the IPC channel name of the consumer process.
Used by the consumer process.
-q <0/1>
Specifies the streaming type in the consumer process. Accepted values are 0 (Mailbox), and 1 (FIFO).
Used by the consumer process.
0
Running the sample application
1. On Linux, copy the sample application to the target filesystem:
cp <top>/drive-t186ref-linux/samples/nvsci/nvscistream/multicast_safety/nvscistream_multicast_safety_sample <top>/drive-t186ref-linux/targetfs/home/nvidia/
On QNX, copy the sample application to the target filesystem:
cp <top>/drive-t186ref-qnx/samples/nvsci/nvscistream/multicast_safety/nvscistream_multicast_safety_sample <top>/drive-t186ref-qnx/targetfs/samples
2. Run the sample application with the IPC channels:
The following is an example for one producer and three consumers.
Producer process:
./nvscistream_multicast_safety_sample -n 3 -p nvscistream_0 nvscistream_2 nvscistream_4 &
Consumer processes:
./nvscistream_multicast_safety_sample -c nvscistream_1 -q 1 &
./nvscistream_multicast_safety_sample -c nvscistream_3 -q 1 &
./nvscistream_multicast_safety_sample -c nvscistream_5 -q 1 &
 
Note:
On Linux:
The nvscistream_multicast_safety_sample application must be run as root user (with sudo).
If the nvscistream_multicast_safety_sample application fails to open the IPC channel, cleaning up NvSciIpc resources may help.
sudo rm -rf /dev/mqueue/*
sudo rm -rf /dev/shm/*