Vitis host program detect SDx device instead of Vitis device?

0

Hello,
Here we have one demo accelerator program developed, which running on local U200 card perfectly. We move this onto AWS F1 instance. and we meet below issue:

  1. under HW emulation mode, it works fine:
load and prepare signature data file:    took 0.178000 ms to execute 
INFO: Found 1 platforms
INFO: Selected platform 0 from Xilinx
INFO: Found 1 devices
CL_DEVICE_NAME xilinx_aws-vu9p-f1_shell-v04261818_201920_1
Selected xilinx_aws-vu9p-f1_shell-v04261818_201920_1 as the target device
  1. under HW mode, report target device not found:
INFO: Found 1 platforms
INFO: Selected platform 0 from Xilinx
INFO: Found 2 devices
CL_DEVICE_NAME xilinx_aws-vu9p-f1_dynamic_5_0
CL_DEVICE_NAME xilinx_aws-vu9p-f1_dynamic_5_0
Target device xilinx_aws-vu9p-f1_shell-v04261818_201920_1 not found. Exit.

This is weird as by my understanding, xilinx_aws-vu9p-f1_dynamic_5_0 is SDx platform name?
I checked env setup--this shall be setup by aws script vitis_setup.sh, which is also correct.

AWS_PLATFORM_201920_1=/home/ubuntu/aws/aws-fpga/Vitis/aws_platform/xilinx_aws-vu9p-f1_shell-v04261818_201920_1/xilinx_aws-vu9p-f1_shell-v04261818_201920_1.xpfm

Below is the relevant code in host program--quite strightfoward nothing special. function clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 1024, cl_device_name, 0)
return the cl_device_name which is wrong.

Does anyone have suggestion? Thanks so much!

    //iterate all devices to select the target device.
    for (cl_uint i=0; i<num_devices; i++) {
        err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 1024, cl_device_name, 0);
        if (err != CL_SUCCESS) {
            printf("Error: Failed to get device name for device %d!\n", i);
            printf("Test failed\n");
            return EXIT_FAILURE;
        }
        
        printf("CL_DEVICE_NAME %s\n", cl_device_name);
        if(strcmp(cl_device_name, target_device_name) == 0) {
            device_id = devices[i];
            device_found = 1;
            printf("Selected %s as the target device\n", cl_device_name);
        }
    }

    if (!device_found) {
        printf("Target device %s not found. Exit.\n", target_device_name);
        return EXIT_FAILURE;
    }
gefragt vor 4 Jahren297 Aufrufe
6 Antworten
0

Hi macleonsh,

I wonder if your application AFI been loaded? Can you check by calling:

sudo fpga-describe-local-image -S0

If the AFI loaded is the same as the AFI you loaded to get MPD working, that should show the SDAccel platform with which the AFI was created.

In a working case, your application should be looking at your awsxclbin, getting the AFI information encoded in the awsxclbin, call XRT to load your application AFI for you.

-Deep

Deep_P
beantwortet vor 4 Jahren
0

Yes previously I preload the AFI (was official Helloworld AFI) .

Now I clear that AFI and load myself build afi, which is build by Vitis.
Then I run the test, the result is same:

$ lspci
...
00:1b.0 Memory controller: Amazon.com, Inc. Device f010
00:1c.0 Memory controller: Amazon.com, Inc. Device 1041
00:1d.0 Memory controller: Amazon.com, Inc. Device f010
00:1e.0 Memory controller: Amazon.com, Inc. Device 1041
...
$ sudo fpga-describe-local-image -S1
AFI          1       agfi-0f66f8dfc0823876c  loaded            0        ok               0       0x04261818
AFIDEVICE    1       0x1d0f      0xf010      0000:00:1d.0
$ sudo fpga-describe-local-image -S1 -S0
AFI          0       agfi-0f66f8dfc0823876c  loaded            0        ok               0       0x04261818
AFIDEVICE    0       0x1d0f      0xf010      0000:00:1b.0

///run my application:
load and prepare signature data file:    took 0.134000 ms to execute 
INFO: Found 1 platforms
INFO: Selected platform 0 from Xilinx
INFO: Found 2 devices
CL_DEVICE_NAME xilinx_aws-vu9p-f1_dynamic_5_0
CL_DEVICE_NAME xilinx_aws-vu9p-f1_dynamic_5_0
Target device xilinx_aws-vu9p-f1_shell-v04261818_201920_1 not found. Exit.

Interestingly, I build the Vitis helloworld example and run the test, from the log, it looks that also reported device[0]=xilinx_aws-vu9p-f1_dynamic_5_0 ? and the program runs OK
Does that imply I can simply ignore the device check?

$ ./host ./vadd.awsxclbin
Found Platform
Platform Name: Xilinx
INFO: Reading ./vadd.awsxclbin
Loading: &#39;./vadd.awsxclbin&#39;
Trying to program device[0]: xilinx_aws-vu9p-f1_dynamic_5_0
Device[0]: program successful!
TEST PASSED
beantwortet vor 4 Jahren
0

Hi macleonsh,

The AWS Platform is hard-coded in XRT, so it is ok to ignore these checks.

-Deep

Deep_P
beantwortet vor 4 Jahren
0

Hi Macleonsh,

I am facing the same issue. You mentioned removing the part of code that matches the name of the target and device. I have a couple of questions. Does this work? and Is there any other workaround where we can set f1 instance FPGA name with xilinx_aws-vu9p-f1_shell-v04261818_201920_1 in place of xilinx_aws-vu9p-f1_dynamic_5_0 ?

Thanks,
Shashwat

Edited by: shashwats on Jul 1, 2020 5:17 AM

Edited by: shashwats on Jul 1, 2020 6:01 AM

beantwortet vor 4 Jahren
0

@shashwats
I am sorry, just find your question.. try to answer as much as possible.

You mentioned removing the part of code that matches the name of the target and device. I have a couple of questions. Does this work?
[I did not remember how I made the modification but it did not work anyway..]
and Is there any other workaround where we can set f1 instance FPGA name with xilinx_aws-vu9p-f1_shell-v04261818_201920_1 in place of xilinx_aws-vu9p-f1_dynamic_5_0 ?

[No, I don't think so--these two names are both shell name of F1 instance FPGA.. you may find them by using command locate *.xpfm (check below) -- what I find later was that if I use some specific AWS-FPGA branch (>= AWS-FPGA 1.14), when I do image build (using vitis) I need explicitly assign the DEVICE= /xilinx_aws-vu9p-f1_shell-v04261818_201920_2 then there are no problem anymore.
after AWS-FPGA 1.14, I shall use DEVICE=AWS_PLATFORM when build.


/home/ubuntu/aws/aws-fpga/SDAccel/aws_platform/xilinx_aws-vu9p-f1-04261818_dynamic_5_0/xilinx_aws-vu9p-f1-04261818_dynamic_5_0.xpfm
/home/ubuntu/aws/aws-fpga/Vitis/aws_platform/xilinx_aws-vu9p-f1_shell-v04261818_201920_2/xilinx_aws-vu9p-f1_shell-v04261818_201920_2.xpfm
/tools/Xilinx/Vitis/2019.2/platforms/xcvc1902_fixed/xcvc1902_fixed.xpfm

beantwortet vor 3 Jahren
0

@shashwats
I am sorry, just find your question.. try to answer as much as possible.

You mentioned removing the part of code that matches the name of the target and device. I have a couple of questions. Does this work?
[I did not remember how I made the modification but it did not work anyway..]
and Is there any other workaround where we can set f1 instance FPGA name with xilinx_aws-vu9p-f1_shell-v04261818_201920_1 in place of xilinx_aws-vu9p-f1_dynamic_5_0 ?

[No, I don't think so--these two names are both shell name of F1 instance FPGA.. you may find them by using command locate *.xpfm (check below) -- what I find later was that if I use some specific AWS-FPGA branch (>= AWS-FPGA 1.14), when I do image build (using vitis) I need explicitly assign the DEVICE= /xilinx_aws-vu9p-f1_shell-v04261818_201920_2 then there are no problem anymore.
after AWS-FPGA 1.14, I shall use DEVICE=AWS_PLATFORM when build.


/home/ubuntu/aws/aws-fpga/SDAccel/aws_platform/xilinx_aws-vu9p-f1-04261818_dynamic_5_0/xilinx_aws-vu9p-f1-04261818_dynamic_5_0.xpfm
/home/ubuntu/aws/aws-fpga/Vitis/aws_platform/xilinx_aws-vu9p-f1_shell-v04261818_201920_2/xilinx_aws-vu9p-f1_shell-v04261818_201920_2.xpfm
/tools/Xilinx/Vitis/2019.2/platforms/xcvc1902_fixed/xcvc1902_fixed.xpfm

beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen