This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Not able to trace OpenCL api's using MGD V.4.2.1

I am trying to trace the OpenCL calls using the MGD V4.2.1 but I don't see any calls being traced.

I have done the setup both on the target and host side and able to trace the OpenGL calls using the same setup.

Setup I have done on my host and target:

adb remount

adb push "C:\Program Files\ARM\Mali Developer Tools\Mali Graphics Debugger v4.2.0\target\android\arm\mgddaemon" /system/bin/mgddaemon

adb push "C:\Program Files\ARM\Mali Developer Tools\Mali Graphics Debugger v4.2.0\target\android\arm\egl.cfg"  /vendor/lib/egl/egl.cfg

adb push "C:\Program Files\ARM\Mali Developer Tools\Mali Graphics Debugger v4.2.0\target\android\arm\egl.cfg"  /vendor/lib64/egl/egl.cfg

adb push "C:\Program Files\ARM\Mali Developer Tools\Mali Graphics Debugger v4.2.0\target\android\arm\armeabi-v7a\libGLES_mgd.so" /vendor/lib/egl/libGLES_mgd.so

adb push "C:\Program Files\ARM\Mali Developer Tools\Mali Graphics Debugger v4.2.0\target\android\arm\arm64-v8a\libGLES_mgd.so" /vendor/lib64/egl/libGLES_mgd.so

adb shell chmod 777 /system/bin/mgddaemon

adb shell chmod 777 /vendor/lib/egl/*

adb shell chmod 777 /vendor/lib64/egl/*

adb shell ln -s /vendor/lib/egl/libGLES_mgd.so /vendor/lib/egl/libGLES.so

adb shell ln -s /vendor/lib64/egl/libGLES_mgd.so /vendor/lib64/egl/libGLES.so

adb forward tcp:5002 tcp:5002

After doing all these setup I am able to run the mgddaemon on the host side and able to connect host to target but can't see any OpenCL calls in MGD.

I am using the 64bit kernel and 64bit Android M and application that I am using to trace for tracing the calls is Opencl-X Benchmark.

Need help to figure out what I am missing so that I can trace the calls?

Parents
  • You can't link against libGLES_mali.so directly when trying to insert a layer driver - you need to create an intermediate name to bounce the redirection off.

    The process needs to be something like this:

    When building your application:

    1. Rename libGLES_mali.so to libOpenCL.so and link against that.
    2. Ensure you do not link statically so it will search for the libOpenCL.so library on the target device.

    When running your application normally:

    1. On the target create a symlink called libOpenCL.so to point at libGLES_mali.so.

    When running your application with MGD:

    1. On the target create a symlink called libOpenCL.so to point at libGLES_mgd.so.
    2. The MGD interceptor should then correctly auto-load libGLES_mali.so when needed.

    Let me know how that goes.

    Cheers,
    Pete

Reply
  • You can't link against libGLES_mali.so directly when trying to insert a layer driver - you need to create an intermediate name to bounce the redirection off.

    The process needs to be something like this:

    When building your application:

    1. Rename libGLES_mali.so to libOpenCL.so and link against that.
    2. Ensure you do not link statically so it will search for the libOpenCL.so library on the target device.

    When running your application normally:

    1. On the target create a symlink called libOpenCL.so to point at libGLES_mali.so.

    When running your application with MGD:

    1. On the target create a symlink called libOpenCL.so to point at libGLES_mgd.so.
    2. The MGD interceptor should then correctly auto-load libGLES_mali.so when needed.

    Let me know how that goes.

    Cheers,
    Pete

Children