Using the Spinnaker Multicore Optimizer

Spinnaker Multicore GigE Optimizer

The Spinnaker Multicore GigE Optimizer is the combination of Receive Side Scaling (RSS) and CPU Affinity to optimize the performance of our GigE cameras. RSS assigns one CPU core in a multiprocessor system to process all the traffic on a network adapter port, while CPU Affinity pins all other processes away from that core. This setup allows the appointed CPU core to only process the network traffic for that one NIC adapter port, thereby optimizing streaming performance.

This setup is recommended for those who have enough CPU resources that they can dedicate some CPU cores without affecting other background processes. It is not recommended to use this setup on machines with a small number of CPU cores.

The optimizer can be configured via the Spinnaker Adapter Config Utility (AdapterConfigGUI_v140.exe) application, which is found in Spinnaker/bin64/vs2015/AdapterConfigGUI_v140.exe on x64-based PCs, or Spinnaker/bin/vs2015/AdapterConfigGUI_v140.exe on x86-based PCs.  

This feature is only available on Windows platforms. 

Receive Side Scaling (RSS)

RSS enables the efficient distribution of network receive processing across multiple CPUs. If enabled on an NIC port, it reserves 1 CPU core to process all the network receive processing on that port.

For more information on RSS see Introduction to Receive Side Scaling from the Microsoft site.

We recommend you update your NIC driver to the latest version and verify it supports RSS.

CPU Affinity

CPU affinity is a service (CpuAffinity_v140.exe) that comes with the Spinnaker installation.  When running, the service periodically updates a bit mask to all active processes.  The bit mask describes which of the available processors should be pinned/unpinned for a process.

For more information on CPU affinity see Processor Affinity or CPU Pinning from the Intel site.

When the network adapters usage is below 5%, the service assumes we are not streaming and do not need CPU affinity (eg. all CPUs can be used for a process).  When the network usage exceeds 5%, the service assumes we are streaming and enables the affinity optimization. 

As an example: if we have 12 processors where CPU0, CPU2, and CPU4 are dedicated to NIC-0, NIC-1, and NIC-2 then the bitmask becomes 111111101010  (bit 0, bit 2 and bit4 are zeroes).

The service is designed to be very responsive in terms of enabling CPU affinity when streaming begins.  When not streaming, the service polls the network usage very frequently (every 2 seconds).  This means that it could take a maximum of 2 seconds to activate by responding to the increase in network usage. As there's less urgency to turn off CPU affinity optimization when streaming stops, the service polls the network usage very slowly (every 120 seconds).  This means that it could take a maximum of 120 seconds to deactivate.

By default, CPU affinity is not enabled.

Configuring the Multicore GigE Optimizer

To enable RSS and CPU affinity with AdapterConfigGUI

1. From C:\Program Files\Flir Systems\Spinnaker\bin64\vs2015 open the Adapter Config Utility.

2. Select Advanced Properties to configure RSS and Advanced System Configuration to enable CPU affinity and click Start.

Adapter-Config-Welcome.png

3. From the Select Adapter tab, notice the Receive Side Scaling Column.

Adapter-Config-RSS.png

4. Select the adapter(s) you want to configure and click Next.

5. For each adapter, you can dedicate a processor for RSS with the checkbox. If the checkbox is enabled, you can reserve a processor dedicated for the adapter. Note that if hyperthreading is supported, you should select an even-numbered (physical) CPU.

RSS-enabled.png

6. From the Advanced System Configuration tab, enable CPU affinity optimization with the checkbox and click Next.

Adapter-Config-Advanced-Config.png

7. Confirm your settings and click Configure.

To disable RSS and CPU affinity with AdapterConfigGUI

1. From C:\Program Files\Flir Systems\Spinnaker\bin64\vs2015 open the Adapter Config Utility.

2. Select Advanced Properties to disable RSS and Advanced System Configuration to disable CPU affinity and click Start.

Adapter-Config-Welcome.png

3. Select the adapter(s) you want to configure and click Smart Config.

Adapter-Config-Smart-Config.png

4. Confirm the settings and click Configure.

Verifying RSS

Run PowerShell cmdlets to verify RSS settings:

PS C:\Windows\system32> Get-NetApaterRss

or 

PS C:\Windows\system32> Get-NetApaterRss -name "Ethernet 1"

Example1.PNG

Example2.PNG

Verifying CPU Affinity

There are three methods to verify CPU affinity:

  • Check whether the service is running via services.msc.

services-msc-CPU-Affinity.png

  • Check the logs written to: 
    C:\ProgramData\Spinnaker\Shared\Logs\CPUAffinityLog_<timestamp>.txt
  • Check the CPU affinity in the Task Manager: from the Details tab right-click on any process and click Set affinity.

Task-Manager.png

Related Articles