Qengineering / LFFD-MNN-Jetson-Nano

Face detection with MNN on a Jetson Nano
https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Vulkan backend not working with MNN #4

Open ghost opened 2 years ago

ghost commented 2 years ago

While trying to run benchmark.cpp utilizing the Vulkan backend as ./benchmark.out /home/ubuntu/MNN/models 1000 10 7 setting forward = MNN_FORWARD_VULKAN, I get the error Can't Find type=7 backend, use 0 instead even though I had built MNN following the instructions in here which also builds for the Vulkan backend setting -DMNN_VULKAN=true. I am working on an NVIDIA Jetson with Jetpack version 5.0.1.

Qengineering commented 2 years ago

That's a known issue. The benchmark software doesn't respond on Vulkan, nor CUDA settings. However, given the output, it is using CUDA behind the curtains. See #3

ghost commented 2 years ago

I think it falls back to the CPU when it is not able to find the Vulkan backend when I observe the output. I want the code to be using Vulkan behind the curtains to compare its performance with CUDA actually. How do I do that? #3 seems to correspond to running the code with CUDA and the fix given is for that right?

Qengineering commented 2 years ago

It's a stupid method. Just build MNN without CUDA and Vulkan and run your model to get the inference time. Then build MNN with Vulkan and see what the difference is. You could also build the framework with (only) CUDA and you'll have all the actual numbers. Given the relatively quick build-up of MNN, you shouldn't be working on it all day. On the other hand, I wouldn't recommend debugging and testing the benchmark software. And I have my doubts about the reliability of the benchmark itself. Better to test your model in the actual situation