01-21-2025 10:54 AM
Hello, I am developing an application in LabVIEW 2023 Q3 64-bit using the Vision Development Module, on a Windows 10 computer with two Intel Xeon Gold 5218 processors and 128 GB RAM.
There is an intermittent problem where the processing time of some VIs suddenly goes up. The VIs are: IMAQ ImageToArray, IMAQ Absolute Difference and IMAQ Copy.
The architecture of this part of the code is producer-consumer, where the producer acquires the images and the IMAQ references are queued for the consumer, who does the processing.
In normal operation, the processing execution time is around 15 ms. However, without any identified justification, the processing time becomes around 100 ms. Just moving the mouse around the screen increases this time.
A few things have been done to try to minimize the effect, but without much difference to the processing time:
- Disabling the refresh of the front panel of the VIs
- Increasing the VI's execution priority
- Using Timed Loops to distribute processing among the processor cores
I'd like to ask a question about the Vision library: the highest-level VIs are "reentrant", but they call functions from the “Call Library Function Node” structure. Do these structures allow multiple instances to be executed in parallel?
Another strange behavior I've observed is that by changing other parts of the code or restarting the computer, the high processing time returns to normal.
The application I'm building needs stability in the code's execution time. How can I debug this problem and identify the VIs that are “processing leaks” (apart from simply measuring the time with Tick Count and Flat Sequence)?
01-21-2025 11:46 AM - edited 01-21-2025 11:48 AM
@RafaelFalcaro wrote:
I'd like to ask a question about the Vision library: the highest-level VIs are "reentrant", but they call functions from the “Call Library Function Node” structure. Do these structures allow multiple instances to be executed in parallel?
Yes, they are thread-safe and executed in parallel (at least for different images). When called for same images, some internal lock/unlock may happen in theory, but in general I haven't seen any performance degradation on vision functions also when running 24x7 since Vision 7.*. Some functions are optimized already for multicore, you can try (just for test) set cores to one with IMAQ Multi-Core Options VI and check if this issue still present or not.
Looks like resources leak, may be references which are not closed, or something else. Internal bug is also may exists, but trivial functions like copy/AbsDiff etc pretty well tested and used often. The only way is to strip done everything, removing some code in small pieces again and again and check when this issue will disappear.
By the way — what you doing with array returned from IMAQ ImageToArray? Can you show your code?