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

VulkanDevice::init_device_extension() 存在崩溃可能性 #5478

Open
whyb opened this issue May 29, 2024 · 0 comments
Open

VulkanDevice::init_device_extension() 存在崩溃可能性 #5478

whyb opened this issue May 29, 2024 · 0 comments

Comments

@whyb
Copy link
Contributor

whyb commented May 29, 2024

error log | 日志或报错信息 | ログ

初始化ncnn时,在 VulkanDevice::init_device_extension() 中崩溃了。

以下是vc dump查看器的调用栈截图:

f4040cb3285b4d47879e51f8b27d8dc5
c7cb2aa67a2f89542a5a1f6ed3f02723

以下来自目前最新版ncnn的代码片段,以及个人理解给的注释

VkResult ret = vkCreateDevice(info.physical_device(), &deviceCreateInfo, 0, &d->device);  // 这一句失败了,d->device为无效值
if (ret != VK_SUCCESS)
{
    NCNN_LOGE("vkCreateDevice failed %d", ret);  // 这里是不是应该再加一句 return -1 ?
}

init_device_extension();  // 继续走到这步,会导致崩溃在 vkGetDeviceProcAddr() 函数上,进而程序退出!!!

context | 编译/运行环境 | バックグラウンド

根据日志分析,此客户两个显卡,分别是:

Intel(R) UHD Graphics 770
Vulkan API version:1.3.250
DriverVer: 31.0.101.4577 (09/08/2023)

DevName:NVIDIA GeForce RTX 3070
Vulkan API version:1.3.260
DriverVer: 31.0.15.4617 (11/15/2023)

OS: Windows 10
ncnn version: Commit hash: 92d49e1 2023/12/24 17:37:55

how to reproduce | 复现步骤 | 再現方法

这种环境下的用户只要调用 create_gpu_instance() 就崩溃,导致连用CPU推理都做不到了。

猜测和分析可能性

vk_instance是创建成功了,physical_device也是创建成功了,但是因为未知原因创建device失败了,百思不得其解,不管是不是驱动原因,先能否让其程序初始化成功,哪怕后续不让选GPU也行哇?

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

No branches or pull requests

1 participant