Forum Discussion

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

Questions about Configuring the De5-Net FPGA Board

when i followed the steps in the "de5net_network_opencl_manual.pdf", i got the following problems:

1.in "test ‘aocl flash’ command" section, after i finished the clock setting and tried to use "aocl program acl0 bin/fft2d.aocx" to test the progrom, i got the following errors:

aocl program: Running reprogram from /home/storm/altera/14.0/hld/board/de5net_network/linux64/libexec

Unable to open the device acl0.

aocl program: Program failed.

2.in the "driver installation " section, when i use "aocl install " or "./make_all " to install the driver, i got the following errors:

aocl install: Running install from /home/storm/altera/14.0/hld/board/de5net_network/linux64/libexec

Using kernel source files from /usr/src/linux-headers-3.16.0-30-generic

make: Entering directory `/usr/src/linux-headers-3.16.0-30-generic'

CC [M] /tmp/opencl_driver_yH5TgN/aclpci_queue.o

CC [M] /tmp/opencl_driver_yH5TgN/aclpci.o

/tmp/opencl_driver_yH5TgN/aclpci.c:61:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘probe’

static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id);

^

/tmp/opencl_driver_yH5TgN/aclpci.c:62:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘init_chrdev’

static int __devinit init_chrdev (struct aclpci_dev *aclpci);

^

/tmp/opencl_driver_yH5TgN/aclpci.c:63:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘remove’

static void __devexit remove(struct pci_dev *dev);

^

/tmp/opencl_driver_yH5TgN/aclpci.c:65:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘scan_bars’

static int __devinit scan_bars(struct aclpci_dev *aclpci, struct pci_dev *dev);

^

/tmp/opencl_driver_yH5TgN/aclpci.c:66:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘map_bars’

static int __devinit map_bars(struct aclpci_dev *aclpci, struct pci_dev *dev);

^

/tmp/opencl_driver_yH5TgN/aclpci.c:82:12: error: ‘probe’ undeclared here (not in a function)

.probe = probe,

^

/tmp/opencl_driver_yH5TgN/aclpci.c:83:13: error: ‘remove’ undeclared here (not in a function)

.remove = remove,

^

/tmp/opencl_driver_yH5TgN/aclpci.c:115:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘init_chrdev’

static int __devinit init_chrdev (struct aclpci_dev *aclpci) {

^

/tmp/opencl_driver_yH5TgN/aclpci.c:489:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘probe’

static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id) {

^

/tmp/opencl_driver_yH5TgN/aclpci.c:571:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘scan_bars’

static int __devinit scan_bars(struct aclpci_dev *aclpci, struct pci_dev *dev)

^

/tmp/opencl_driver_yH5TgN/aclpci.c:592:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘map_bars’

static int __devinit map_bars(struct aclpci_dev *aclpci, struct pci_dev *dev)

^

/tmp/opencl_driver_yH5TgN/aclpci.c:640:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘remove’

static void __devexit remove(struct pci_dev *dev) {

^

/tmp/opencl_driver_yH5TgN/aclpci.c:628:13: warning: ‘free_bars’ defined but not used [-Wunused-function]

static void free_bars(struct aclpci_dev *aclpci, struct pci_dev *dev) {

^

/tmp/opencl_driver_yH5TgN/aclpci.c:103:21: warning: ‘aclpci_get_free’ defined but not used [-Wunused-function]

static unsigned int aclpci_get_free(void)

^

/tmp/opencl_driver_yH5TgN/aclpci.c:449:24: warning: ‘find_upstream_dev’ defined but not used [-Wunused-function]

static struct pci_dev* find_upstream_dev (struct pci_dev *dev) {

^

make[1]: *** [/tmp/opencl_driver_yH5TgN/aclpci.o] Error 1

make: *** [_module_/tmp/opencl_driver_yH5TgN] Error 2

make: Leaving directory `/usr/src/linux-headers-3.16.0-30-generic'

cp: cannot stat ‘./aclpci_drv.ko’: No such file or directory

cp: cannot create regular file ‘/etc/sysconfig/modules/aclpci.modules’: No such file or directory

chmod: cannot access ‘/etc/sysconfig/modules/aclpci.modules’: No such file or directory

modprobe: FATAL: Module aclpci_drv not found.

The Operating system is Ubuntu and the board is De5-NET FPGA.

I appreciate if anyone can help me.

Thanks,

Jiawen

19 Replies

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

    --- Quote Start ---

    Hi B,

    I have deal with the problem successfully!!

    Thank you so much for you reply and help!

    Best wishes,

    Jiawen

    --- Quote End ---

    Np! I think I just commented out these lines as they seemed to me to be an edge case, though this might come back to bite me later on :S

    Cheers

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

    --- Quote Start ---

    I should probably post a patch file at some point, but it is the __devinit, __devexit and other such macros that are causing issues as they are not defined in the altera lib and therefore I assume they are defined in the older kernel headers. Remove all these and try again.

    Cheers

    B

    --- Quote End ---

    Thank you so much for you reply soon! I solved the problem mentioned above! But I got a new error message as following:

    Using kernel source files from /usr/src/linux-headers-3.16.0-30-generic

    make: Entering directory `/usr/src/linux-headers-3.16.0-30-generic'

    CC [M] /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci_cmd.o

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci_cmd.c: In function ‘aclpci_exec_cmd’:

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci_cmd.c:83:12: error: void value not ignored as it ought to be

    result = pci_restore_state(aclpci->pci_dev);

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci_cmd.c: In function ‘get_aer_uerr_mask_reg’:

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci_cmd.c:438:10: error: ‘struct pci_dev’ has no member named ‘aer_firmware_first’

    if (dev->aer_firmware_first) {

    ^

    make[1]: *** [/home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci_cmd.o] Error 1

    make: *** [_module_/home/storm/altera/15.0/hld/board/de5net_network/linux64/driver] Error 2

    make: Leaving directory `/usr/src/linux-headers-3.16.0-30-generic'

    It that the same problem above?

    I am looking for your reply online and hope I would deal with it.

    Thank you,

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

    I should probably post a patch file at some point, but it is the __devinit, __devexit and other such macros that are causing issues as they are not defined in the altera lib and therefore I assume they are defined in the older kernel headers. Remove all these and try again.

    Cheers

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

    --- Quote Start ---

    I would not roll-back your kernel. That seems like too much effort ;)

    There are a few changes one can make to get this to work in 14.04LTS Trusty Ubuntu. So far I've had no problems but I do need to test more.

    Firstly, the aocl install command wont work. You need to go manual

    navigate to altera/15.0/hld/board/terasic/de5net/linux64/driver

    Modify the file aclpci_cmd.c removing any of the __ macros before the function declarations. Also comment out lines 442 to 434

    if (dev->aer_firmware_first) {

    return -EIO;

    }

    install the headers for your current kernel (apt-get install linux-kernel-headers)

    change the make_all.sh file so the path points to your new kernel headers directory (something like /usr/src/linux-headers-3.16.0-50-generic)

    run make_all.sh - this will result in the file aclpci_drv.ko

    Copy this file to /lib/modules/3.16.0-50-generic/misc (replacing 3.16.0-50-generic with your current kernel)

    Run modprobe aclpci_drv and then check dmesg for any problems.

    Job done! So far this works for me in terms of checking for programs that are flashed to the memory. I need to perform more testing which I will

    --- Quote End ---

    Hi oni,

    Thank you so much for you reply! I have followed every step and then run make_all.sh, but I got the following error messages and didn't result in the file ecliptic_drv.ko:

    Using kernel source files from /usr/src/linux-headers-3.16.0-30-generic

    make: Entering directory `/usr/src/linux-headers-3.16.0-30-generic'

    CC [M] /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.o

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:61:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘probe’

    static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id);

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:62:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘init_chrdev’

    static int __devinit init_chrdev (struct aclpci_dev *aclpci);

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:63:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘remove’

    static void __devexit remove(struct pci_dev *dev);

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:65:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘scan_bars’

    static int __devinit scan_bars(struct aclpci_dev *aclpci, struct pci_dev *dev);

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:66:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘map_bars’

    static int __devinit map_bars(struct aclpci_dev *aclpci, struct pci_dev *dev);

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:82:12: error: ‘probe’ undeclared here (not in a function)

    .probe = probe,

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:83:13: error: ‘remove’ undeclared here (not in a function)

    .remove = remove,

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:115:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘init_chrdev’

    static int __devinit init_chrdev (struct aclpci_dev *aclpci) {

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:489:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘probe’

    static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id) {

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:571:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘scan_bars’

    static int __devinit scan_bars(struct aclpci_dev *aclpci, struct pci_dev *dev)

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:592:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘map_bars’

    static int __devinit map_bars(struct aclpci_dev *aclpci, struct pci_dev *dev)

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:640:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘remove’

    static void __devexit remove(struct pci_dev *dev) {

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:628:13: warning: ‘free_bars’ defined but not used [-Wunused-function]

    static void free_bars(struct aclpci_dev *aclpci, struct pci_dev *dev) {

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:103:21: warning: ‘aclpci_get_free’ defined but not used [-Wunused-function]

    static unsigned int aclpci_get_free(void)

    ^

    /home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.c:449:24: warning: ‘find_upstream_dev’ defined but not used [-Wunused-function]

    static struct pci_dev* find_upstream_dev (struct pci_dev *dev) {

    ^

    make[1]: *** [/home/storm/altera/15.0/hld/board/de5net_network/linux64/driver/aclpci.o] Error 1

    make: *** [_module_/home/storm/altera/15.0/hld/board/de5net_network/linux64/driver] Error 2

    make: Leaving directory `/usr/src/linux-headers-3.16.0-30-generic'

    I hope I could get your reply and deal with this problem.

    Thanks,

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

    I would not roll-back your kernel. That seems like too much effort ;)

    There are a few changes one can make to get this to work in 14.04LTS Trusty Ubuntu. So far I've had no problems but I do need to test more.

    Firstly, the aocl install command wont work. You need to go manual

    navigate to altera/15.0/hld/board/terasic/de5net/linux64/driver

    Modify the file aclpci_cmd.c removing any of the __ macros before the function declarations. Also comment out lines 442 to 434

    if (dev->aer_firmware_first) {

    return -EIO;

    }

    install the headers for your current kernel (apt-get install linux-kernel-headers)

    change the make_all.sh file so the path points to your new kernel headers directory (something like /usr/src/linux-headers-3.16.0-50-generic)

    run make_all.sh - this will result in the file aclpci_drv.ko

    Copy this file to /lib/modules/3.16.0-50-generic/misc (replacing 3.16.0-50-generic with your current kernel)

    Run modprobe aclpci_drv and then check dmesg for any problems.

    Job done! So far this works for me in terms of checking for programs that are flashed to the memory. I need to perform more testing which I will
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi Chris,

    I didn't solve this problem yet. After you downgrade the kernel, did you install it successfully?

    I use the 14.04 of Ubuntu. Should I downgrade it into 12.0 of Ubuntu?

    Thanks

    Jiawen

    --- Quote End ---

    I am not using Ubuntu for the fpga board. But you can check the kernel version to decide which version to roll back to. The kernel should include a set of macros (such as __devint).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Chris,

    I didn't solve this problem yet. After you downgrade the kernel, did you install it successfully?

    I use the 14.04 of Ubuntu. Should I downgrade it into 12.0 of Ubuntu?

    Thanks

    Jiawen

    --- Quote Start ---

    The kernel is too new. Downgrading your kernel will solve the errors shown above.

    --- Quote End ---

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

    The kernel is too new. Downgrading your kernel will solve the errors shown above.

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

    Hi,

    I also meet the same problem. May I know if you have solved that?