Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android target升级到31、33 后(target30及以下gpu正常),无法使用gpu模式。cpu 模式使用正常。 compileSdkVersion 33 buildToolsVersion "30.0.3" ndkVersion '20.1.5948944' defaultConfig { minSdkVersion 15 targetSdkVersion 33 机型:红米note12T、k60 #1955

Open
cq186 opened this issue Aug 28, 2023 · 1 comment

Comments

@cq186
Copy link

cq186 commented Aug 28, 2023

1. 环境(environment)

  • Build OS and Version:Windows
  • RunTime OS Version:/Android/
  • RunTime DEVICE: OPENCL

5. 详细描述bug 情况 (Describe the bug)
android target升级到31、33 后,无法使用gpu。cpu 模式使用正常

6. 运行日志(runtime log)
2023-08-29 00:04:05.326 22586-22586 tnn com.tencent.tnn.demo I jint Java_com_tencent_tnn_demo_ObjectDetector_init(JNIEnv *, jobject, jstring, jint, jint, jfloat, jfloat, jint, jint) [File E:\xmatting\tnn\examples\android\demo\src\main\jni\cc\objectdetector_jni.cc][Line 36] proto content size 10348 model content size 29849719
2023-08-29 00:04:05.333 22586-22586 tnn com.tencent.tnn.demo I jint Java_com_tencent_tnn_demo_ObjectDetector_init(JNIEnv *, jobject, jstring, jint, jint, jfloat, jfloat, jint, jint) [File E:\xmatting\tnn\examples\android\demo\src\main\jni\cc\objectdetector_jni.cc][Line 45] the device type 1 device huawei_npu
2023-08-29 00:04:05.713 22586-22586 tnn com.tencent.tnn.demo E virtual tnn::Status tnn::TNNSDKSample::Init(std::shared_ptr) [File E:\xmatting\tnn\examples\base\tnn_sdk_sample.cc][Line 695] inittnn: 4096 ,cache:, libraray:
2023-08-29 00:04:05.739 22586-22586 tnn com.tencent.tnn.demo I tnn::Status tnn::OpenCLRuntime::Init() [File cl\opencl_runtime.cc][Line 124] OpenCL version: CL_TARGET_OPENCL_VERSION 200 CL_HPP_TARGET_OPENCL_VERSION 120 CL_HPP_MINIMUM_OPENCL_VERSION 110
2023-08-29 00:04:05.743 22586-22586 linker com.tencent.tnn.demo E library "/system/vendor/lib64/libOpenCL.so" ("/vendor/lib64/libOpenCL.so") needed or dlopened by "/data/app/~~mHbWpQpE9UIOuHhdNMApyA==/com.tencent.tnn.demo-rMPdy3sKQIPbA8ga49akMA==/lib/arm64/libtnn_wrapper.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/~~mHbWpQpE9UIOuHhdNMApyA==/com.tencent.tnn.demo-rMPdy3sKQIPbA8ga49akMA==/lib/arm64:/data/app/~~mHbWpQpE9UIOuHhdNMApyA==/com.tencent.tnn.demo-rMPdy3sKQIPbA8ga49akMA==/base.apk!/lib/arm64-v8a", permitted_paths="/data:/mnt/expand:/data/data/com.tencent.tnn.demo"]
2023-08-29 00:04:05.744 22586-22586 tnn com.tencent.tnn.demo E tnn::Status tnn::OpenCLContext::Init() [File cl\opencl_context.cc][Line 277] OpenCL Runtime Init() failed (ret = 36865)!
2023-08-29 00:04:05.745 22586-22586 tnn com.tencent.tnn.demo E virtual tnn::Status tnn::TNNSDKSample::Init(std::shared_ptr) [File E:\xmatting\tnn\examples\base\tnn_sdk_sample.cc][Line 720] 2222222:0 status:36865 instance:0
2023-08-29 00:04:05.745 22586-22586 tnn com.tencent.tnn.demo E virtual tnn::Status tnn::TNNSDKSample::Init(std::shared_ptr) [File E:\xmatting\tnn\examples\base\tnn_sdk_sample.cc][Line 723] result:>>>>>>>> :256
2023-08-29 00:04:05.745 22586-22586 tnn com.tencent.tnn.demo E virtual tnn::Status tnn::TNNSDKSample::Init(std::shared_ptr) [File E:\xmatting\tnn\examples\base\tnn_sdk_sample.cc][Line 727] *Warning
2023-08-29 00:04:05.745 22586-22586 tnn com.tencent.tnn.demo E virtual tnn::Status tnn::TNNSDKSample::Init(std::shared_ptr) [File E:\xmatting\tnn\examples\base\tnn_sdk_sample.cc][Line 728] CreateInst failed for compute unit (256), automatically try cpu now

7. 截图(Screenshots)

![image](https://github.com/Tencent/TNN/assets/6063018/5de2187d-b1fe-4162-a5d1-69a7cd97ab09)

![image](https://github.com/Tencent/TNN/assets/6063018/a310b851-7d38-48a4-9201-ea883de0d046)
Paste screenshorts here or pastebin
@cq186 cq186 changed the title android target升级到31、33 后,无法使用gpu模式。cpu 模式使用正常 android target升级到31、33 后(target30及以下gpu正常),无法使用gpu模式。cpu 模式使用正常。 Aug 28, 2023
@cq186 cq186 changed the title android target升级到31、33 后(target30及以下gpu正常),无法使用gpu模式。cpu 模式使用正常。 android target升级到31、33 后(target30及以下gpu正常),无法使用gpu模式。cpu 模式使用正常。 compileSdkVersion 33 buildToolsVersion "30.0.3" ndkVersion '20.1.5948944' defaultConfig { minSdkVersion 15 targetSdkVersion 33 Aug 29, 2023
@cq186 cq186 changed the title android target升级到31、33 后(target30及以下gpu正常),无法使用gpu模式。cpu 模式使用正常。 compileSdkVersion 33 buildToolsVersion "30.0.3" ndkVersion '20.1.5948944' defaultConfig { minSdkVersion 15 targetSdkVersion 33 android target升级到31、33 后(target30及以下gpu正常),无法使用gpu模式。cpu 模式使用正常。 compileSdkVersion 33 buildToolsVersion "30.0.3" ndkVersion '20.1.5948944' defaultConfig { minSdkVersion 15 targetSdkVersion 33 机型:红米note12T、k60 Aug 29, 2023
@paulwgw88
Copy link

paulwgw88 commented Oct 19, 2023

AndroidManifest.xml里面添加
<uses-native-library android:name="libOpenCL.so" android:required="false" />

https://developer.android.google.cn/guide/topics/manifest/uses-native-library-element?hl=zh-cn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants