From 5b3df5b29d8a85a87f887bf693b8309a0daa2fe5 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 28 Oct 2016 08:25:14 +0000 Subject: [PATCH] #1260: * enable YUV444P and lossless modes by default (keep env var to disable) * improve error and log messages git-svn-id: https://xpra.org/svn/Xpra/trunk@14315 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/codecs/nv_util.py | 23 ++++++------------- src/xpra/codecs/nvenc7/encoder.pyx | 2 +- src/xpra/server/window/window_video_source.py | 4 ++-- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/xpra/codecs/nv_util.py b/src/xpra/codecs/nv_util.py index 19f2cdd456..575d1187ae 100644 --- a/src/xpra/codecs/nv_util.py +++ b/src/xpra/codecs/nv_util.py @@ -10,8 +10,8 @@ log = Logger("encoder", "nvenc") from xpra.util import pver, print_nested_dict, engs, envbool -IGNORE_NVIDIA_DRIVER_BLACKLIST = envbool("XPRA_IGNORE_NVIDIA_DRIVER_BLACKLIST", False) +MAX_TESTED = 375 def get_nvml_driver_version(): try: @@ -176,18 +176,9 @@ def get_cards(probe=True): def is_blacklisted(): v = get_nvidia_module_version(True) - def wouldfail(): - if IGNORE_NVIDIA_DRIVER_BLACKLIST: - log.warn("Warning: the driver blacklist has been ignored") - return False - return True try: - if v[0]<350: + if v[0]<=MAX_TESTED: return False - if v[0]==352 and v[1]<=30: - return wouldfail() - if v[0]==355 and v[1]<=6: - return wouldfail() except Exception as e: log.warn("Warning: error checking driver version:") log.warn(" %s", e) @@ -213,11 +204,11 @@ def validate_driver_yuv444lossless(): l = log.warn _version_warning = True if v: - l("Warning: NVidia driver version %s is unsupported with NVENC", pver(v)) - l(" recommended driver versions: up to 350 only") - if envbool("XPRA_NVENC_YUV444P", False): - l(" disabling YUV444P and lossless mode") - l(" use XPRA_NVENC_YUV444P=1 to force enable it") + l("Warning: NVidia driver version %s is untested with NVENC", pver(v)) + l(" (this encoder has been tested with versions up to %s.x only)", MAX_TESTED) + if not envbool("XPRA_NVENC_YUV444P", True): + l(" enabling YUV444P and lossless mode") + l(" use XPRA_NVENC_YUV444P=0 to force disable") return False return True diff --git a/src/xpra/codecs/nvenc7/encoder.pyx b/src/xpra/codecs/nvenc7/encoder.pyx index b6814cbe02..4ff0311248 100644 --- a/src/xpra/codecs/nvenc7/encoder.pyx +++ b/src/xpra/codecs/nvenc7/encoder.pyx @@ -1428,7 +1428,7 @@ cdef class Encoder: if preset and (preset in presets.keys()): log("using preset '%s' for quality=%s, speed=%s, lossless=%s, pixel_format=%s", preset, self.speed, self.quality, self.lossless, self.pixel_format) return c_parseguid(preset_guid) - raise Exception("no matching presets available for '%s'!?" % self.codec_name) + raise Exception("no matching presets available for '%s' with speed=%i and quality=%i" % (self.codec_name, self.speed, self.quality)) def init_context(self, int width, int height, src_format, dst_formats, encoding, int quality, int speed, scaling, options={}): #@DuplicatedSignature assert NvEncodeAPICreateInstance is not None, "encoder module is not initialized" diff --git a/src/xpra/server/window/window_video_source.py b/src/xpra/server/window/window_video_source.py index 6c720b0b60..18afc0f64d 100644 --- a/src/xpra/server/window/window_video_source.py +++ b/src/xpra/server/window/window_video_source.py @@ -969,10 +969,10 @@ def checknovideo(*info): ve = self._video_encoder csce = self._csc_encoder if ve is not None and ve.is_closed(): - scorelog("cannot score: video encoder is closed or closing") + scorelog("cannot score: video encoder %s is closed or closing", ve) return if csce is not None and csce.is_closed(): - scorelog("cannot score: csc is closed or closing") + scorelog("cannot score: csc %s is closed or closing", csce) return scores = self.get_video_pipeline_options(eval_encodings, w, h, self.pixel_format, force_reload)