Skip to content

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

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

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

codereba
Copy link
Contributor

@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
Contributor

@cccclai cccclai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@cccclai cccclai merged commit 6f6fa6a into pytorch:main Mar 20, 2025
49 of 52 checks passed
oscarandersson8218 pushed a commit to oscarandersson8218/executorch that referenced this pull request Mar 21, 2025
…device. (pytorch#9073)

### Summary
Fixes pytorch#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

Signed-off-by: jijie <[email protected]>
jathu added a commit that referenced this pull request Mar 21, 2025
### Summary
Main is failing lint tests introduced in
#9073.


### Test plan

```
$ lintrunner -a
```
DannyYuyang-quic pushed a commit to CodeLinaro/executorch that referenced this pull request Apr 2, 2025
…device. (pytorch#9073)

### Summary
Fixes pytorch#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

Signed-off-by: jijie <[email protected]>
DannyYuyang-quic pushed a commit to CodeLinaro/executorch that referenced this pull request Apr 2, 2025
### Summary
Main is failing lint tests introduced in
pytorch#9073.


### Test plan

```
$ lintrunner -a
```
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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The execution permission of qnn_executor_runner file is removed after the runner file copied to android device.
4 participants