Forum Discussion

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

compile and run issues of Hello world

Hello,

I downloaded Quartus Prime Standard Edition 16.0 for Linux, and the Hello world from https://www.altera.com/support/support-resources/design-examples/design-software/opencl/hello-world.html. I ran into two issues: (1) in comping for the host, there is an error saying "bin/hello_world is a directory"; (2) After I changed the target in Makefile to some other name like "hello" instead, it compiles. Then it runs and shows "CL_DEVICE_NOT_FOUND".

Here are the commands:

$ aoc -march=emulator device/hello_world.cl -o bin/hello_world.aocx --board s5_ref

$ make

make: Nothing to be done for 'all'.

$ ./bin/hello_world

bash: ./bin/hello_world: is a directory

$ ls bin/hello_world

hello_world.1.bc hello_world.bc hello_world.cl.orig hello_world.log libkernel.so sys_description.legend.txt sys_description.txt

$ vi Makefile # here i change target := hello_world to target := hello

$ make

../common/src/AOCLUtils/opencl.cpp: In function ‘void* aocl_utils::alignedMalloc(size_t)’:

../common/src/AOCLUtils/opencl.cpp:55:49: warning: ignoring return value of ‘int posix_memalign(void**, size_t, size_t)’, declared with attribute warn_unused_result [-Wunused-result]

posix_memalign (&result, AOCL_ALIGNMENT, size);

^

../common/src/AOCLUtils/opencl.cpp: In function ‘bool aocl_utils::setCwdToExeDir()’:

../common/src/AOCLUtils/opencl.cpp:278:14: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result [-Wunused-result]

chdir(path);

^

$ ./bin/hello

Querying platform for info:

==========================

CL_PLATFORM_NAME = Altera SDK for OpenCL

CL_PLATFORM_VENDOR = Altera Corporation

CL_PLATFORM_VERSION = OpenCL 1.0 Altera SDK for OpenCL, Version 16.0

error: cl_device_not_found

Location: ../common/src/AOCLUtils/opencl.cpp:354

Query for number of devices failed

Here is my system (running inside VirtualBox): ubuntu 16.04 LTS 64-bit, Intel® Core™ i5-5300U CPU @ 2.30GHz, Graphics: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits).

Thanks!

Hongbo

2 Replies