It seems that this test does not PASS @unittest.skipUnless(ocl, "PyOpenCl is missing") def testOpenCLMedFilt2d(self): """test cpp engine for medfilt2d""" res = medianfilter.medfilt2d( image=TestMedianFilterEngines.IMG, kernel_size=TestMedianFilterEngines.KERNEL, engine='opencl') self.assertTrue(numpy.array_equal(res, TestMedianFilterEngines.IMG))
testOpenCLMedFilt2d (silx.image.test.test_medianfilter.TestMedianFilterEngines) test cpp engine for medfilt2d ... pocl error: lt_dlopen("(null)") or lt_dlsym() failed with 'can't close resident module'. note: missing symbols in the kernel binary might be reported as 'file not found' errors. Aborted E: pybuild pybuild:341: test: plugin custom failed with: exit code=134: env PYTHONPATH=/home/picca/silx-0.11.0+dfsg/.pybuild/cpython3_3.8_silx/build WITH_QT_TEST=False xvfb-run -a --server-args="-screen 0 1024x768x24" python3.8 run_tests.py -vv --installed dh_auto_test: pybuild --test -i python{version} -p "3.8 3.7" -s custom "--test-args=env PYTHONPATH={build_dir} WITH_QT_TEST=False xvfb-run -a --server-args=\"-screen 0 1024x768x24\" {interpreter} run_tests.py -vv --installed" returned exit code 13 make[1]: *** [debian/rules:70: override_dh_auto_test] Error 255 make[1]: Leaving directory '/home/picca/silx-0.11.0+dfsg' make: *** [debian/rules:27: build] Error 2 the code of medfilt2d is there def medfilt2d(image, kernel_size=3, engine='cpp'): """Apply a median filter on an image. This median filter is using a 'nearest' padding for values past the array edges. If you want more padding options or functionalities for the median filter (conditional filter for example) please have a look at :mod:`silx.math.medianfilter`. :param numpy.ndarray image: the 2D array for which we want to apply the median filter. :param kernel_size: the dimension of the kernel. Kernel size must be odd. If a scalar is given, then it is used as the size in both dimension. Default: (3, 3) :type kernel_size: A int or a list of 2 int (kernel_height, kernel_width) :param engine: the type of implementation to use. Valid values are: 'cpp' (default) and 'opencl' :returns: the array with the median value for each pixel. .. note:: if the opencl implementation is requested but is not present or fails, the cpp implementation is called. """ if engine not in MEDFILT_ENGINES: err = 'silx doesn\'t have an implementation for the requested engine: ' err += '%s' % engine raise ValueError(err) if len(image.shape) is not 2: raise ValueError('medfilt2d deals with arrays of dimension 2 only') if engine == 'cpp': return medianfilter_cpp.medfilt(data=image, kernel_size=kernel_size, conditional=False) elif engine == 'opencl': if medfilt_opencl is None: wrn = 'opencl median filter not available. ' wrn += 'Launching cpp implementation.' _logger.warning(wrn) # instead call the cpp implementation return medianfilter_cpp.medfilt(data=image, kernel_size=kernel_size, conditional=False) else: try: medianfilter = medfilt_opencl.MedianFilter2D(image.shape, devicetype="gpu") res = medianfilter.medfilt2d(image, kernel_size) except(RuntimeError, MemoryError, ImportError): wrn = 'Exception occured in opencl median filter. ' wrn += 'To get more information see debug log.' wrn += 'Launching cpp implementation.' _logger.warning(wrn) _logger.debug("median filter - openCL implementation issue.", exc_info=True) # instead call the cpp implementation res = medianfilter_cpp.medfilt(data=image, kernel_size=kernel_size, conditional=False) return res in our case we have engine = 'opencl' and no warning message, so medfil_opencl should not be None. it comes from here from silx.opencl import medfilt as medfilt_opencl In this code we have :param devicetype: type of device, can be "CPU", "GPU", "ACC" or "ALL" So let's do a first test by replacing gpu by cpu to see if it change something during the test.