CGF Channel is a data allocation and transport framework. Its features include:
CGF Channels include several different classes which are used together to accomplish its functionality.
Channels are allocated by the ChannelFactory with parameters specified in a string format. The parameters are specified in key=value pairs delineated by commas. Unrecognized keys and their values are ignored.
The parameter keys include the following:
Key | Value Range | Usage | Description |
---|---|---|---|
role | {producer, consumer, composite} | required | Indicates if the channel is a producer, consumer. Composite role is deprecated. |
type | {SHMEM_LOCAL, SOCKET, NVSCI} | optional (default SHMEM_LOCAL) | Indicates the type of channel, which implies the underlying transport protocal to use. Only channels of the same type may connect to each other. |
fifo-size | optional (default 1) | For producer localshmem channels, fifo-size hints the number of packets allocate. The size of the packet pool is the maximum of fifo-size parameters for any connected consumer or the producer plus one for each connected consumer and the producer. For consumer localshmem channels, fifo-size indicates the maximum logical size that the queue of received packets is allowed to reach. For producer socket channels, fifo-size is ignored except when producer-fifo=1. For consumer socket channels, fifo-size is the maximum logical size that the queue of received packets is allowed to reach once packets have been read from the socket and placed in memory. The consumer allocates a pool of packets equal to the fifo-size parameter. For producer nvsci channels, fifo-size is the number of packets to allocate. For consumer nvsci channels, fifo-size is ignored. There is no logical limit on the size of the received packet queue imposed by a consumer. Instead, the size of the queue is determined simply by the number of packets allocated by the producer. | |
mode | {mailbox, singleton} | optional (default none) | mode=mailbox indicates that the maximum size of the queue of received packets is one and that old packets received but not yet read by the application will be dropped (immediately released back to the producer), and replaced when a newer packet is received. mode=singleton is deprecated. When not specified the default behavior of consumers is that old packets are not dropped. For localshmem fifo consumers, the producer application thread will throw an error on attempt to send more packets than are allowed. |
id | uint16 | localshmem and socket only, required | The unique producer id for the connection. Producer channels own the id and consumer channels use the id to identify the producer to connect to. For socket channels, the id is used as the port for the socket connection. |
num-clients | uint16 | optional (default 1) | Indicates the number of expected consumers to connect to the producer. If the number of connected consumers is less than num-clients, the producer is logically not yet fully connected. For nvsci channels, the parameter represents the number of consumers without nvsciipc endpoints which may either be intra-process or ipc. |
singleton-id | uint16 | localshmem producer only, optional (default none) | singleton-id enables shared pool packet useage where multiple producers utilize the same underlying packet pool instead of allocating their own disjoint packet pools. Each pool has a unique id and singleton-id, passed to a producer localshmem channel, indicates the id of the shared packet pool for the channel to use. It is enforced by Channels that only one producer and its associated consumers may use each packet from the shared packet pool at a time. The shared packet pool size is limited to 1. |
ip | IPv4 or IPv6 address string | socket only, required | The IP address of remote peer to connect to. |
producer-fifo | 0 or 1 | socket producer only, optional (default 0) | Indicates if the socket producer channel shall allocate more than one buffer to be filled by the application before send. In use-cases where producer application fills and sends one buffer at a time, the default value is sufficient. Indicates the nvsciipc endpoints to connect to. For consumer channels, only one endpoint is required and allowed. |
streamName | colon-delineated string list | nvsci channels only | Indicates the nvsciipc endpoint(s) to use for the inter-process, inter-vm, or inter-SoC connections. For a producer, more than one endpoint may be provided, enabling multicasting. For a consumer, up to one endpoint may be provided. |
limit | colon-delineated integer list | nvsci producer channels only | Indicates the packet limit(s) of endpoint connections, one per endpoint specified in the streamName parameter. The limit is the maximum number of packets that a consumer application is allowed to hold. The limit may be 0 and a negative value indicates no limit. This limit includes: packets that are waiting in NvSciStream for consumer application to consume. packets that the application is currently reading and has not yet released. packets that have been released and are in transmission back to producer. |
connectPrio | colon-delineated integer list | nvsci producer channels only | Indicates the connect priority of endpoints listed in the streamNames parameter. Priority of 0 indicates that endpoint should be connected on first connect attempt. Priority of non-zero implies the endpoint shall be connected on second connect attempt. |
Channels currently have many more deprecated parameters that are exposed and useable but not documented here.
Simplified late attachment with nvsci channels is achieved with the following steps:
Late Attachment with nvsci channels is achieved with the following steps:
Dead consumer detachment with nvsci channels:
Reattachment with nvsci channels is achieved with the following steps: