4

I'm trying to run the following script:

import silx
from silx.image import sift
from PIL import Image
import numpy
import scipy.ndimage
from silx.opencl import ocl, pyopencl, kernel_workgroup_size
img1 = numpy.asarray(Image.open('1.jpg'))
img2 = numpy.asarray(Image.open('2.jpg'))
alignPlan = sift.LinearAlign(img1, devicetype='GPU')
img2_aligned = alignPlan.align(img2)

But, get the following error which I'm not pretty sure what it means:

X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0
X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0
X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0

EDIT: Below is the "clinfo" output:

X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0
X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0
Number of platforms 3
 Platform Name NVIDIA CUDA
 Platform Vendor NVIDIA Corporation
 Platform Version OpenCL 1.2 CUDA 8.0.0
 Platform Profile FULL_PROFILE
 Platform Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer
 Platform Extensions function suffix NV
 Platform Name Clover
 Platform Vendor Mesa
 Platform Version OpenCL 1.1 Mesa 17.0.7
 Platform Profile FULL_PROFILE
 Platform Extensions cl_khr_icd
 Platform Extensions function suffix MESA
 Platform Name Intel Gen OCL Driver
 Platform Vendor Intel
 Platform Version OpenCL 1.2 beignet 1.3 (git-8bd8c3a)
 Platform Profile FULL_PROFILE
 Platform Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_khr_gl_sharing
 Platform Extensions function suffix Intel
X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
cl_get_gt_device(): error, unknown device: 0
 Platform Name NVIDIA CUDA
Number of devices 1
 Device Name GeForce GTX 765M
 Device Vendor NVIDIA Corporation
 Device Vendor ID 0x10de
 Device Version OpenCL 1.2 CUDA
 Driver Version 375.66
 Device OpenCL C Version OpenCL C 1.2 
 Device Type GPU
 Device Profile FULL_PROFILE
 Device Topology (NV) PCI-E, 01:00.0
 Max compute units 4
 Max clock frequency 862MHz
 Compute Capability (NV) 3.0
 Device Partition (core)
 Max number of sub-devices 1
 Supported partition types None
 Max work item dimensions 3
 Max work item sizes 1024x1024x64
 Max work group size 1024
 Preferred work group size multiple 32
 Warp size (NV) 32
 Preferred / native vector sizes 
 char 1 / 1 
 short 1 / 1 
 int 1 / 1 
 long 1 / 1 
 half 0 / 0 (n/a)
 float 1 / 1 
 double 1 / 1 (cl_khr_fp64)
 Half-precision Floating-point support (n/a)
 Single-precision Floating-point support (core)
 Denormals Yes
 Infinity and NANs Yes
 Round to nearest Yes
 Round to zero Yes
 Round to infinity Yes
 IEEE754-2008 fused multiply-add Yes
 Support is emulated in software No
 Correctly-rounded divide and sqrt operations Yes
 Double-precision Floating-point support (cl_khr_fp64)
 Denormals Yes
 Infinity and NANs Yes
 Round to nearest Yes
 Round to zero Yes
 Round to infinity Yes
 IEEE754-2008 fused multiply-add Yes
 Support is emulated in software No
 Correctly-rounded divide and sqrt operations No
 Address bits 64, Little-Endian
 Global memory size 2094923776 (1.951GiB)
 Error Correction support No
 Max memory allocation 523730944 (499.5MiB)
 Unified memory for Host and Device No
 Integrated memory (NV) No
 Minimum alignment for any data type 128 bytes
 Alignment of base address 4096 bits (512 bytes)
 Global Memory cache type Read/Write
 Global Memory cache size 65536
 Global Memory cache line 128 bytes
 Image support Yes
 Max number of samplers per kernel 32
 Max size for 1D images from buffer 134217728 pixels
 Max 1D or 2D image array size 2048 images
 Max 2D image size 16384x16384 pixels
 Max 3D image size 4096x4096x4096 pixels
 Max number of read image args 256
 Max number of write image args 16
 Local memory type Local
 Local memory size 49152 (48KiB)
 Registers per block (NV) 65536
 Max constant buffer size 65536 (64KiB)
 Max number of constant args 9
 Max size of kernel argument 4352 (4.25KiB)
 Queue properties 
 Out-of-order execution Yes
 Profiling Yes
 Prefer user sync for interop No
 Profiling timer resolution 1000ns
 Execution capabilities 
 Run OpenCL kernels Yes
 Run native kernels No
 Kernel execution timeout (NV) Yes
 Concurrent copy and kernel execution (NV) Yes
 Number of async copy engines 1
 printf() buffer size 1048576 (1024KiB)
 Built-in kernels 
 Device Available Yes
 Compiler Available Yes
 Linker Available Yes
 Device Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer
 Platform Name Clover
Number of devices 0
 Platform Name Intel Gen OCL Driver
Number of devices 0
NULL platform behavior
 clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) NVIDIA CUDA
 clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [NV]
 clCreateContext(NULL, ...) [default] Success [NV]
 clCreateContext(NULL, ...) [other] <error: no devices in non-default plaforms>
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No platform
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) No platform
ICD loader properties
 ICD loader Name OpenCL ICD Loader
 ICD loader Vendor OCL Icd free software
 ICD loader Version 2.2.8
 ICD loader Profile OpenCL 1.2
 NOTE: your OpenCL library declares to support OpenCL 1.2,
 but it seems to support up to OpenCL 2.1 too.

Do you have an idea on how I can solve this issue?

Thanks.

asked Aug 3, 2017 at 8:37
2
  • 1
    What clinfo outputs? Commented Aug 3, 2017 at 8:39
  • @Jovasa Thanks for your comment. I added the "clinfo" information in my question. Commented Aug 3, 2017 at 8:57

3 Answers 3

5

I had a similar problem and found a solution where removing the Beignet OpenCL driver solved the problem.

sudo dnf remove beignet

Where I found my solution

answered Aug 3, 2017 at 9:07
Sign up to request clarification or add additional context in comments.

1 Comment

This is the only place where I've found "Uninstall Beignet."
1

I was able to solve that DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument error as well by removing the Beignet OpenCL driver.

This is a stopgap solution though, because I did have the Beignet driver working well alongside the Nvidia OpenCL (CUDA 9.1) driver. The problem started when I had to downgrade the Nvidia OpenCL driver to one that is based on CUDA 9.0, which I had to do in an attempt to install TensorFlow 1.8 on an Ubuntu 18.4 machine. My stuff is too new and only partially supported it seems!

Yannis
1,7198 gold badges30 silver badges51 bronze badges
answered May 9, 2018 at 8:34

Comments

0

I did resolve a similar problem by removing the package [beignet-opencl-icd]

apt-get remove beignet-opencl-icd
answered Aug 9, 2019 at 21:58

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.