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

clvk stopped working on Android after adding buffer device address support #491

Closed
truboxl opened this issue Jan 2, 2023 · 3 comments · Fixed by #496
Closed

clvk stopped working on Android after adding buffer device address support #491

truboxl opened this issue Jan 2, 2023 · 3 comments · Fixed by #496
Assignees

Comments

@truboxl
Copy link
Contributor

truboxl commented Jan 2, 2023

~ $ OCL_ICD_DEBUG=15 clinfo
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:708): __initClIcd: OPENCL_VENDOR_PATH unset or empty. Using hard-coded path '/data/data/com.termux/files/usr/etc/OpenCL/vendors'
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:714): __initClIcd: OCL_ICD_VENDORS empty or not defined, using vendors path '/data/data/com.termux/files/usr/etc/OpenCL/vendors'
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:733): __initClIcd: Reading icd list from '/data/data/com.termux/files/usr/etc/OpenCL/vendors'
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:201): _find_num_icds: return: 1/0x1
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:232): _open_driver: Considering file '/data/data/com.termux/files/usr/etc/OpenCL/vendors/clvk.icd'
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:206): _load_icd: Loading ICD '/data/data/com.termux/files/usr/lib/clvk/libOpenCL.so'
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:213): _load_icd: error while dlopening the IDL: 'dlopen failed: cannot locate symbol "vkGetBufferDeviceAddress" referenced by "/data/data/com.termux/files/usr-aarch64/lib/clvk/libOpenCL.so"...',
  => skipping ICD
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:264): _open_driver: return: 0/0x0
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:277): _open_drivers: return: 0/0x0
ocl-icd(/home/builder/.termux-build/ocl-icd/src/ocl_icd_loader.c:1021): clGetPlatformIDs: return: -1001/0xfffffffffffffc17
Number of platforms                               0

The latest commit 6ccb8a0 stopped working on my Android 11 device.
I am not sure whether its because of building clvk myself differently from the guide.
But using the older commit does work and I will temporarily revert my build to that commit.
I will checkout the GitHub Actions artifacts later to see if it can reproduce or not. (that thing is huge! ~2GB)

@kpet kpet self-assigned this Feb 26, 2023
kpet added a commit that referenced this issue Feb 26, 2023
Fixes #491

Change-Id: I4c712a4c2da2edd59bcd893237b5cf13edb7392e
Signed-off-by: Kévin Petit <kpet@free.fr>
@kpet
Copy link
Owner

kpet commented Feb 26, 2023

@truboxl Thanks for the report! I didnt know you were packaging clvk for Android, that's great to see :). I've opened #496 which should fix the issue you're seeing. This issue will automatically close once the PR is merged as I'm very confident it fixes the issue described here but if that's not the case feel free to reopen the issue. Also, if there's anything we can do to help you package clvk on Android or provide a better user experience, don't hesitate to create further issues. Thanks!

@truboxl
Copy link
Contributor Author

truboxl commented Feb 27, 2023

Hi @kpet
I think you will find https://android.googlesource.com/platform/frameworks/native/+/master/vulkan/libvulkan/libvulkan.map.txt helpful on understanding the extent to support Android.

    vkGetBufferDeviceAddress; # introduced=31

In this case API 31 translates to Android 12. Do you allow PR that workaround old Android version? Usually older version dont have the proper symbols in their system libvulkan.so.

It maybe helpful to have at least some form of release version. This will be a great help for downstream distro to package clvk. Currently I am using some cryptic versioning while packaging clvk, eg: 0.0.20230218.101959gfb7b75ce 😂

@kpet kpet closed this as completed in #496 Mar 1, 2023
kpet added a commit that referenced this issue Mar 1, 2023
…496)

* Fix test build with non-loader Vulkan implementation

Change-Id: I867b47c8b73f97495e7379b6958881f5214b444e

* Do not assume vkGetBufferDeviceAddress is available to link against

Fixes #491

Change-Id: I4c712a4c2da2edd59bcd893237b5cf13edb7392e
Signed-off-by: Kévin Petit <kpet@free.fr>

* format fixes

Change-Id: I6c19b799c7c385113cb5759441abb04606017677

---------

Signed-off-by: Kévin Petit <kpet@free.fr>
@kpet
Copy link
Owner

kpet commented Mar 1, 2023

@truboxl

Do you allow PR that workaround old Android version?

Yes, definitely open to making changes so clvk can work with more Android versions. Feel free to create issues or open PRs. I can't promise someone would pick up the issues but it's always good to know what would be useful.

It maybe helpful to have at least some form of release version.

Yes, I agree we need to do better there :). I've created #499. Thoughts welcome!

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

Successfully merging a pull request may close this issue.

2 participants