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 1 forks source link

How to run in CUDA mode? #3

Open twmht opened 2 years ago

twmht commented 2 years ago

Hi,

the code use cpu mode, how to run in cuda mode with MNN?

Thank you.

twmht commented 2 years ago

see also https://github.com/alibaba/MNN/issues/1879

Qengineering commented 2 years ago

@twmht

Please see our guide. You may run into version issues as we haven't updated tutorial for a while.

twmht commented 2 years ago

@Qengineering

I have seen the tutorial, however, I can built latest MNN on jetson nano without any errors. Except when running with cuda forward the estimated running time was too fast to believe.

So you could not build MNN without applying those two PRs (1616 and 1530)? Or you can built but found some errors when running

Qengineering commented 2 years ago

@twmht Just installed the latest version of MNN 1.2.7. I didn't have to apply the two PR (#1616 and #1530) any more. Could not get it compiled with TensorRT. Run ./benchmark without specifying the forward type as MNN_FORWARD_CUDA is not a type recognized by the benchmark.cpp (see line 190)

static inline std::string forwardType(MNNForwardType type) {
    switch (type) {
        case MNN_FORWARD_CPU:
            return "CPU";
        case MNN_FORWARD_VULKAN:
            return "Vulkan";
        case MNN_FORWARD_OPENCL:
            return "OpenCL";
        case MNN_FORWARD_METAL:
            return "Metal";
        default:
            break;
    }
    return "N/A";
}

That's why you have the output "N/A" with your run.

Here's my run. MNNbench

Qengineering commented 2 years ago

See https://github.com/alibaba/MNN/pull/1880

twmht commented 2 years ago

@Qengineering

thanks

but I got the following errors when applying https://github.com/alibaba/MNN/pull/1880

image

there should be a fix for nano with cuda in MNN.

rlczddl commented 2 years ago

any progress?