Xilinx / xup_aie_training

Hands-on experience programming AI Engines using Vitis Unified Software Platform
https://xilinx.github.io/xup_aie_training/
MIT License
36 stars 9 forks source link

[Issue]: ERROR: GraphXRTImpl::configureIfNotYet: xrtGraphOpen failed. #13

Closed soumitraghosh388 closed 1 year ago

soumitraghosh388 commented 1 year ago

Is there an existing issue related to your problem?

Lab

Vector Add 2

Section

"Implement for actual hardware"

Step

While executing "./host_ps_on_x86 a.xclbin", I am getting the error.

Description

Continuing from my previous ISSUE (https://github.com/Xilinx/xup_aie_training/issues/12), I am getting this error after modifying host.cpp file. After going through host.cpp file, I found that it is not using AIEngine when invoked to run on hardware. I added some changes (lines 98 to 109) as shown below :

    // Execute the compute units
 93     std::cout << "Run the kernels" << std::endl;
 94     auto run_pl_s2mm_1 = pl_s2mm_1(out_buff_1, nullptr, num_elements);
 95     auto run_pl_mm2s_1 = pl_mm2s_1(in_buff_1, nullptr, num_elements);
 96     auto run_pl_mm2s_2 = pl_mm2s_2(in_buff_2, nullptr, num_elements);
 97  
 98 //////////////////////////////////////////
 99 // graph execution for AIE
100 //////////////////////////////////////////      
101
102     std::cout << "graph init\n"<< std::endl;
103     vadd_graph.init();
104
105     std::cout << "graph run\n" << std::endl;
106     vadd_graph.run(1);
107
108     vadd_graph.end();
109     std::cout << "graph end\n" << std::endl;
110
111     // Wait for kernels to complete
112     run_pl_mm2s_1.wait();
113     std::cout << "pl_mm2s_1 completed" << std::endl;
114     run_pl_mm2s_2.wait();
115     std::cout << "pl_mm2s_2 completed" << std::endl;
116     run_pl_s2mm_1.wait();
117     std::cout << "pl_s2mm_1 completed" << std::endl;

And also #include "graph.cpp" in the begining of the file.

I have followed all the compilation steps to generate all necessary executable files.

I am getting below error :

./host_ps_on_x86 a.xclbin

Initializing ADF API... Open the device Load the xclbin a.xclbin Get references to compute units Allocate Buffer in Global Memory Synchronize input buffers data to device global memory Run the kernels graph init

XRT build version: 2.14.384 Build hash: 090bb050d570d2b668477c3bd0f979dc3a34b9db Build date: 2022-12-09 00:55:08 Git branch: 2022.2 PID: 299684 UID: 1105 [Tue Oct 10 10:18:17 2023 GMT] HOST: hacc-vck5000-5 EXE: /home/spurini/soumitra/Vitis-Tutorials/AI_Engine_Development/Design_Tutorials/vadd_lab_hw/host_ps_on_x86 [XRT] ERROR: No such handle: Invalid argument ERROR: GraphXRTImpl::configureIfNotYet: xrtGraphOpen failed. GraphXRTImpl::configureIfNotYet: Couldn't find any configuration for graph id 0 ERROR: adf::graph::init: Failed to configure graph. graph run

[XRT] ERROR: No such handle: Invalid argument ERROR: GraphXRTImpl::configureIfNotYet: xrtGraphOpen failed. GraphXRTImpl::configureIfNotYet: Couldn't find any configuration for graph id 0 ERROR: adf::graph::run: Failed to configure graph. [XRT] ERROR: No such handle: Invalid argument ERROR: GraphXRTImpl::configureIfNotYet: xrtGraphOpen failed. GraphXRTImpl::configureIfNotYet: Couldn't find any configuration for graph id 0 ERROR: adf::graph::end: Failed to configure graph. graph end

pl_mm2s_1 completed pl_mm2s_2 completed pl_s2mm_1 completed Synchronize the output buffer data from the device TEST PASSED with 1024 elements


### Instance

```markdown
same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

Vitis

same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

XRT

same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

Platform

same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

Linux distribution

same as mentioned in "https://github.com/Xilinx/xup_aie_training/issues/12"

Anything else?

I have also made changes in "graph.cpp" as suggested in "https://support.xilinx.com/s/question/0D54U000071JJKPSA4/graphxrtimplconfigureifnotyet-couldnt-find-any-configuration-for-graph-id-0error-adfgraphinit-failed-to-configure-graph?language=en_US" but it fails while compiling "host.cpp" with error : multiple declarations of main(), one in graph.cpp and another in host.cpp.

Please reply if any additional info is needed. Thanks.

mariodruiz commented 1 year ago

Hi @soumitraghosh388,

In the VCK5000 the AIE graph cannot be controlled from the x86 code.

Please watch the End-to-End Development Flow with the VCK5000 here https://www.xilinx.com/products/boards-and-kits/vck5000.html#ai-engine

mariodruiz commented 1 year ago

If you have access to the VCK5000 Versal Development Card Secure Site, you will be able to see a tutorial for PS Kernel Usage. This is the way to control the AIE graph, but it is not supported on this repository.

soumitraghosh388 commented 1 year ago

Thank you.