Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16597 Discussions

Installing OpenCL RTE on Cyclone V board

Altera_Forum
Honored Contributor II
1,401 Views

Hi there,  

 

I am trying to install the OpenCL RTE version 16.1 on a Cyclone V board. 

 

However I realized that there is not a pre-compiled driver to be able to load during the initialization, as suggested on the documentation. 

 

I tried to compile the driver on my PC. For this, I downloaded the kernel files from here: 

 

https://github.com/altera-opensource/linux-socfpga 

 

and I modified the makefile with the following: 

KDIR ?= /cygdrive/c/data/linux-socfpga-master 

 

However, when I try to compile I get the following error: 

 

make: *** /cygdrive/c/data/linux-socfpga-master: No such file or directory. Stop 

make: *** [all] Error 2 

 

Any suggestions on where can I find a pre-compiled version of the driver for RTE 16 or how could I get my current version to compile?
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
613 Views

@ptorru, 

 

I'm attempting the same challenge. Have you gotten this to work? I have sent an email to Terrasic to ask about a BSP, but I was trying this in the meantime. 

 

R/ 

Nick
0 Kudos
Altera_Forum
Honored Contributor II
613 Views

Hi Christnp 

 

I checked out the linux-socfpga source code from git-hub, however when I try to compile on windows in complaints about some paths having spaces or semicolons... which is the case for windows paths :(. 

 

I have set-up the project in a linux machine now in order to try and avoid this problem (and also because I wanted to be on a linux environment anyway), however I got to another blocker because it looks like I have not configured the environment for the SDK to work correctly.  

 

I kick-off the embedded command shell: 

 

pedro@pedro-debian64:/opt/intelFPGA/16.1/embedded$ ./embedded_command_shell.sh ------------------------------------------------ Altera Embedded Command Shell Version 16.1 ------------------------------------------------ 

 

From there I attempt to compile, but it looks like make does not find the correct compiler, although it is on my environment: 

 

When trying to run make, I get the following: 

 

pedro@pedro-debian64:~/sandbox/opencl/arrow_c5sockit_bsp/arrow_c5sockit_bsp/driver$ make all arm-linux-gnueabihf-gcc -g -DLINUX -Wall -Werror -o user user.c make: arm-linux-gnueabihf-gcc: Command not found Makefile:19: recipe for target 'all' failed make: *** Error 127 

 

 

However the compiler is on my path: 

 

pedro@pedro-debian64:~/sandbox/opencl/arrow_c5sockit_bsp/arrow_c5sockit_bsp/driver$ which arm-linux-gnueabihf-gcc /opt/intelFPGA/16.1/embedded/ds-5/sw/gcc/bin/arm-linux-gnueabihf-gcc 

 

I am a bit stuck there because of this... any suggestions?
0 Kudos
Altera_Forum
Honored Contributor II
613 Views

Unfortunately I have not tried this process on Linux, so I'm not 100% sure what the issue might be -- might first guess was that the compiler is not in your path, but you ruled that out.  

 

A quick Google search revealed that it might be an issue of you compiling on a 64-bit OS and trying to target a 32-bit system (?): http://stackoverflow.com/questions/14180185/gcc-arm-linux-gnueabi-command-not-found 

 

It is probablye not your issue, but it might be worth ruling out.  

 

Sorry I couldn't be more help on that issue. I've actually ran into an issue compiling the Altera OpenCL kernel (aoc) and not being able to build the hardware. So I've not ran into the subject issue for awhile now... I'm wondering if I will still have this error when I try again :-)
0 Kudos
Altera_Forum
Honored Contributor II
613 Views

Hi christnp! 

 

You were correct, it was an issue of not having the 32bits libraries...  

 

I solved it by: 

 

sudo apt-get install lib32z1 lib32ncurses5 sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install libX11-6:i386 libext6:i386 libxft2:i386 libstdc++6:i386 

 

 

It may be worth nothing that after that we need to configure/prepare the kernel. We need to make sure the cross-compiling env variables are set for this too: 

 

export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf- cd linux-socfpga make oldconfig && make prepare # Here make will ask a bunch of questions, for which I am leaving everything as default. # Perhaps here lies my issue...  

 

After this I go up one folder and try to compile the driver but I get stuck with the following error: 

 

/c5soc/driver/aclsoc.c: In function ‘free_map_info’: c5soc/driver/aclsoc.c:364:5: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘dma_addr_t’ ACL_DEBUG (KERN_DEBUG "free_map_info on vaddr %p, dma 0x%x\n", info->cpu_addr, info->dma_handle); ^ cc1: some warnings being treated as errors scripts/Makefile.build:290: recipe for target '/c5soc/driver/aclsoc.o' failed make: *** Error 1 Makefile:1482: recipe for target '_module_/c5soc/driver' failed make: *** Error 2 

 

I am also multiplexing/distracted with other things but post here if you have any further suggestions. Many thanks indeed :)!
0 Kudos
Altera_Forum
Honored Contributor II
613 Views

It would appear that is simply a compile error in your host code, under the free_map_info() function. I'm not sure what ACL_DEBUG() does, but as the error suggests.... it is expecting that "info->dma_handle" be an unsigned int, but it is actually a dma_addr_t type. You can try typecasting to an unsigned int, but I'm not sure that will give you the results you want (although it would likely suppress the error).

0 Kudos
Reply