Amazon Linux 2 and Xilinx Runtime Issue

0

Installation of the Xilinx Runtime on a clear Amazon Linux 2 instance (which is RedHat based) leads to OpenCL runtime errors.

Xilinx Runtime (XRT) 2018.2_XDF.RC5 Installation instructions:
https://github.com/aws/aws-fpga/blob/master/hdk/docs/SDxPatch_AR71715_and_XRT_installation_instructions.md#installing-xilinx-runtime-xrt-20182_xdfrc5

Prerequisites:
Extra Packages for Enterprise Linux (EPEL)

sudo amazon-linux-extras install -y epel
curl -s https://s3.amazonaws.com/aws-fpga-developer-ami/1.5.0/Patches/XRT_2018_2_XDF_RC5/xrt_201802.2.1.0_7.5.1804-xrt.rpm -o xrt_201802.2.1.0_7.5.1804-xrt.rpm
curl -s https://s3.amazonaws.com/aws-fpga-developer-ami/1.5.0/Patches/XRT_2018_2_XDF_RC5/xrt_201802.2.1.0_7.5.1804-aws.rpm -o xrt_201802.2.1.0_7.5.1804-aws.rpm
sudo yum install -y xrt_201802.2.1.0_7.5.1804-xrt.rpm
sudo yum install -y xrt_201802.2.1.0_7.5.1804-aws.rpm

Example application:

#include <stdio.h>
#include <CL/opencl.h>

int main(){
        cl_uint num_platforms;

        cl_int errcode_ret = clGetPlatformIDs(0, NULL, &num_platforms);
        if (errcode_ret != CL_SUCCESS){
                fprintf(stderr, "Error: clGetPlatformIDs (%d)\n", errcode_ret);
                return EXIT_FAILURE;
        }

        printf("Info: %d opencl platform(s) found!", num_platforms);

        return EXIT_SUCCESS;
}

Makefile:

SRCS = test.cpp
OBJCTS = $(SRCS:.cpp=.o)
EXE=test

CC = g++ -Wall

CFLAGS = -I${XILINX_XRT}/include
LFLAGS = -L${XILINX_XRT}/lib -lxilinxopencl

all: ${OBJCTS}
        ${CC} ${OBJCTS} ${LFLAGS} -o ${EXE}
        ${RM} ${OBJCTS}

%.o: %.cpp
        ${CC} ${CFLAGS} -c ${<} -o ${@}

clean:
        ${RM} ${OBJCTS} ${EXE}

3 sequential runs:
$ ./test
Segmentation fault
$ ./test
Segmentation fault
$ ./test
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted

The problem must be related to boost library dependency!
(Our JVM application stated libboost.so as the problematic frame.)

Note that on a CentOS machine the same XRT installation works smoothly.

InAccel
asked 5 years ago262 views
2 Answers
0

Hello,

The XRT RPM's are built using Centos 7 and would yield indeterminate results when used on Amazon Linux 2.

We currently do not support using the provided RPM's on Amazon Linux 2 but are working towards that goal with Xilinx and should be able to provide you a path to using it in the future.
We will update here once we have a path forward.

Thanks,

Deep

Deep_P
answered 5 years ago
0

Fixed with Xilinx Runtime (XRT) 2019.1

Download and install the InAccel-vended aws-xrt packages for Amazon Linux 2:

sudo yum install -y \
     https://inaccel-amazon.s3.amazonaws.com/eks/xrt_201910.2.2.0_2-xrt.rpm \
     https://inaccel-amazon.s3.amazonaws.com/eks/xrt_201910.2.2.0_2-aws.rpm
InAccel
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions