diff --git a/xpra/codecs/cuda_common/cuda_context.py b/xpra/codecs/cuda_common/cuda_context.py index 67f9ad8ff1..9c253ec368 100755 --- a/xpra/codecs/cuda_common/cuda_context.py +++ b/xpra/codecs/cuda_common/cuda_context.py @@ -10,13 +10,16 @@ import os from time import monotonic from threading import RLock -import pycuda #@UnresolvedImport -from pycuda import driver #@UnresolvedImport +from xpra.codecs.nv_util import numpy_import_lock from xpra.util import engs, print_nested_dict, envint, csv, first_time from xpra.os_util import load_binary_file from xpra.log import Logger +with numpy_import_lock: + import pycuda #@UnresolvedImport + from pycuda import driver #@UnresolvedImport + log = Logger("cuda") MIN_FREE_MEMORY = envint("XPRA_CUDA_MIN_FREE_MEMORY", 10) diff --git a/xpra/codecs/nvfbc/cuda_image_wrapper.py b/xpra/codecs/nvfbc/cuda_image_wrapper.py index b754ba72e1..ba63e4a4f6 100644 --- a/xpra/codecs/nvfbc/cuda_image_wrapper.py +++ b/xpra/codecs/nvfbc/cuda_image_wrapper.py @@ -5,7 +5,6 @@ # later version. See the file COPYING for details. from time import monotonic -from pycuda import driver #@UnresolvedImport from xpra.codecs.nv_util import numpy_import_lock from xpra.codecs.image_wrapper import ImageWrapper @@ -15,6 +14,7 @@ with numpy_import_lock: import numpy + from pycuda import driver #@UnresolvedImport class CUDAImageWrapper(ImageWrapper):