From 3fa57607c957eb0dbabeb054b689fec565238d2b Mon Sep 17 00:00:00 2001 From: totaam Date: Fri, 25 Nov 2022 22:51:06 +0700 Subject: [PATCH] #3504 nvjpeg decoder no longer leaks memory with latest drivers --- setup.py | 2 +- xpra/codecs/nvjpeg/decoder.pyx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9490138635..fc5831cdca 100755 --- a/setup.py +++ b/setup.py @@ -220,7 +220,7 @@ def has_header_file(name, isdir=False): csc_swscale_ENABLED = DEFAULT and BITS==64 and pkg_config_ok("--exists", "libswscale") csc_cython_ENABLED = DEFAULT nvjpeg_encoder_ENABLED = DEFAULT and not OSX and BITS==64 and pkg_config_ok("--exists", "nvjpeg") -nvjpeg_decoder_ENABLED = False +nvjpeg_decoder_ENABLED = nvjpeg_encoder_ENABLED nvenc_ENABLED = DEFAULT and not OSX and BITS==64 and pkg_config_version("10", "nvenc") nvfbc_ENABLED = DEFAULT and not OSX and not ARM and BITS==64 and pkg_config_ok("--exists", "nvfbc") cuda_kernels_ENABLED = DEFAULT and not OSX diff --git a/xpra/codecs/nvjpeg/decoder.pyx b/xpra/codecs/nvjpeg/decoder.pyx index 8679d81e76..fd52afb5ed 100644 --- a/xpra/codecs/nvjpeg/decoder.pyx +++ b/xpra/codecs/nvjpeg/decoder.pyx @@ -255,9 +255,13 @@ def get_default_device(): def selftest(full=False): - from xpra.codecs.nv_util import has_nvidia_hardware + from xpra.codecs.nvidia.nv_util import has_nvidia_hardware, get_nvidia_module_version if not has_nvidia_hardware(): raise ImportError("no nvidia GPU device found") + mod_ver = get_nvidia_module_version() + if mod_ver<(522, 6): + vstr = ".".join(str(x) for x in mod_ver) + raise ImportError(f"nvidia module {vstr} is too old, version 522.6 or later is required") from xpra.codecs.codec_checks import TEST_PICTURES #options = {"cuda-device-context" : get_device_context()} for bdata in TEST_PICTURES["jpeg"]: