cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
164 Views
Registered: ‎11-16-2018

How should I check the status of DPU to avoid calling dpuOpen() & dpuClose() multiple times within the same applicaiton?

Ladies and Gentlemen,

 

I am building an application that loads multiple kernenls to dpu and created an independent class for each module. The issue is each module requires to call dpuOpen in their constructor and dpuClose in their destructor. However, I faced an issue that my program throws the folloiwng warning message if I call dpuClose twice:

[DNNDK] DPU device file not opened as expected
[DNNDK] Please invoke N2Cube Runtime API dpuOpen() first.

So I was wondering if I can check the status of dpu during runtime. So how should I check the status of DPU during runtime?

1 Reply
Highlighted
Xilinx Employee
Xilinx Employee
37 Views
Registered: ‎03-27-2013

Re: How should I check the status of DPU to avoid calling dpuOpen() & dpuClose() multiple times within the same applicaiton?

Hi @mghodsi ,

 

If the "opened" status is important to you on your application I would suggest you just use a variable to store this status.

The dpuOpen() and dpuClose() would return 0 if succeed according to https://www.xilinx.com/support/documentation/sw_manuals/ai_inference/v1_6/ug1327-dnndk-user-guide.pdf

 

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------