Forums - Unable to access OpenCL device on SD845

1 post / 0 new
Unable to access OpenCL device on SD845
Join Date: 8 Aug 19
Posts: 1
Posted: Thu, 2019-08-08 14:11

I am having a very weird issue with OpenCL on the Adreno GPU of a Snapdragon 845. This is runnning on an Ubuntu 16.04 system on the board.

The majority of my company's stack is written in Python with specific algorithms and solver libraries written in C++ and HPC languages such as OpenCL. Generally speaking, the application main loop runs in Python and loads extension libraries (.so files) that contain the native code. I am experiencing a very strange issue where all OpenCL API fns fail when they are loaded and executed from a Python context but behave normally when executed from a native C++ executable. Below is a link to a code sample that can be used to replicate this problem.

The code sample demonstrates the kind of execution that our stack is built on. It consists of a core C++ lib that uses OpenCL. This lib is built with pybind11 and loaded by our Python stack at runtime as an extension module. The lib interface allows for calling C++ code from Python. These C++ functions in turn call the OpenCL API.

The sample code tests the lib by manually linking it to a C++ binary as well as dynamically loading it from Python. In the former case, the pybind11 interface is unused. The behvaiour that we observe is that the native C++ compiled program runs as expected, but when going the Python route, all OpenCL API functions fail. Using GDB I have verfied that the two computation paths utilize the same shared library object  and follow the same code path within the library.

Since I do not have visibilty into the OpenCL library, I have no information as to why the call fails when the top level fn is originates from Python.

Would somebody be able to help shed some light on this issue?


  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.