Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

Warnings coming from libalteracl?

After a great deal of work along with help from Altera and the Card vendor, we now have a working kernel flashed onto the card. We were also able to compile the host program and as such we attempted to run it. When we did we got the following error messages.

First:

WARNING: NOT using DMA for transfer of size 1024 because of lack of alignment         src ptr = 0x7fa01dffd850, dst ptr = 0x2010080, reading = 0
000000000000000000000000000000000000000000000000e4ae120000000000

followed by:

WARNING: NOT using DMA for transfer of size 1024 because of lack of alignment
         src ptr = 0x2010080, dst ptr = 0x7fa01dffd850, reading = 1

neither of these message are coming from the host program. Does anyone have any insight into what these messages mean?

-Aaron

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The address alignment problem ("WARNING: NOT using DMA for transfer of size 1024 because of lack of alignment"). When we malloc memory for the host, please align the address first before use in the host program.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    The address alignment problem ("WARNING: NOT using DMA for transfer of size 1024 because of lack of alignment"). When we malloc memory for the host, please align the address first before use in the host program.

    --- Quote End ---

    Exactly. It's explained in the optimization guide (http://www.altera.com/literature/hb/opencl-sdk/aocl_optimization_guide.pdf), page 1-7. It says the data should be 64-byte aligned.

    In my case, without proper alignement, one of my memory transfers and kernel execution takes ~300secs. With alignment, it gets down to ~3sec. So you better align it. :D
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you take a look at any of the example designs (except hello world) you'll see code fragments that you can use to align these buffers on Windows and Linux hosts. I recommend making the alignment a macro just in case you change to a platform that requires an even larger alignment.