Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make xrtDeviceLoadXclbinUUID work #8034

Open
furkanturan opened this issue Mar 26, 2024 · 0 comments
Open

Cannot make xrtDeviceLoadXclbinUUID work #8034

furkanturan opened this issue Mar 26, 2024 · 0 comments

Comments

@furkanturan
Copy link

I need to give access to a third-party to my accelerator on my server. I wish to load the Alveo card with the .xclbin file, but do not give the users access to this file. That is my IP, and I want to protect it. The user will only receive a code that uses the accelerator. Not a binary, but source code, so that s/he can modify and profile the app as s/he wants.

Because, I use Rust for development, I use bindings over XRT's low-level API. Thus, I wish to use this routine:

fpga_device = xrtDeviceOpen(fpga_index);
xrtDeviceGetXclbinUUID(fpga_device, xclbin_uuid);
xrtDeviceLoadXclbinUUID(fpga_device, xclbin_uuid);
xrtPLKernelOpenExclusive(fpga_device, xclbin_uuid, kernel_name);

However, this does not work at all.

I find that it reads the uuid correctly in line 2. After line 2, the value at xclbin_uuid is same as the value that I read with xbutil examine. However, line 3 gives me the following error:

[XRT] ERROR: No such query request (34)
This is quite a poor error message.

Unfortunately, I could not find if my use of xrtDeviceLoadXclbinUUID is right or wrong?

In fact, I first thought that its use should be unnecessary. As the FPGA is already programmed. However, if I skip this function, again I cannot continue. It gives me the following error. However, this specific UUID is programmed in the FPGA; I can confirm with xbutil examine.

ERROR: No xclbin with uuid 'a0935cc1-bc3f-11a6-d055-e427c1970857': Invalid argument

I could not find any example use of xrtDeviceLoadXclbinUUID. Besides, its documentation seems poor.


When I check the XRT repo, I see that xrtDeviceLoadXclbinUUID calls load_xclbin function in src/runtime_src/core/common/device.cpp, and it wants to have the xclbin_full information, which is explained as:

// class xclbin_full - Implementation of full xclbin
//
// A full xclbin is constructed from a file on disk or from a complete
// binary images for file content

In my case, I do not want to give this file to user; hence, I am not sure if XRT can still load the FPGA.


I would like to ask, if there is a suggested way of using xrtDeviceLoadXclbinUUID? Or, if there is an alternative solution to my case, where the user connects to already programmed FPGA?

Kind Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant