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

Add the execution permission after the runner file copied to android device. #9073

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codereba
Copy link

@codereba codereba commented Mar 9, 2025

Summary

Fixes #9072

The executable file: qnn_executor_runner executable permission is removed on the mobile device (I tested on one plus phone, os 15) after it's copied to the mobile device;

The attributes of the original file:
-rwxr-xr-x 1 . . 53039224 Mar 9 13:38 examples/qualcomm/executor_runner/qnn_executor_runner*

The attributes of the copied file on the mobile device:
-rw-rw-rw- 1 . . 53039224 2025-03-09 00:38 executorch/dl3_qnn_q8/qnn_executor_runner

The step of qnn example is failed by the following error messages:

/system/bin/sh: ./qnn_executor_runner: can't execute: Permission denied
/data/local/tmp/executorch/dl3_qnn_q8/outputs/: 0 files pulled, 0 skipped.
Traceback (most recent call last):
  File "executorch/examples/qualcomm/scripts/deeplab_v3.py", line 200, in <module>
    main(args)
  File "executorch/examples/qualcomm/scripts/deeplab_v3.py", line 161, in main
    np.fromfile(
FileNotFoundError: [Errno 2] No such file or directory: './deeplab_v3/outputs/output_0_0.raw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "executorch/examples/qualcomm/scripts/deeplab_v3.py", line 206, in <module>
    raise Exception(e)
Exception: [Errno 2] No such file or directory: './deeplab_v3/outputs/output_0_0.raw'

So, for running example easily, I added the "chmod +x ./qnn_executor_runner" before running it.
Local test is successful, after adding this line the runner is running successfully on the device.

I found a solution, that need the root privilege to run the adb command, I think use the chmod +x is the lite method.

Test plan

  1. Connect to the android device with debug mode.
  2. Compile and run the android example by referencing the tutorial:
    https://pytorch.org/executorch/main/backends-qualcomm.html

…device:

The executable file: qnn_executor_runner executable permission is removed on the mobile device (I tested on one plus phone, os 15) after it's copied to the mobile device,
The attributes of the original file:
-rwxr-xr-x 1 . . 53039224 Mar  9 13:38 examples/qualcomm/executor_runner/qnn_executor_runner*
The attributes of the copied file on the mobile device:
-rw-rw-rw- 1 . . 53039224 2025-03-09 00:38 executorch/dl3_qnn_q8/qnn_executor_runner

So, for running example easily, I added the "chmod +x ./qnn_executor_runner" before running it.

Local test is successfully, after add this line the runner is running successfully on the device.

Signed-off-by: jijie <[email protected]>
@codereba codereba requested a review from cccclai as a code owner March 9, 2025 08:40
Copy link

pytorch-bot bot commented Mar 9, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9073

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 0c7ef88 with merge base 73b83ca (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 9, 2025
Copy link

github-actions bot commented Mar 9, 2025

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
3 participants