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

fix issue: no member named create_gpu_instance in namespace ncnn #5471

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zhouwg
Copy link

@zhouwg zhouwg commented May 23, 2024

This PR is intent to fix following issue:

Screenshot from 2024-05-23 20-35-46

This issue could be reproduced very easily with official release pkg ncnn-20240410-android-vulkan.zip.

the root-cause is that NCNN_VULKAN was defined/hard-coded by CMake build script and many NCNN's internal codes heavily depend on the pre-defined/hard-coded NCNN_VULKAN, but some NCNN GPU APIs(such as create_gpu_instance, destroy_gpu_instance, get_gpu_count...) would be called in user's code even the scenario is pure CPU inference.

@github-actions github-actions bot added the core label May 23, 2024
@tencent-adm
Copy link

tencent-adm commented May 23, 2024

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@nihui nihui closed this May 28, 2024
@nihui nihui reopened this May 28, 2024
Comment on lines +4556 to +4559
int create_gpu_instance(const char* driver_path)
{
return 0;
}
Copy link
Member

Choose a reason for hiding this comment

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

Use NCNN_LOGE to warn users that ncnn has not been compiled with Vulkan support, and CPU computation will always be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants