cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
choochoo
Visitor
Visitor
370 Views
Registered: ‎03-03-2021

I got a segmentation fault error when usingn excute_aysnc (Vart::Runner)

Jump to solution

Hi,

I have tried to use resnet50 on Versal board.

When i try to call execute_async I got a seg fault.

Thread 1 "resenet50" received signal SIGSEGV, Segmentation fault.
0x0000fffff47f1af8 in vart::dpu::DpuKernel::get_fingerprint() const () from /usr/lib/libvart-dpu-runner.so

What could be the problem.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
zhipengl
Xilinx Employee
Xilinx Employee
203 Views
Registered: ‎03-21-2021

code like this will solve this problem,Pass runner_ as a parameter of the constructor. subgrap and grap will be used in execute_async, but at this time they have been released.

class A{
private:
    unique_ptr<vart::Runner> runner_ = nullptr;

public:
    A(unique_ptr<vart::Runnerrunner){
        runner_ = std::move(runner);
    }

    void do_sth(){
            ......
    }   
};


int main(int argcchar** argv){
     .........
    auto runner = vart::Runner::create_runner(subgraph[0], "run");
    A a(std::move(runner));
    a.do_sth();
    return 0;
}
 
or you can define subgraph and graph as private member variables of class A.

 

 

View solution in original post

5 Replies
zhipengl
Xilinx Employee
Xilinx Employee
342 Views
Registered: ‎03-21-2021

hello,

Can you provide more information to help locate the problem?

choochoo
Visitor
Visitor
316 Views
Registered: ‎03-03-2021

Hi,

Target Board : VCK190 DPU (DPUCVDX8G)

Model : /usr/share/vitis_ai_library/models/resnet50/resnet50.xmodel

Usage :

class A {
private:
   unique_ptr<vart::Runner> runner_ = nullptr;

public:
   A(){
      const char *model_filename = "/usr/share/vitis_ai_library/models/resnet50/resnet50.xmodel";

      /*load model*/
      auto graph = xir::Graph::deserialize(model_filename);
      auto subgraph = get_dpu_subgraph(graph.get());
      /*create runner*/
      runner_ = std::move(vart::Runner::create_runner(subgraph[0], "run"));

      // ...
   }

   void do_sth(){
      // ...
      auto job_id = runner_->execute_async(inputsPtr, outputsPtr);
      runner_->wait(job_id.first, -1);
      // ...
   }

};

Thanks

0 Kudos
zhipengl
Xilinx Employee
Xilinx Employee
264 Views
Registered: ‎03-21-2021

Thanks for your feedback.

Please check whether your version of Vitis AI and XModel is v1.3, ref AI-Model-Zoo to get xmodel file of Vitis AI 1.3 for VCK190. VCK 190's Vitis AI 1.3.1 is still in the EA stage.

choochoo
Visitor
Visitor
245 Views
Registered: ‎03-03-2021

Xmodels and Vitis AI have already been verified through https://github.com/Xilinx/Vitis-AI/tree/master/demo/VART/resnet50 Example code.

It seems to be a problem related to usage, not an environmental problem.

 

0 Kudos
zhipengl
Xilinx Employee
Xilinx Employee
204 Views
Registered: ‎03-21-2021

code like this will solve this problem,Pass runner_ as a parameter of the constructor. subgrap and grap will be used in execute_async, but at this time they have been released.

class A{
private:
    unique_ptr<vart::Runner> runner_ = nullptr;

public:
    A(unique_ptr<vart::Runnerrunner){
        runner_ = std::move(runner);
    }

    void do_sth(){
            ......
    }   
};


int main(int argcchar** argv){
     .........
    auto runner = vart::Runner::create_runner(subgraph[0], "run");
    A a(std::move(runner));
    a.do_sth();
    return 0;
}
 
or you can define subgraph and graph as private member variables of class A.

 

 

View solution in original post