Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
totaam committed Oct 28, 2016
1 parent 252d75a commit 5b3df5b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
23 changes: 7 additions & 16 deletions src/xpra/codecs/nv_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/xpra/codecs/nvenc7/encoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5b3df5b

Please sign in to comment.