Insta360Develop / MediaSDK-Cpp

MediaSDK-Cpp is a C++ library to handle stitching, editing of media from Insta360 Cameras.
61 stars 9 forks source link

CUDA support for Ubuntu #12

Open xunjieliu opened 1 year ago

xunjieliu commented 1 year ago

I am using this SDK to stitch insta video files(.insv files), based on the example main.cc codes. Everything works fine and the functions are normal, but I found that of the most time it is a CPU-intensive task and my GPU seems idle.

According to the source codes of main.cc in this repo, bool enable_cuda is defaulted to be true, is it the normal case that my CPU does the most work or has something gone wrong with my configuration?

My environment

How to reproduce

  1. compile: g++ main.cc -std=c++11 -I../include -L../lib -lMediaSDK -lpthread -ltbb -lcuda -lMNN -o ../bin/stitcherSDKDemo
  2. add to LD_LIBRARY_PATH: export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/path/to/MediaSDK/lib
  3. run: ./stitcherSDKDemo -inputs video1.insv video2.insv -output output.mp4
xunjieliu commented 1 year ago

Should be solved by upgrading CUDA from 10.1 to 10.2 or above, with advice from a Insta 360 dev

xunjieliu commented 1 year ago

Only cuda 10.2 supported, cuda 11.x is not support

Hiroaki-K4 commented 1 year ago

@XunjieLiu Thanks for sharing the information. I'm facing a similar issue, is the environment you've had success with cuda10.2 on docker?

Tianweihaihaihai commented 1 year ago

Only cuda 10.2 supported, cuda 11.x is not support. pls update sdk version to support cuda 10.2

kiang commented 1 week ago

It looked like the latest sdk could support cuda 12. But it's still very slow. I have a RTX-4080 laptop version with 12 GB GPU memory. The demo script only use less than 1GB. CPU is busier than GPU.

Insta360 Studio installed in MacBook m1 with 8 gb memory is faster than Linux laptop with powerful GPU.