AnsweredAssumed Answered

OpenCL examples using OpenGL fail with error, e.g. SimpleGL

Question asked by craigd on Feb 24, 2013
Latest reply on Feb 27, 2013 by himanshu.gautam

_Most of the OpenCL examples run without errors and are very helpful in the learning process.  However, when I run SimpleGL (and others that use OpenGL) they fail with an error.  For example, here is SimpleGL:

____________________

cad@cad-ubuntu:/opt/AMDAPP/samples/opencl/bin/x86_64$ ./SimpleGL

Platform 0 : Advanced Micro Devices, Inc.

Platform found : Advanced Micro Devices, Inc.

 

Selected Platform Vendor : Advanced Micro Devices, Inc.

Device 0 : Barts Device ID is 0x1f51ba0

Number of displays 1

glXCreateContextAttribsARB 0x7f7010f38610

Number of interoperable devices 1

Interop Device ID is 0x1f51ba0

libGL error: failed to load driver: swrast

libGL error: Try again with LIBGL_DEBUG=verbose for more details.

X Error of failed request:  BadMatch (invalid parameter attributes)

  Major opcode of failed request:  155 (GLX)

  Minor opcode of failed request:  5 (X_GLXMakeCurrent)

  Serial number of failed request:  28

  Current serial number in output stream:  28

______________________

Here it is with "verbose" turned on:

______________________

cad@cad-ubuntu:/opt/AMDAPP/samples/opencl/bin/x86_64$ LIBGL_DEBUG=verbose ./SimpleGL

ukiDynamicMajor: found major device number 249

ukiDynamicMajor: found major device number 249

ukiOpenDevice: open result is 6, (OK)

ukiGetBusid returned 'PCI:1:0:0'

 

...skipping many lines...

 

Selected Platform Vendor : Advanced Micro Devices, Inc.

Device 0 : Barts Device ID is 0x268dba0

Number of displays 1

libGL: AtiGetClientDriverName: 12.10.5 fglrx (screen 0)

libGL: OpenDriver: trying /usr/lib/fglrx/dri/fglrx_dri.so

ukiDynamicMajor: found major device number 249

ukiDynamicMajor: found major device number 249

ukiOpenByBusid: Searching for BusID PCI:1:0:0

ukiOpenDevice: node name is /dev/ati/card0

ukiOpenDevice: open result is 9, (OK)

ukiOpenByBusid: ukiOpenMinor returns 9

ukiOpenByBusid: ukiGetBusid reports PCI:1:0:0

glXCreateContextAttribsARB 0x7f4ac44f6610

Number of interoperable devices 1

Interop Device ID is 0x268dba0

libGL: screen 0 does not appear to be DRI2 capable

libGL: OpenDriver: trying /usr/lib/fglrx/dri/tls/swrast_dri.so

libGL: OpenDriver: trying /usr/lib/fglrx/dri/swrast_dri.so

libGL error: dlopen /usr/lib/fglrx/dri/swrast_dri.so failed (/usr/lib/fglrx/dri/swrast_dri.so: cannot open shared object file: No such file or directory)

libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so

libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so

libGL error: failed to load driver: swrast

X Error of failed request:  BadMatch (invalid parameter attributes)

  Major opcode of failed request:  155 (GLX)

  Minor opcode of failed request:  5 (X_GLXMakeCurrent)

  Serial number of failed request:  28

  Current serial number in output stream:  28

_________________________

 

Before I get much further, here is more info on my system:

_________________________

cad@cad-ubuntu:/$ clinfo

Number of platforms:                             1

  Platform Profile:                              FULL_PROFILE

  Platform Version:                              OpenCL 1.2 AMD-APP (1113.2)

  Platform Name:                                 AMD Accelerated Parallel Processing

  Platform Vendor:                               Advanced Micro Devices, Inc.

  Platform Extensions:                           cl_khr_icd cl_amd_event_callback cl_amd_offline_devices

 

 

  Platform Name:                                 AMD Accelerated Parallel Processing

Number of devices:                               2

  Device Type:                                   CL_DEVICE_TYPE_GPU

  Device ID:                                     4098

  Board name:                                    AMD Radeon HD 6800 Series  

  Device Topology:                               PCI[ B#1, D#0, F#0 ]

  Max compute units:                             14

 

...skipping many lines...

 

Name:                                      AMD Phenom(tm) II X6 1100T Processor
  Vendor:                                    AuthenticAMD
  Device OpenCL C version:                   OpenCL C 1.2
  Driver version:                            1113.2 (sse2)
  Profile:                                   FULL_PROFILE
  Version:                                   OpenCL 1.2 AMD-APP (1113.2)
  Extensions:                                cl_khr_fp64 cl_amd_fp64 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_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_gl_sharing cl_ext_device_fission cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_popcnt

 

cad@cad-ubuntu:/$ glxinfo

name of display:

display:   screen: 0

direct rendering: Yes

server glx vendor string: ATI

server glx version string: 1.4

 

cad@cad-ubuntu:/$ fglrxinfo

display:   screen: 0

OpenGL vendor string: Advanced Micro Devices, Inc.

OpenGL renderer string: AMD Radeon HD 6800 Series  

OpenGL version string: 4.2.12172 Compatibility Profile Context 9.012

 

cad@cad-ubuntu:/$ ldconfig -p | grep GL

        libQtOpenGL.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4

        libQtOpenGL.so.4 (libc6) => /usr/lib/i386-linux-gnu/libQtOpenGL.so.4

        libQtOpenGL.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libQtOpenGL.so

        libGLU.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGLU.so.1

        libGLU.so.1 (libc6) => /usr/lib/i386-linux-gnu/libGLU.so.1

        libGLU.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGLU.so

        libGLU.so (libc6) => /usr/lib/i386-linux-gnu/libGLU.so

        libGLEWmx.so.1.8 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.8

        libGLEWmx.so.1.5 (libc6,x86-64) => /usr/lib/libGLEWmx.so.1.5

        libGLEW.so.1.8 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGLEW.so.1.8

        libGLEW.so.1.5 (libc6,x86-64) => /usr/lib/libGLEW.so.1.5

        libGLEW.so (libc6,x86-64) => /opt/AMDAPP/lib/x86_64/libGLEW.so

        libGLEW.so (libc6) => /opt/AMDAPP/lib/x86/libGLEW.so

        libGL.so.1 (libc6,x86-64) => /usr/lib/fglrx/libGL.so.1

        libGL.so.1 (libc6) => /usr/lib32/fglrx/libGL.so.1

        libGL.so (libc6,x86-64, OS ABI: Linux 2.4.20) => /usr/lib/x86_64-linux-gnu/libGL.so

        libGL.so (libc6,x86-64) => /usr/lib/fglrx/libGL.so

        libEGL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1

 

cad@cad-ubuntu:/$ find / -name 'libGL*'

...skipping over a few lines...

/usr/lib/libGLEW.so.1.5

/usr/lib/libGLEWmx.so.1.5

/usr/lib/fglrx/libGL.so.1.2

/usr/lib/fglrx/libGL.so.1

/usr/lib/fglrx/libGL.so

/usr/lib/libGLEWmx.so.1.5.2

/usr/lib/libGLEW.so.1.5.2

/usr/lib/i386-linux-gnu/libGLU.so.1.3.1

/usr/lib/i386-linux-gnu/mesa/libGL.so.1

/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0

/usr/lib/i386-linux-gnu/libGLU.so.1

/usr/lib/i386-linux-gnu/libGLU.so

/usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.8

/usr/lib/x86_64-linux-gnu/libGLU.a

/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1

/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1

/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0

/usr/lib/x86_64-linux-gnu/mesa/libGL.so

/usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.8.0

/usr/lib/x86_64-linux-gnu/libGLU.so.1

/usr/lib/x86_64-linux-gnu/libGLEW.so.1.8.0

/usr/lib/x86_64-linux-gnu/libGLU.so

/usr/lib/x86_64-linux-gnu/libGLEW.so.1.8

/usr/lib/x86_64-linux-gnu/libGL.so

/usr/lib32/fglrx/libGL.so.1.2

/usr/lib32/fglrx/libGL.so.1

_________________________________

 

The environment variable as set by /etc/X11/Xsessions.d/10fglrx yields:

 

cad@cad-ubuntu:/$ echo $LIBGL_DRIVERS_PATH

/usr/lib/fglrx/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/lib32/fglrx/dri:/usr/lib/i386-linux-gnu/dri

__________________________________

 

I went through the "Samples Release Notes," i.e. the "Important Notes" and the "Known Issues" to make sure that the appropriate simlinks existed.  In doing so, I noticed that the fglrx-libGL.so files no longer exist.  I first installed the AMD APP a couple of months ago, and recall that those files existed.  I realized that the fglrx-installer on Linux had updated the system to the newest AMD driver, so I "unistalled" and "installed" AMD APP as per the instructions contained in the "Installation Notes."  No errors during installation and it seems to work except for the noted problem with SimpleGL.

 

My system is Ubuntu 13.04 Raring x86_64 with the xorg-edgers PPA.

 

Perhaps my problem is an error in my simlinks?  Note that when ./SimpleGL tries to run it cannot find the swrast_dri.so library, yet they are there in the path defined by LIBGL_DRIVERS_PATH.

_____________________________

cad@cad-ubuntu:/$ sudo find / -name 'swrast*'

/usr/lib/i386-linux-gnu/dri/swrast_dri.so

/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so

____________________________

 

I did not see that others were having this problem.  Any help would be appreciated to solve this dilemma.  Thanks.

 

Craig

Outcomes