segment-anything-ncnn
segment-anything-ncnn copied to clipboard
how to run with vulkan on ubuntu
[0 Intel(R) UHD Graphics (TGL GT1)] queueC=0[1] queueG=0[1] queueT=0[1] [0 Intel(R) UHD Graphics (TGL GT1)] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0 [0 Intel(R) UHD Graphics (TGL GT1)] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1 [0 Intel(R) UHD Graphics (TGL GT1)] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1 [1 NVIDIA GeForce RTX 3090] queueC=2[8] queueG=0[16] queueT=1[2] [1 NVIDIA GeForce RTX 3090] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0 [1 NVIDIA GeForce RTX 3090] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1 [1 NVIDIA GeForce RTX 3090] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1 [2 NVIDIA GeForce RTX 3090] queueC=2[8] queueG=0[16] queueT=1[2] [2 NVIDIA GeForce RTX 3090] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0 [2 NVIDIA GeForce RTX 3090] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1 [2 NVIDIA GeForce RTX 3090] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1 [3 llvmpipe (LLVM 14.0.0, 256 bits)] queueC=0[1] queueG=0[1] queueT=0[1] [3 llvmpipe (LLVM 14.0.0, 256 bits)] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0 [3 llvmpipe (LLVM 14.0.0, 256 bits)] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1 [3 llvmpipe (LLVM 14.0.0, 256 bits)] subgroup=8 basic=1 vote=1 ballot=1 shuffle=1
int SegmentAnything::Load(const std::string& image_encoder_param, const std::string& image_encoder_bin, const std::string& mask_decoder_param, const std::string& mask_decoder_bin)
{
ncnn::create_gpu_instance();
image_encoder_net_.opt.use_vulkan_compute = 1;
image_encoder_net_.opt.num_threads=12;
image_encoder_net_.set_vulkan_device(1);
int ret = 0;
ret = image_encoder_net_.load_param(image_encoder_param.c_str());
if (ret < 0)
return -1;
ret = image_encoder_net_.load_model(image_encoder_bin.c_str());
if (ret < 0)
return -1;
mask_decoder_net_.opt.use_vulkan_compute = 1;
mask_decoder_net_.opt.num_threads=12;
mask_decoder_net_.set_vulkan_device(1);
ret = mask_decoder_net_.load_param(mask_decoder_param.c_str());
if (ret < 0)
return -1;
ret = mask_decoder_net_.load_model(mask_decoder_bin.c_str());
if (ret < 0)
return -1;
return 0;
}
but I got no mask when I use vulkan, and speed is slow