tensorflow: TfLiteGpuDelegateV2Create() causes segmentation fault with tflite-gpu2.8 on native side in Android
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow):Yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):Android 10, API 29
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Galaxy S9
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): 2.8
- Python version: N/A
- Bazel version (if compiling from source): N/A
- GCC/Compiler version (if compiling from source): N/A
- CUDA/cuDNN version: N/A
- GPU model and memory: Qualcomm Adreno 630
You can collect some of this information using our environment capture script You can also obtain the TensorFlow version with:
- TF 1.0:
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
- TF 2.0:
python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"
Describe the current behavior
-
On Native side.
auto* delegate = TfLiteGpuDelegateV2Create(/*default options=*/nullptr);
results in following error with tensorflow-lite 2.8A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x18 in tid 23129 (com.example.gpu), pid 23129 (com.example.gpu)
-
In Java. GPU delegation works fine with tensorflow-lite 2.8, following code works well.
GpuDelegate.Options delegateOptions = compatList.getBestOptionsForThisDevice(); delegate = new GpuDelegate(delegateOptions); options.addDelegate(delegate);
Describe the expected behavior No segmentation fault in 1.
- Do you want to contribute a PR? (yes/no): Not at the moment
- Briefly describe your candidate solution(if contributing):
Standalone code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/Jupyter/any notebook. I downloaded the tflite-2.8 and tflite-gpu-2.8 from the maven repository(https://search.maven.org/) and added them to a new C++ Android project. And in the default native-lib.cpp added the above code, which throws the error.
Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 21 (8 by maintainers)
No, I’m not instantiating even 1 interpreter. I only added single line
auto* delegate = TfLiteGpuDelegateV2Create(/*default options=*/nullptr);
in a default native application, and it gives resulted in error. Please note that I downloaded the libs , tflite-2.8 and tflite-gpu-2.8, from the maven repository(https://search.maven.org/). Could there be difference.