Report date: Nov. 25, 2022
Repair date: Nov. 27, 2022
Bilibili virtual character live streamer Suta Starlight had a laggy livestream with low frame rate on Nov. 25, 2022. I volunteered to offer a fix to the problem.
Inspecting Task Manager performance reports on her live streaming PC, it is revealed that her HP OMEN laptop is under severe resource starvation and imbalance: 100% CPU usage, 81% memory usage, 84% integrated GPU usage and 19% discrete NVIDIA GTX 1050 GPU usage.
First guess: out of memory
The memory stress on her computer is severe. I noticed that her computer have two memory slots while only one is occupied. This enabled a cheap fix: installing a matching memory module into her computer to both bring the total memory capacity to 16GB and put the memory controller in dual channel mode for a doubling of memory bandwidth.
After this fix, the livestream frame rate improved significantly, however inspecting the task manager still reveals a 80% CPU usage and 90% integrated GPU usage, while memory usage dropped to 40%. This indicated that the additional memory capacity have reduced the swapping activity on the CPU and allowed disk caches to work, while the additional memory bandwidth improved the performance of iGPU to the point of allowing a smooth stream. This is only an alleviation though, not a total fix, as there are still resource allocation imbalances in the system.
Second guess: GPU allocation and encoder selection
Now the focus is to make the dGPU do as much work as possible. The first change we made is to set the default GPU to the dGPU system wide. I have confirmed with the streamer that she do not intend to ever operate the laptop mobile, so battery life impact for this setting is no concern.
Then we inspected the video encoder selection in her streaming software. The streamer chose a NVENC version too new for her dGPU to support, forcing the streaming software to fall back to software encoding, increasing CPU load unnecessarily. We downgraded NVENC to a version her dGPU supports.
After this fix, the CPU usage dropped to 60% during an active livestream, while dGPU load increased to 25%. The onboard accelerators are now being actively and properly utilized.
After this fix, her livestream now runs smoothly. During a livestream the resource usage on her systems are: 60% CPU, 40% RAM, 30% iGPU and 25% dGPU.