Issues about modifying the source code

@agibsonccc Hi, have you found any time free to help me solve the privilege issue with the emulator configuration provided above? Thanks!

@fubuki I might be able to get to this after the holiday. I’ll keep you posted. This just requires a bit of research on my part and I haven’t seen this problem before. I wanted to spend some quality time with the android sample to see what problems people typically have when running android so we can document that better.

@agibsonccc Thank you for your help! If there is something I can help, please contact me in this topic. Or you can also email me.

Hi there! Have you got some free time to handle the problem with the android sample these days? Thank you!

@fubuki I’m touching the examples up now and wanted to look at this. M2 will be out within a week or so (doing final testing so should be this week)

Thank you! Hope that the M2 will be successfully released. I would try M2 as soon as it is released. :grin:

@fubuki updated the android example with the latest release. Do you mind trying it? It ran on my phone as well.

Yeah, I’m very glad to try the newly updated example. I would give you feedback once I try it. Thank you!

Hi, there. I found that in your newly updated android example, there is an unexpected ‘0’ character in the line 28 in the following file, which makes the gradle sync process failed.

@fubuki removed. Sorry not sure how that got in there.

Hi, I tried the M2 in your new Android example as well as my project, but the Logcat in Android Studio still prints some linker error like before. My project code still got stuck for about 10 minutes in the first time calling the calculateGradients() function. The project is in the following github link and the problem line is highlighted. Could you please help me solve this problem? You can try it on the emulator. My emulator is Pixel 4 XL API 30. Thanks for your help!

@fubuki let’s establish a baseline. Did you just try running the pre existing android example as is with no modification?
If you’re still having issues it might be something environment specific. Did you try different emulators as well? I feel if it still fails at this point despite me running it both on my phone and the emulator you have a problem with your local environment and we should narrow that down.

I just download the android example from your github repo without any modification. Your android example runs without any error except the linker error printed in the Logcat. I am wondering whether there is some permission I did not get so the linker error will happen.

2022-03-14 09:42:23.110 18010-18036/com.example.androidDl4jClassifier E/linker: library "/apex/com.android.vndk.v30/lib64/android.hardware.graphics.common@1.2.so" ("/apex/com.android.vndk.v30/lib64/android.hardware.graphics.common@1.2.so") needed or dlopened by "/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/lib/x86_64/libjnijavacpp.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/lib/x86_64:/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/base.apk!/lib/x86_64", permitted_paths="/data:/mnt/expand:/data/data/com.example.androidDl4jClassifier"]
2022-03-14 09:42:23.110 18010-18036/com.example.androidDl4jClassifier E/linker: library "/vendor/lib64/libvulkan_enc.so" ("/vendor/lib64/libvulkan_enc.so") needed or dlopened by "/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/lib/x86_64/libjnijavacpp.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/lib/x86_64:/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/base.apk!/lib/x86_64", permitted_paths="/data:/mnt/expand:/data/data/com.example.androidDl4jClassifier"]
2022-03-14 09:42:23.110 18010-18036/com.example.androidDl4jClassifier E/linker: library "/vendor/lib64/libandroidemu.so" ("/vendor/lib64/libandroidemu.so") needed or dlopened by "/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/lib/x86_64/libjnijavacpp.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/lib/x86_64:/data/app/~~34Nh8gBLRvRZ_yTlNowgEA==/com.example.androidDl4jClassifier-GcUzET-kgowWxc_vqBl74w==/base.apk!/lib/x86_64", permitted_paths="/data:/mnt/expand:/data/data/com.example.androidDl4jClassifier"]

For my own project, I use the calculateGradients() function, which is not used in your example. I only tried one emulator but in different computers.
Can you tell me what your emulator is? I can try it on your emulator. Or can you provide me with an android example where the Samediff api is used?

@fubuki could you try recreating your image and see if that does anything? I just freshly created mine from scratch and it works fine. Here is my configuration.

I was also able to use pair devices via wifi to set it up.
Can you spot any different maybe I can help with?
I didn’t do anything special for mine and I also didn’t really have to look at logcat it just ran.

Your example ran in my emulator and physical devices too.
But the main problem is that my program get stuck when I explicitly call the calculateGradients() function in SameDiff package. Your android example does not use any SameDiff API.

@fubuki ok so that’s what I was asking about. I just wanted to make sure that we were at least compatible with no code changes. Is your code still in the same repository?

If so I can take a look again and see. It’s odd to me that a call to a specific function would trigger a problem though. That example trains a model. Binaries are also always loaded at the beginning.

The adhoc loading in the middle of some very specific binaries based on a function call feels like very 1 off behavior but I’ll have to look closer at this.

The basic configuration of my own project is almost the same as the android example with some user-permission added. Here is the screenshot.

It’s also odd to me because the function did not get stuck after the first call. (But it gets stuck again when the app rerun).
My code has been updated to get compatible with your M2 version. So plaese refer to the new github repo in the following link. Thank you!

Hi, there! Have you found some free time to help me check the calculateGradients() problem? Thank you.

@fubuki not yet. Still in the middle of a feature sprint. I had a bit of time in between releases but it’s hard to pinpoint off the top of my head without downloading your code and just running it myself.

OK, I totally understand. I will wait for your free time. Thank you a lot :smiley: