Simultaneously I am running the following to periodically monitor memory usage:
watch sudo smem -rp
I am seeing the following usage:
PID User Command Swap USS PSS RSS
22369 root /usr/src/tensorrt/bin/trtex 0.00% 9.57% 10.76% 12.56%
That is 12.56% or just over 2GB of physical memory. Moreover, it is slowly increasing the longer trtexec is running as if memory is leaking.
Can someone explain if this level of memory usage is necessary/expected, and if I am in fact observing some kind of memory leak when I see the percentage slowly creeping up?
You mentioned you don’t observe issue #2, so let’s focus on issue #1.
Is that amount of physical memory usage then expected? 12% of 16G = 1.92GB. In my application I am running two inferencing engines (thus the total memory usage is a whopping 25% of the physical memory available). I plan on adding more. It won’t scale well if each instance utilizes 2GB.
Hello, Can I please get an answer? Is it normal to expect 2GB memory usage with one TensorRT engine loaded? Is there any way to bring the memory usage down?
Per engineering, high memory usage, especially on TX1 and TX2, is a known issue. It’s something we’re working on. For networks that are relatively small it can sometimes take 1 or 2 GB of shared memory.
The general recommendation is to stop gdm/lightdm to free up the display memory if you need to run larger batch sizes.