From 7f189545647353bf5ed53a2e883ee5989c13f6ae Mon Sep 17 00:00:00 2001 From: totaam Date: Thu, 24 Nov 2022 21:31:00 +0700 Subject: [PATCH] try to continue without a cuda context using software decoding --- xpra/client/window_backing_base.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/xpra/client/window_backing_base.py b/xpra/client/window_backing_base.py index 9751f7f3cb..1fe42dd4cd 100644 --- a/xpra/client/window_backing_base.py +++ b/xpra/client/window_backing_base.py @@ -381,7 +381,7 @@ def south_y(): def assign_cuda_context(self, opengl=False): if self.cuda_context is None: - from xpra.codecs.nvjpeg.decoder import get_default_device # @NoMove pylint: disable=no-name-in-module, import-outside-toplevel + from xpra.codecs.nvidia.nvjpeg.decoder import get_default_device # @NoMove pylint: disable=no-name-in-module, import-outside-toplevel dev = get_default_device() assert dev #make this an opengl compatible context: @@ -473,10 +473,17 @@ def paint_jpega(self, img_data, x, y, width, height, options, callbacks): def do_paint_jpeg(self, encoding, img_data, x, y, width, height, options, callbacks): alpha_offset = options.intget("alpha-offset", 0) log("do_paint_jpeg: nvjpeg_decoder=%s", self.nvjpeg_decoder) + img = None if self.nvjpeg_decoder and not alpha_offset: - with self.assign_cuda_context(False): - img = self.nvjpeg_decoder.decompress_and_download("RGB", img_data) - else: + try: + with self.assign_cuda_context(False): + img = self.nvjpeg_decoder.decompress_and_download("RGB", img_data) + except Exception as e: + if first_time(str(e)): + log.error("Error accessing cuda context", exc_info=True) + else: + log("cuda context error, again") + if img is None: if encoding=="jpeg": rgb_format = "RGBX" elif encoding=="jpega":