Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
3,166 Views

I have some error to use OpenCL.. please help me.

Hellow guys, I have some problem to use opencl. I am using AOCL and quartus 13.1 version. My probelm is when i command " aocl diagnostic" the error are occcur. the message is belowe that. 

 

aocl diagnostic: Running diagnosticrom /root/altera/13.1/hld/bord/plda/xpressgx5lp/linux64/bin 

running diagnotic for : acl0 

FPGA is in user mode. Enablin bridges 

Using platform:Altera SDK for OpenCL 

Failed clGetDeviceIDs. 

Error code: -1 

aocl diagnostic: failed. 

 

so I want to fix the problem and to use the board. what is cause and solution of this problem.
0 Kudos
24 Replies
Altera_Forum
Honored Contributor I
149 Views

What is your board? Every board has a starting guide that details how you should set up the board for first usage. 

 

Apart from that, the version of Quartus/AOC you are using is ancient; at this point in time, depending on the BSP available to you by the board manufacturer, you should be either using 16.1.2 or 17.0.
Altera_Forum
Honored Contributor I
149 Views

My board is xpressgx5lp of PLDA. They are old board, right. Sadly, I don't have starting guide. I did it alone. Because the PLDA now change direction of their buisiness. So I am not supported by the board vendor.. But I have board BSP package. And README FILE in BSP specify the fact that this board are working with AOCL and Quatus 13.1. Do you recommad using the newest vesion of aocl and quartus? 

 

many thanks. 

 

 

--- Quote Start ---  

What is your board? Every board has a starting guide that details how you should set up the board for first usage. 

 

Apart from that, the version of Quartus/AOC you are using is ancient; at this point in time, depending on the BSP available to you by the board manufacturer, you should be either using 16.1.2 or 17.0. 

--- Quote End ---  

Altera_Forum
Honored Contributor I
149 Views

Ah, well, if you are using an old BSP for an unsupported board, then using a new version of Quartus will just give you more trouble. 

 

Currently the diagnose script cannot find/see your board which means the board is not set up correctly. To get the board up and running, you need two things: 

 

1. A pre-compiled FPGA binary that you should use to program the FPGA through JTAG to enable the PCI-E core. This allows the FPGA to be detected via PCI-E and used with OpenCL. 

2. A PCI-E driver that would allow the host to communicate with the FPGA. 

 

You should get both of these with the BSP. 

 

The first one is straightforward, look for some "sof" file in the BSP, probably top.sof, to program the FPGA using quartus_pgm or Quartus GUI. For the second one, make sure the "AOCL_BOARD_PACKAGE_ROOT" environmental variable is pointing to your BSP, and then run aocl install; this should install the driver if everything is done correctly. Then do a full power cycle on the host machine (a reboot is not enough). You can check the starting guides from other boards to get an idea of the usual steps (Terasic's guides are accessible with a free account on their website); the steps are more or less the same for every board.
Altera_Forum
Honored Contributor I
149 Views

Dear HRZ 

Many Thanks for your help. 

 

I have done about the first one. Using JTAC, I tested PCIE "sof" file. It is successfull. 

 

In second one, I think that is not issue to me. because the "aocl install" command is working well.  

So I think the problem is driver is already installed but the CPU or mainboard are doesn't recognized the FPGA. 

 

In centos 6.4 linux, I insult "lspci" command the bellow are shown.  

 

... 

01:00.0 Unassigned class [ff00]: PLDA PCI Express Core Reference Design. 

... 

 

And in isolation this problem, I have one question. Is it need OpenCL SDK License to work the "daignostic"?
Altera_Forum
Honored Contributor I
149 Views

The diagnose script is an OpenCL program, but the kernel is precompiled and I don't think you need a license for host compilation, which means you shouldn't need a license for it to work. 

 

Can you try lspci -v and see if there are any entries under the one you mentioned above like this? 

 

Kernel driver in use: aclpci Kernel modules: aclpci_drv
Altera_Forum
Honored Contributor I
149 Views

Many Thanks. Below is the script when i command "lspci -v". I don't see the Kernel driver and Kernel module you mention. 

 

01:00.0 Unssigned class [ff00]: PLDA PCI Express Core Reference Design (rev 01) 

Subsystem: PLDA PCI Express Core Reference Design 

Flags: bus master, fast devesel, latency 0, IRQ 16 

Memory at f0100000 (64-bit, prefetchable)  

Memory at f0104000 (64-bit, prefetchable)  

Capabilities: [50] MSI: Enable - Count=1/16 Maskable- 64bit+ 

Capabilities: [78] Power Management version 3 

Capabilities: [80] Express Endpoint, MSI 00 

Capabilities: [100] Virtual Channel 

Capabilities: [200] Vendor Specific Information:ID=a000 Rev=0 Len=044 <?> 

Capabilities: [300]# 19 

Kernel driver in use: plda 

 

I am confused about opencl. What is diagnose? I think it is just test progrem about OpenCL maked by vecdor. So It doesn't need to compile the kernel. I think, just test FPGA board using the flash memory data not using kernel. But you mention kernel is precompiled. what is mean? If it need to precompile, what is precompile source? I mean that if compile command is "aoc --board <board name> source.cl, what is source.cl?
Altera_Forum
Honored Contributor I
149 Views

Your log says "Kernel driver in use: plda", so it seems the driver is working. Are you sure there is no other line starting with "Kernel modules"? 

 

The diagnose script is an OpenCL program that is provided in precompiled form in the BSP which writes some data to the FPGA board and then reads it back and compares the data to make sure the board is working correctly. You do not need to compile this script manually.
Altera_Forum
Honored Contributor I
149 Views

Many Thank.. other message is none.. when i command "lspci -v", the "Kernel Modules" exist in the other part. No "kernel Modules" in PLDA part. So I read ReadMe file. they wrriten below. 

 

- Compile OpenCL kernels using the --board <board-name> switch; board-name can be xpressgx5lp_a7 or xpressgx5lp_a4 depending on the board you purchased, i.e. "aoc <options> --board xpressgx5lp_a7 myopenclkernel.cl <command line arguments>". 

- Run "aoc --list-boards" for the list of supported boards 

- Run "aocl install" once prior to running your first OpenCL executable. Requires sudo priviledges. 

- Run "aocl diagnostic" to perform self-diagnostic of the board. 

 

I have done to set the path and the others. But I didn't do compiling opencl kernel. Because I don't have "myopenclkernel.cl" file. Dose kernel compile is need to work the diagnositc?
Altera_Forum
Honored Contributor I
149 Views

Well, that is a badly written readme. The first step should actually be the last step. What they mean is that you should compile your own kernels using the mentioned command to be able to run them on the FPGA; obviously, this has to be done AFTER setting up the board. 

 

A very crucial step is also missing there: programming the FPGA via JTAG using an existing FPGA image (supplied by the manufacturer) to enable the PCI-E core, and then doing a full power cycle. Have you done a full power cycle on the machine since you programmed it via JTAG?
Altera_Forum
Honored Contributor I
149 Views

I have done to program the FPGA vis JTAC using am existing FPGA image supplied by the manufacturer) to enabel the PCI-E core.  

 

But I don't know what is full power cycle. Although I try to find them, I failed. please tell me what is full power cycle in FPGA ?
Altera_Forum
Honored Contributor I
149 Views

Not on the FPGA, the host. You have to completely turn off the host machine, and then turn it back on (reboot is not enough).

Altera_Forum
Honored Contributor I
149 Views

After I programed FPGA via JTAC, PCI-E test sof file, there are two circumstance. 

 

1. if I just restart the computer(host machine), FPGA test are passed. they working well as starting guide 

 

2. If I turn off the computer(host machine, FPGA test aren't passed. they doesn't working. 

 

I don't know that why it is important. If I turn off the host machine,the FPGA power are off, it is supplied the power by the computer. Although I didn't program in FPGA flash, it doesn't work. That is narmal. I don't know why you mention this test.
Altera_Forum
Honored Contributor I
149 Views

You should also program the on-board flash with the sof file you get from the BSP so that when the FPGA is powered off and then powered on, it automatically get programmed by that image. 

 

If everything is working after a reboot, then that is great; no need to do anything else. :)
Altera_Forum
Honored Contributor I
149 Views

Many Thanks. HRZ 

 

I don't have the flash program. It is old board. So I can't flash the new progrem. :'( 

 

Why the Kernel module aren't install? I think that diagnose is to run the precompiled program. So if flash image are dameged, the diagnose command is not working. Is it possible?  

 

And one more question, Is it need to check the diagnose command for OpenCL? If I don't check this diagnose command, Don't I use the FPGA for OpenCL?
Altera_Forum
Honored Contributor I
149 Views

You don't need to run the diagnose script to use OpenCL, but if the diagnose script does not find your FPGA, any OpenCL code you write will not find your FPGA either. There isn't anything else I can think of.

Altera_Forum
Honored Contributor I
149 Views

Mnay Thanks. Well.. I will try one more time and than if I fail, I give up. I want to check the process. 

 

1, The FPGA connect PCI-E in Host PC then turn on. 

2, Set the path for OpenCL 

3, install the FPGA driver 

4, command diagnostic -> failed 

 

This is my process. Is it standard procedure?  

 

Arranging my procedure, I have a one more question. If I command "aoc --list-board", two board are listed, xpressgx5lp_a4 and xpressgx5lp_a7. Does host CPU select the board automatically or select the board manually?
Altera_Forum
Honored Contributor I
149 Views

This is how I do it: 

 

1. Install the FPGA in a PCI-E slot in the host machine and then turn the machine on. 

2. Program the FPGA and the on-board flash with the sof file provided by the manufacturer using JTAG, and set the FPGA to boot from the flash. 

3. Turn off the host machine completely and turn it back on. 

4. Set the environmental variable path for OpenCL in bashrc. 

5. Install the FPGA driver (aocl install). 

6. Run diagnose command (aocl diagnose). 

 

For the two boards listed, you have to choose the correct one manually for compiling OpenCL kernels. Your command will be "aoc --board *board_variant*". For diagnose, this doesn't matter.
Altera_Forum
Honored Contributor I
149 Views

Many Thanks. HRZ 

 

I did all of thing I could do, but I fail. So this is last question I think. My FPGA board have PCIE 3.0 x8 slot and my computer have PCIE 1.0 x16 slot. Is it possible to connect board with computer ? I know PCIE slot are possible to low rank compatiblilty. But in the reference manual at xpressGX5lp, my FPGA board, that comment as follows. 

 

"The PCI Express male connector enables access to Endpoint PCI Express components as a x1, x4, or x8 PCI Express 2.0/3.0 Link." 

 

Does the computer recognize the FPGA? If you need the reference manual, I will send you.
Altera_Forum
Honored Contributor I
149 Views

The FPGA board is certainly physically compatible with your motherboard, but Altera's PCI-E core works at PCI-E 2.0 8x, while your motherboard only supports PCI-E 1.0. In the normal case, the PCI-E core should automatically switch to PCI-E 1.0, but I am not really sure if that would happen in this case.

Altera_Forum
Honored Contributor I
41 Views

Many Thanks, I found many data of OpenCL PCI-E compatability, but there aren't compatability about PCI-E. But the FPGA are compatible with PCI-E Gen 1/2/3.  

 

In the process of finding the data, I have some error about diagnostic. The FPGA test imege, i did, isn't for OpneCL imege. It means that it is just test imege to verify connecting FPGA with motherboard. So, I think, if I success to load the flash memorry, the "diagnostic command" doesn't working. That is my think. :) 

 

And I have one more thing I don't understand. Why the message, "failed clGetDeviceIDs.", are shown? The diagnostic use the FPGA OpenCL image in flash memorry. But the image is nothing in flash. (because I don't touched the board since I bought) I guess the process is that the driver in CPU request the FPGA ID, but the FPGA flash image is none, So driver fialed to get the FPGA ID. But It is just my think. Is it right?  

 

And one more thing. I don't have flash driver to program flash memory. So I don't program OpenCL imege in Flash memory, But in the altera OpenCL starting guide, many OpenCL imege using the flash memory. That means if I don't have the flash driver, I don't use the OpenCL. Is it right?
Reply