How can I optimize USB3 Vision camera performance on Linux?
When using USB3 Vision cameras on Linux, certain system settings may need to be adjusted for high-bandwidth or multi-camera applications.
The IC4 GenTL USB3 Driver automatically manages the USB transfer size, so no manual configuration is required.
Depending on your application, the following Linux settings may need to be adjusted:
-
USB stack memory limit
-
File handle limit
Do I need to configure the USB transfer size manually?
No.
The IC4 GenTL USB3 Driver automatically configures the appropriate USB transfer size and sets it to 3 MByte.
There is therefore no need to manually change the transfer size in Linux or in your application.
Do I need to increase the USB memory limit on Linux?
Normally, no.
The IC4 GenTL USB3 Driver automatically configures the Linux USB memory limit based on the available system RAM.
By default, the driver sets the usbfs_memory_mb limit to one quarter of the available RAM.
Therefore, users typically do not need to configure this parameter manually.
If you nevertheless want to set the USB memory limit yourself, you can change the usbfs_memory_mb value manually.
For example, the following command sets the limit to 1000 MB:
sudo sh -c 'echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb'
Note:
Manually changing this setting temporarily overrides the value automatically configured by the IC4 GenTL USB3 Driver.
Do I need to increase the File Handle Limit when using multiple USB3 Vision cameras?
Normally, no.
On modern Linux systems, the default limit is typically 1024 file handles per process, while our USB3 Vision cameras typically require fewer than 10 file handles per camera.
As a result, the default limit is generally sufficient, even when using multiple USB3 Vision cameras. No tuning should normally be required.
If you nevertheless need to increase the limit for your application, you can change the soft limit for the current process, for example:
ulimit -Sn 4096
This sets the soft limit to 4096 file handles for the current shell and processes started from it.
For a persistent configuration on Ubuntu, the corresponding limit can be configured in:
/etc/security/limits.conf