Forums - Java Cannot USE DSP or GPU

8 posts / 0 new
Last post
Java Cannot USE DSP or GPU
dtspsfans
Join Date: 6 Jul 23
Posts: 6
Posted: Wed, 2023-09-13 01:46

We Use IQOO 11s (8gen2) and iqoo neo race 7 (8gen1+) , when we load the model ,it  showss do now support DSP an GPU .However ,we need it to accelerate the model 

try {
    Loger.i("rgbBitmapAsFloat == " + mModel.file.getAbsolutePath())
    val builder = NeuralNetworkBuilder(App.getInstance())
        .setDebugEnabled(false)
        .setModel(mModel.file)
        .setCpuFallbackEnabled(true)
        .setUnsignedPD(true)
        .setRuntimeOrder(NeuralNetwork.Runtime.DSP,NeuralNetwork.Runtime.GPU,NeuralNetwork.Runtime.CPU)

com.qualcomm.qti.snpe.SnpeError$IllegalArgsOrStateException: error_code : 73 error_message: None of the selected runtime targets are supported.

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Wed, 2023-09-13 02:34

Dear developer,

You might need to add below module to your Mainifests.xml in APK project.

        <uses-library
            android:name="libcdsprpc.so"
            android:required="true" />

 

BR.

Wei

  • Up0
  • Down0
dtspsfans
Join Date: 6 Jul 23
Posts: 6
Posted: Wed, 2023-09-13 02:47
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.world.videorecognize"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-permission android:name="android.permission.USB_PERMISSION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
    <application
        android:allowBackup="true"
        android:name=".app.App"
        android:largeHeap="true"
        android:hardwareAccelerated="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:networkSecurityConfig="@xml/network_security_config"
        tools:ignore="GoogleAppIndexingWarning"
        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.VideoRecognize">
        <activity
            android:name="com.world.videorecognize.MainActivity"
            android:exported="true"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.VideoRecognize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:exported="true"
            android:name="com.squareup.leakcanary.internal.DisplayLeakActivity"></activity>

        <provider
            android:name="com.world.videorecognize.DbContentProvider"
            android:authorities="com.world.videorecognize"
            android:enabled="true"
            android:grantUriPermissions="true"
            android:exported="true"></provider>

        <service
            android:name=".ModelExtractionService"
            android:exported="false">
        </service>

    </application>

</manifest>

 

  • Up0
  • Down0
dtspsfans
Join Date: 6 Jul 23
Posts: 6
Posted: Wed, 2023-09-13 03:28

Thank you 

DSP can be used ,but predict time stll very slow ,and the error like that:

vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:2989: Error 0xd: open_shell failed for domain 3 search paths used are /dsp/, /vendor/dsp/, /vendor/dsp/xdsp/ (errno Permission denied)

how to add it in the app? like the doc says?

  • Up0
  • Down0
dtspsfans
Join Date: 6 Jul 23
Posts: 6
Posted: Thu, 2023-09-14 08:12

the model can be loaded in CPU or GPU.But in DSP,It shows that 

 Unable to create network! Cause: error_code=1002; error_message=Layer parameter value is invalid. error_code=1002; error_message=Layer parameter value is invalid. No backend could validate Op=Conv_0 Type=Conv2d error code=3110; error_component=Model Validation; line_no=769; thread_id=502275169456; error_component=Model Validation; line_no=276; thread_id=502620093616 

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Sat, 2023-09-16 01:19

Dear developer,

Looks like your model failed to run on device after loaded to SNPE.

You can try to execute your mode on snpe-net-run instead of APP to check model runable quickly.

 

BR.

Wei

  • Up0
  • Down0
dtspsfans
Join Date: 6 Jul 23
Posts: 6
Posted: Tue, 2023-09-19 05:54

Thank you!

Actually,before we make the Andriod App,we tested the models.For one ,we use yolov5s,and tested it.it cost about 6000us one frame with  snpe-net-run . So ,we want to know that any dependency excpet the snpe-release.aar and platform-validator.aar?

  • Up0
  • Down0
dtspsfans
Join Date: 6 Jul 23
Posts: 6
Posted: Wed, 2023-09-20 07:37

We had export new Network,However,it didnot work.we also tried use sdk 29,but it alse doesn't work 

  • Up0
  • Down0
or Register

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.