Skip to content

Commit

Permalink
#3592 move nv_util with the other nvidia bits
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 9, 2022
1 parent 66538e5 commit 0f55524
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 11 deletions.
2 changes: 0 additions & 2 deletions packaging/rpm/xpra.spec
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ rm -rf $RPM_BUILD_ROOT
%{python3_sitearch}/xpra/codecs/icon_util.py
%{python3_sitearch}/xpra/codecs/image_wrapper.py
%{python3_sitearch}/xpra/codecs/loader.py
%{python3_sitearch}/xpra/codecs/nv_util.py
%{python3_sitearch}/xpra/codecs/rgb_transform.py
%{python3_sitearch}/xpra/codecs/video_helper.py
%{python3_sitearch}/xpra/dbus
Expand All @@ -453,7 +452,6 @@ rm -rf $RPM_BUILD_ROOT

%files codecs
%{python3_sitearch}/xpra/codecs/csc_*
%{python3_sitearch}/xpra/codecs/cuda_common
%{python3_sitearch}/xpra/codecs/dec_avcodec2
%{python3_sitearch}/xpra/codecs/drm
%{python3_sitearch}/xpra/codecs/enc_*
Expand Down
2 changes: 1 addition & 1 deletion xpra/client/window_backing_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def assign_cuda_context(self, opengl=False):
dev = get_default_device()
assert dev
#make this an opengl compatible context:
from xpra.codecs.cuda_common.cuda_context import cuda_device_context
from xpra.codecs.nv_common.cuda_context import cuda_device_context
self.cuda_context = cuda_device_context(dev.device_id, dev.device, opengl)
#create the context now as this is the part that takes time:
self.cuda_context.make_context()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions xpra/codecs/nvenc/encoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ from threading import Lock
from xpra.os_util import WIN32, LINUX, strtobytes
from xpra.make_thread import start_thread
from xpra.util import AtomicInteger, engs, csv, pver, envint, envbool, first_time, typedict
from xpra.codecs.cuda_common.cuda_context import (
from xpra.codecs.nv_common.cuda_context import (
init_all_devices, get_devices, get_device_name,
get_cuda_info, get_pycuda_info, reset_state,
get_CUDA_function, record_device_failure, record_device_success, CUDA_ERRORS_INFO,
cuda_device_context, load_device,
)
from xpra.codecs.codec_constants import video_spec, TransientCodecException
from xpra.codecs.image_wrapper import ImageWrapper
Expand Down Expand Up @@ -2958,8 +2959,6 @@ def init_module():
raise Exception("unsupported version of NVENC: %#x" % NVENCAPI_VERSION)
log("NVENC encoder API version %s", ".".join([str(x) for x in PRETTY_VERSION]))

from xpra.codecs.cuda_common.cuda_context import cuda_device_context, load_device

cdef Encoder test_encoder
#cdef uint32_t max_version
#cdef NVENCSTATUS r = NvEncodeAPIGetMaxSupportedVersion(&max_version)
Expand Down
2 changes: 1 addition & 1 deletion xpra/codecs/nvfbc/fbc_capture_linux.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ log = Logger("encoder", "nvfbc")
#because importing CUDAImageWrapper will have imported pycuda with the lock
try:
from pycuda import driver
from xpra.codecs.cuda_common.cuda_context import CUDA_ERRORS_INFO, select_device, device_info
from xpra.codecs.nv_common.cuda_context import CUDA_ERRORS_INFO, select_device, device_info
except ImportError:
raise
except:
Expand Down
2 changes: 1 addition & 1 deletion xpra/codecs/nvfbc/fbc_capture_win.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ log = Logger("encoder", "nvfbc")
#because importing CUDAImageWrapper will have imported pycuda with the lock
try:
from pycuda import driver
from xpra.codecs.cuda_common.cuda_context import CUDA_ERRORS_INFO, select_device, device_info
from xpra.codecs.nv_common.cuda_context import CUDA_ERRORS_INFO, select_device, device_info
except ImportError:
raise
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion xpra/codecs/nvjpeg/decoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ from xpra.codecs.nvjpeg.common import (
errcheck, NVJPEG_Exception,
ERR_STR, CSS_STR,
)
from xpra.codecs.cuda_common.cuda_context import select_device, cuda_device_context
from xpra.codecs.nv_common.cuda_context import select_device, cuda_device_context
from xpra.codecs.image_wrapper import ImageWrapper
from xpra.log import Logger
log = Logger("encoder", "nvjpeg")
Expand Down
2 changes: 1 addition & 1 deletion xpra/codecs/nvjpeg/encoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ from xpra.codecs.nvjpeg.common import (
CSS_STR, ENCODING_STR, NVJPEG_INPUT_STR,
)
from xpra.codecs.codec_debug import may_save_image
from xpra.codecs.cuda_common.cuda_context import get_CUDA_function, select_device, cuda_device_context
from xpra.codecs.nv_common.cuda_context import get_CUDA_function, select_device, cuda_device_context
from xpra.net.compression import Compressed
from xpra.util import typedict

Expand Down
2 changes: 1 addition & 1 deletion xpra/server/source/encodings_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def parse_encoding_caps(self, c):
or ("jpeg" in common_encodings and has_codec("enc_nvjpeg")):
cudalog = Logger("cuda")
try:
from xpra.codecs.cuda_common.cuda_context import get_device_context
from xpra.codecs.nv_common.cuda_context import get_device_context
self.cuda_device_context = get_device_context(self.encoding_options)
cudalog("cuda_device_context=%s", self.cuda_device_context)
except Exception as e:
Expand Down

0 comments on commit 0f55524

Please sign in to comment.