Application Acceleration With FPGAs
Programmable Acceleration Cards (PACs), DCP, FPGA AI Suite, Software Stack, and Reference Designs
477 Discussions

I get an error when building the OpenCL driver for CentOS 7 (5.1.9-1.el7.elrepo.x86_64). This driver build is related to the Arria 10 GX Development Kit.

BWint9
Beginner
1,340 Views

The error is generated during the following build invocation :

%> aocl install

 

There is an unresolved reference to the function do_gettimeofday(...).

 

Per internet search, I replaced the do_gettimeofday function with efi_gettimeofday(...). The above error was resolved, but another one appeared.

 

I am thinking that I need to reference a different system (or kernel) header when building the OpenCL driver for the targeted kernel version (5.1.9-1).

 

I believe the error occurred in a file named, *pci_dma.c.

 

Any help to get me past this issue would be greatly appreciated!

 

Thanks!

0 Kudos
5 Replies
BWint9
Beginner
1,020 Views

After adding a do_gettimeofday(...) function prototype to the aclpci_dma.h header file, the compiles successfully; however, there is an issue during MODPOST.

 

I am not a kernel driver developer. So, I can see this quickly moving out of the range of my ability...

 

Any help to accelerate the debug effort would be greatly appreciated!

0 Kudos
HRZ
Valued Contributor III
1,020 Views

You seem to be using a non-standard kernel (5.1) from a third-party repository (elrepo). The official kernel version on CentOS 7 is 3.10. The reason for the compilation failure is very likely the fact that Intel's PCI-E driver is not compatible with the kernel you are using. Probably the highest supported Linux kernel version is 4.15, and that is on Ubuntu 18.04 (and will likely still not work if installed on CentOS 7). You should either downgrade to the official kernel on CentOS, or if you need a newer kernel, you can use Ubuntu 18.04 instead.

 

Intel's official software requirements for the version of Quartus you are using (18.1) can be found here:

 

http://fpgasoftware.intel.com/requirements/18.1/

0 Kudos
BWint9
Beginner
1,020 Views

Thanks for the response and the link!

 

I will attempt to resolve the using a function, named do_gettimeofday, of which, wraps ktime_get_real_ts64(...).

 

There is an example that I found on the web.

 

Hopefully, that is the only migration step that needs to be done...?

0 Kudos
BWint9
Beginner
1,020 Views

I have attached updates to the device driver. These updates modify the timer resolution from usec to nsec. These changes resolved the issues I was having with the deprecated do_gettimeofday function.

0 Kudos
Hiroto_K_Intel
Employee
1,020 Views

Hello,

Firstly, we didn't evaluate kernel 5.x for the OpenCL kernel drivers and later your issue will be resolved for the future version.

 

On the other hand, I believe your workaround is good because it is based on the descriptions in Linux kernel site.

"truct timeval do_gettimeofday (void) 

ktime_get_real_ts64() is a direct replacement, but consider using monotonic time (ktime_get_ts64()) and/or a ktime_t based interface (ktime_get()/ktime_get_real())."

 

Again, please note it is not fully tested now.

 

0 Kudos
Reply