From 4f6151bac6b50b79a0d17ec8c17922607a2ae754 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 18 Sep 2013 07:21:59 +0000 Subject: [PATCH] * add PCI id to device description * when testing each gpu, add separator in log output * test only one dimension when testing multiple GPUs git-svn-id: https://xpra.org/svn/Xpra/trunk@4349 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/tests/xpra/codecs/test_encoder.py | 4 ++-- src/tests/xpra/codecs/test_nvenc.py | 18 ++++++++++++------ src/xpra/codecs/nvenc/encoder.pyx | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/tests/xpra/codecs/test_encoder.py b/src/tests/xpra/codecs/test_encoder.py index baa6e26a6f..44da752846 100755 --- a/src/tests/xpra/codecs/test_encoder.py +++ b/src/tests/xpra/codecs/test_encoder.py @@ -8,10 +8,10 @@ from tests.xpra.codecs.test_codec import make_planar_input, make_rgb_input from xpra.codecs.image_wrapper import ImageWrapper -DEFAULT_TEST_DIMENSIONS = ((32, 32), (1920, 1080), (512, 512)) +DEFAULT_TEST_DIMENSIONS = [(32, 32), (1920, 1080), (512, 512)] -def test_encoder(encoder_module, dimensions=DEFAULT_TEST_DIMENSIONS, options={}): +def test_encoder(encoder_module, options={}, dimensions=DEFAULT_TEST_DIMENSIONS): print("test_encoder(%s, %s)" % (encoder_module, dimensions)) print("colorspaces=%s" % encoder_module.get_colorspaces()) for c in encoder_module.get_colorspaces(): diff --git a/src/tests/xpra/codecs/test_nvenc.py b/src/tests/xpra/codecs/test_nvenc.py index 8a5b9b784e..d9ee975480 100755 --- a/src/tests/xpra/codecs/test_nvenc.py +++ b/src/tests/xpra/codecs/test_nvenc.py @@ -5,21 +5,25 @@ # later version. See the file COPYING for details. from tests.xpra.codecs.test_encoder import test_encoder -from xpra.codecs.nvenc import encoder, get_cuda_devices #@UnresolvedImport - TEST_DIMENSIONS = ((32, 32), (1920, 1080), (512, 512)) def test_encode(): + from xpra.codecs.nvenc import encoder #@UnresolvedImport print("test_nvenc()") test_encoder(encoder) def test_parallel_encode(): - cuda_devices = get_cuda_devices() + from xpra.codecs.nvenc import encoder #@UnresolvedImport + cuda_devices = encoder.get_cuda_devices() print("test_parallel_encode() will test one encoder on each of %s sequentially" % cuda_devices) + TEST_DIMENSIONS = [(32, 32)] for device_id, info in cuda_devices.items(): options = {"cuda_device" : device_id} - print("testing on %s" % info) - test_encoder(encoder, options) + print("") + print("**********************************") + print("**********************************") + print("testing on %s : %s" % (device_id, info)) + test_encoder(encoder, options, TEST_DIMENSIONS) def main(): @@ -27,7 +31,9 @@ def main(): import sys logging.root.setLevel(logging.INFO) logging.root.addHandler(logging.StreamHandler(sys.stdout)) - test_encode() + print("main()") + test_parallel_encode() + #test_encode() if __name__ == "__main__": diff --git a/src/xpra/codecs/nvenc/encoder.pyx b/src/xpra/codecs/nvenc/encoder.pyx index 5477c86476..89fb800d3c 100644 --- a/src/xpra/codecs/nvenc/encoder.pyx +++ b/src/xpra/codecs/nvenc/encoder.pyx @@ -1085,7 +1085,7 @@ cdef cuda_init_devices(): raiseCuda(cuDeviceTotalMem(&totalMem, cuDevice), "cuDeviceTotalMem") debug("device[%s]=%s (%sMB) - PCI: %s / %s - compute %s.%s (nvenc=%s)", i, gpu_name, int(totalMem/1024/1024), pciBusID, pciDeviceID, SMmajor, SMminor, has_nvenc) - devices[i] = str(gpu_name) + devices[i] = "%s - PCI: %s / %s" % (gpu_name, pciBusID, pciDeviceID) cuDeviceGetAttribute(&multiProcessorCount, CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, cuDevice) #log.info("multiProcessorCount=%s", multiProcessorCount) #printf(" (%2d) Multiprocessors x (%3d) CUDA Cores/MP: %d CUDA Cores\n",