Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.23k stars 4.15k forks source link

compile spir-v module failed. error #3310

Open HwanWoongLee opened 2 years ago

HwanWoongLee commented 2 years ago

I built using the latest version of Vulkan sdk. The following error occurs in the actual code.

image

ncnn::Net yolact;

yolact.opt.use_vulkan_compute = true;

// original model converted from https://github.com/dbolya/yolact
// yolact_resnet50_54_800000.pth
// the ncnn model https://github.com/nihui/ncnn-assets/tree/master/models
yolact.load_param("yolact.param");
yolact.load_model("yolact.bin");                // <---------- !!! here, occurs error !!!

Is there a solution?

nihui commented 2 years ago

do not enable NCNN_SYSTEM_GLSLANG for building use the internal glslang library instead

HwanWoongLee commented 2 years ago

It's already not being used. image

HwanWoongLee commented 2 years ago

Is there any other approach?

HwanWoongLee commented 2 years ago

@nihui Do you mean to use ncnn/glslang instead of glslang in VulkanSDK?

nihui commented 2 years ago

@nihui Do you mean to use ncnn/glslang instead of glslang in VulkanSDK?

yeah, exactly

HwanWoongLee commented 2 years ago

@nihui Thank you for your answer. I copied the contents of ncnn\glslang to vulkanSDK. (include, lib) But this time, there will be an access violation of access. Is there a reason why you're suspicious?

image image

HwanWoongLee commented 2 years ago

image

An exception occurs in load_model -> layer->create_pipe(opt1). (net.cpp file) Debugging is no longer easy.

nihui commented 2 years ago

@nihui Thank you for your answer. I copied the contents of ncnn\glslang to vulkanSDK. (include, lib) But this time, there will be an access violation of access. Is there a reason why you're suspicious?

You don’t need to change anything in vulkan-sdk. After the git submodule is configured, open the NCNN_VULKAN cmake option and build ncnn.

There are steps on the wiki for reference https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017

HwanWoongLee commented 2 years ago

@nihui I already checked NCNN_VULKAN. After the 'install' build, the library needed for the created folder was not added, so I manually put it in, and it works.

This time, there is a CPU issue. When Vulkan is activated and yolact is executed, it is definitely faster. However, CPU usage is still 100% and GPU usage is not increasing. Is there a solution to this?

https://github.com/Tencent/ncnn/issues/3318#issue-1040916988

wwzh2015 commented 2 years ago

@nihui Thank you for your answer. I copied the contents of ncnn\glslang to vulkanSDK. (include, lib) But this time, there will be an access violation of access. Is there a reason why you're suspicious?

You don’t need to change anything in vulkan-sdk. After the git submodule is configured, open the NCNN_VULKAN cmake option and build ncnn.

There are steps on the wiki for reference https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017

But tips the bug g:\1.2.148.0\include\vulkan\vulkan_core.h(2608): error C2059: 语法错误:“module”

line:2608 VkShaderModule module;

EricTonyLiu commented 2 years ago

Hi I met the same problem,does it mean that i need to link all the .a in the lib in the cmake_list?