Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVENC VRAM not release after codec switching #4373

Open
Simba98 opened this issue Oct 4, 2024 · 2 comments
Open

NVENC VRAM not release after codec switching #4373

Simba98 opened this issue Oct 4, 2024 · 2 comments
Labels
bug Something isn't working encoding

Comments

@Simba98
Copy link

Simba98 commented Oct 4, 2024

Describe the bug
There are VRAM leakage on NVENC, especially manually switching encoding

To Reproduce

  1. Make sure NVENC is enabled. (passed test with https://github.com/keylase/nvidia-patch/blob/master/tools/patch-tester/patch-tester.sh)
  2. Running a few days may reproduce it.
  3. But, manually switching between H264 and JPEG encoding in client will significantly increase VRAM usage unless there is no more VRAM.

System Information (please complete the following information):

  • Server OS: RockyLinux 8
  • Client OS: Windows 11
  • Xpra Server Version 6.1.3
  • Xpra Client Version Tested with 6.1.2/6.1.3

Additional context
There are some warning before VRAM running out.

2024-10-04 13:44:17,923 Warning: image bigger than expected
2024-10-04 13:44:17,924  2880x1536 instead of 2880x1514
2024-10-04 13:44:18,463 Warning: image bigger than expected
2024-10-04 13:44:18,463  2880x1536 instead of 2880x1514

is it related with this issue?
Guessing it is due to 353e5ca

/usr/lib64/python3.11/threading.py:982: UserWarning: module in out-of-thread context could not be cleaned up
  self._target(*self._args, **self._kwargs)
/usr/lib64/python3.11/site-packages/xpra/server/window/video_compress.py:397: UserWarning: module in out-of-thread context could not be cleaned up
  ve.clean()

Something before VRAM running out.

@Simba98 Simba98 added the bug Something isn't working label Oct 4, 2024
@totaam
Copy link
Collaborator

totaam commented Oct 4, 2024

Guessing it is due to 353e5ca

This commit handles decoding of padded frames.
But since you are reporting a memory leak server-side, this has nothing to do with it.

The new increased padding came with a driver update.
The nvenc codec has not changed much in many years - it's possible there is a leak, but perhaps another API change is causing it.

@totaam totaam added the encoding label Oct 4, 2024
@Simba98
Copy link
Author

Simba98 commented Oct 4, 2024

Guessing it is due to 353e5ca

This commit handles decoding of padded frames. But since you are reporting a memory leak server-side, this has nothing to do with it.

The new increased padding came with a driver update. The nvenc codec has not changed much in many years - it's possible there is a leak, but perhaps another API change is causing it.

I confirmed that I can not reproduce it on Xpra 6.1.2 Server by switching encoding multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working encoding
Projects
None yet
Development

No branches or pull requests

2 participants