Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

after-build tests partially fail

Leonard_K_
Beginner
1,250 Views

Two after-build tests fail for the intel TBB source:

make rml (which by default also makes rml_test - which fails):

./test_rml_mixed.exe 
Assertion my_make_server_routine failed on line 86 of file ../../src/rml/client/rml_factory.h
../../build/Makefile.rml:150: recipe for target 'rml_test' failed
make[1]: *** [rml_test] Aborted (core dumped)
make[1]: Leaving directory '/path_to_src_dir/tbb43_VERSIONoss/build/linux_intel64_gcc_cc5.2.0_libc2.22_kernel4.2.0_debug'
Makefile:50: recipe for target 'rml' failed
make: *** [rml] Error 2

VERSION is confirmed to atleast be either 20150611 or 20150728.

Also the make-target `test` fails, at some point:

TBB Warning: RML might limit the number of workers to 7 while 15 is requested.

Call stack info (6):
./test_tbb_fork.exe(_Z16print_call_stackv+0x44)[0x4045ba]
./test_tbb_fork.exe(_Z11ReportErrorPKciS0_S0_+0x1d)[0x4046a3]
./test_tbb_fork.exe(_Z8TestMainv+0x377)[0x404f45]
./test_tbb_fork.exe(main+0x2d)[0x404a1a]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f976d601610]
./test_tbb_fork.exe(_start+0x29)[0x4044a9]
../../src/test/test_tbb_fork.cpp:195, assertion 0: Hang after fork
../../build/Makefile.test:251: recipe for target 'test_tbb_plain' failed
make[1]: *** [test_tbb_plain] Aborted (core dumped)
make[1]: Leaving directory '/path_to_src_dir/tbb43_VERSIONoss/build/linux_intel64_gcc_cc5.2.0_libc2.22_kernel4.1.8_debug'
Makefile:44: recipe for target 'test' failed
make: [test] Error 2 (ignored)

The error in the `rml` target is that the assertion failed that 'factory' could not be opened - at least that's the comment above the critical line:

Assertion my_make_server_routine failed on line 86 of file ../../src/rml/client/rml_factory.h

Same thing for the VERSION.

I could not check why both assertions fail (first: fail to open `factory`; second: thread hangs even after pkill and reaches code that shouldn't be reached). The issue not only exists on GCC5 but I also tested it on GCC4.9.

Any idea why the tests fail? Bug in the source or libraries?

 

Other links: https://bugs.archlinux.org/task/46160

0 Kudos
1 Solution
Alexandr_K_Intel1
1,250 Views
This is *not* the rml I'm just running 'make && make test'. Could you please double-check this? I.e., TBB_VERSION=1 LD_LIBRARY_PATH=. ./test_tbb_fork.exe 2>&1|grep RML returns TBB: RML shared when shared RML is in use, and TBB: RML private when no shared RML found.

View solution in original post

23 Replies
Vladimir_P_Intel2
1,200 Views

Hello larkey,

1. Shared RML is not documented and I do not recomend to use it and especially to include it to the package. Private RML is located inside tbb libraries.
2. fork() stuff is more interesting, do you have any fork limitations on your system? this is a simple fork() test so it should work pretty stable on systems where fork works well.

UPD for fork(): this test does not work with shared RML. 

--Vladimir

Leonard_K_
Beginner
1,200 Views

Vladimir Polin (Intel) wrote:

Hello larkey,

1. Shared RML is not documented and I do not recomend to use it and especially to include it to the package. Private RML is located inside tbb libraries.

Oh, well, I came across it since I found quite some packages that wanted to load libirml.so but couldn't due to it missing (namely unity-editor, the Linux-Build for the unity3d engine).

So I did some research and ended up building it via these sources. Are they supposed to ship the binary library when distributing the engine?


2. fork() stuff is more interesting, do you have any fork limitations on your system? this is a simple fork() test so it should work pretty stable on systems where fork works well.

UPD for fork(): this test does not work with shared RML. 

--Vladimir

Not as far as I know I have any fork() limitations. The specific problem seems to be that the forked process gets killed but still continues to run (for some time - at least as long as it needs to reach the test).

If you need more information I could provide, feel free to ask and thank you for the clarifications on RML.

Vladimir_P_Intel2
1,200 Views

larkey wrote:

So I did some research and ended up building it via these sources. Are they supposed to ship the binary library when distributing the engine?

No, this library is not needed for unity editor.

larkey wrote:

If you need more information I could provide, feel free to ask and thank you for the clarifications on RML.

Like I wrote before fork() unit test does not work with shared RML. So no information is needed.

-- thanks, Vladimir

Leonard_K_
Beginner
1,200 Views

Vladimir Polin (Intel) wrote:

Quote:

larkey wrote:

 

So I did some research and ended up building it via these sources. Are they supposed to ship the binary library when distributing the engine?

 

 

No, this library is not needed for unity editor.

I ran ldd on the Unity editor binary and it did search for it.

Quote:

larkey wrote:

 

If you need more information I could provide, feel free to ask and thank you for the clarifications on RML.

 

 

Like I wrote before fork() unit test does not work with shared RML. So no information is needed.

Well, you before said:

2. fork() stuff is more interesting, do you have any fork limitations on your system? this is a simple fork() test so it should work pretty stable on systems where fork works well.

This is *not* the rml I'm just running 'make && make test'.

Alexandr_K_Intel1
1,251 Views
This is *not* the rml I'm just running 'make && make test'. Could you please double-check this? I.e., TBB_VERSION=1 LD_LIBRARY_PATH=. ./test_tbb_fork.exe 2>&1|grep RML returns TBB: RML shared when shared RML is in use, and TBB: RML private when no shared RML found.

View solution in original post

Leonard_K_
Beginner
1,200 Views

Alexandr Konovalov (Intel) wrote:

This is *not* the rml I'm just running 'make && make test'.

Could you please double-check this? I.e.,

TBB_VERSION=1 LD_LIBRARY_PATH=. ./test_tbb_fork.exe 2>&1|grep RML

returns

TBB: RML shared

when shared RML is in use, and

TBB: RML private

when no shared RML found.

 

Ah, so because I've built RML before, it automatically loaded the shared RML and thus failed. I thought I had to explicitly tell it to use the shared lib.

So this seems to work now and shared RML should not be built using these sources. Still weird though that Unity wants to link against RML:

LD_DEBUG on unity-editor binary:

26751:	find library=libirml.so.1 [0]; searching
26751:	search path=/opt/Unity/Editor/Data/Tools:/opt/Unity/Editor	(RPATH from file ./Unity)
26751:	trying file=/opt/Unity/Editor/Data/Tools/libirml.so.1
26751:	trying file=/opt/Unity/Editor/libirml.so.1
26751:	search cache=/etc/ld.so.cache
26751:	search path=/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/x86_64:/usr/lib	(system search path)
26751:	trying file=/usr/lib/tls/x86_64/libirml.so.1
26751:	trying file=/usr/lib/tls/libirml.so.1
26751:	trying file=/usr/lib/x86_64/libirml.so.1
26751:	trying file=/usr/lib/libirml.so.1

 

Well, this seems to be a Unity-issue then - as long as there are no other sources we should build the shared lib from, am I correct?

RafSchietekat
Black Belt
1,200 Views

Could "make rml" be made to "just work", though? With TBB 4.4 on OS X 10.10.5 and command-line tools from Xcode 7.0 (both nearly up-to-date), I get:

./test_rml_tbb.exe 
Call stack info (6):
0   test_rml_tbb.exe                    0x00000001009612be _Z16print_call_stackv + 94
1   test_rml_tbb.exe                    0x000000010096140c _Z11ReportErrorPKciS0_S0_ + 28
2   test_rml_tbb.exe                    0x0000000100962cdd _Z20VerifyInitializationIN3tbb8internal3rml11tbb_factoryE8MyClientEvi + 205
3   test_rml_tbb.exe                    0x0000000100961913 _Z8TestMainv + 19
4   test_rml_tbb.exe                    0x00000001009615ce main + 46
5   libdyld.dylib                       0x00007fff84c735c9 start + 1
../../src/rml/test/test_server.h:409, assertion status!=Factory::st_not_found: could not find RML library
make[1]: *** [rml_test] Abort trap: 6
make: *** [rml] Error 2

 

Leonard_K_
Beginner
1,200 Views

Raf Schietekat wrote:

Could "make rml" be made to "just work", though? With TBB 4.4 on OS X 10.10.5 and command-line tools from Xcode 7.0 (both nearly up-to-date), I get:

Well, I think it could but it's quite unsure it's stable. And if I understood them correctly we are not supposed to use it but people who need it just ship the lib with the program.

sl1pkn07
Beginner
868 Views

Hi. is late, but test opencl stack provide by oneapi suit also complais about libirml.so library

 

for example. run the clinfo program

 

~~~

openat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v3/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v3", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)
openat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v2/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/glibc-hwcaps/x86-64-v2", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)
openat(AT_FDCWD, "/usr/lib/tls/haswell/x86_64/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/tls/haswell/x86_64", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)
openat(AT_FDCWD, "/usr/lib/tls/haswell/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/tls/haswell", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)
openat(AT_FDCWD, "/usr/lib/tls/x86_64/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/tls/x86_64", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)
openat(AT_FDCWD, "/usr/lib/tls/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/tls", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)
openat(AT_FDCWD, "/usr/lib/haswell/x86_64/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/haswell/x86_64", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)PYOPENCL_TEST=int python -m pytest
openat(AT_FDCWD, "/usr/lib/haswell/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/haswell", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)
openat(AT_FDCWD, "/usr/lib/x86_64/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib/x86_64", 0x7ffc93769100, 0) = -1 ENOENT (No existe el fichero o el directorio)
openat(AT_FDCWD, "/usr/lib/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)
newfstatat(AT_FDCWD, "/usr/lib", {st_mode=S_IFDIR|0755, st_size=471040, ...}, 0) = 0
munmap(0x7ff3b024e000, 371912) = 0
openat(AT_FDCWD, "/opt/intel/oneapi/lib/intel64/libirml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No existe el fichero o el directorio)

~~~

 

note: "No existe el fichero o el directorio" = "No such File or Directory"

what is the exactly package ship this library in your APT (debian) repository?

 

https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-onea...

 

greetings

NoorjahanSk_Intel
Moderator
833 Views

Hi,

Thanks for reaching out to us.

>> oneAPI suit also complains about libirml.so library

Could you please elaborate more about the issue and the steps you have followed to reproduce the issue?

And please do let us know the version of oneAPI being used.


Thanks & Regards,

Noorjahan.


sl1pkn07
Beginner
819 Views

Hi

 

thanks for the reply

first for all. my steps is a little "hacky"

 

My system is archlinux. for fetch the sources, in this case, from APT repository (like describe the document posted above) i have installed the `apt` program in the system. then active the repository in the apt sources file and then fetch the packages with `apt upgrade`.

 

For get the list of the packages provided by the repository, `apt-cache search oneapi`. at the time at wrote the post, the latest version of oneapi is 2021.4.

 

After fetch the list of packages, use a `fetch` program provided by the suite `apt-move` for get the URL of the packages (`fetch -t intel-oneapi-runtime-opencl` ), then download with `wge`t and then unzip with `bsdtar`.

Prepare a native arch package with the binaries unziped and install in `/opt` and then use `patchelf` for patch the rpaths for no interfiere with the system packages.

 

Because the libraies provided by the APT packages seems need a dependencies (viewered with `ldd`), star dowload the dependencies with the same method. in my case, points to `intel-oneapi-runtime-tbb`, `intel-oneapi-runtime-tbb-common` and `intel-oneapi-runtime-compilers`. then extract and install used the described method

 

Add the ICD file points to intel cpu opencl like `intel-oneapi-runtime-opencl`package do, run the `clinfo` program provided by `clinfo` package

 

then get this:

see clinfo_log.log attached

 

the error:

~~~

   Number of async copy engines                  2
   IL version                                    (n/a)
   ILs with version                              <printDeviceInfo:186: get CL_DEVICE_ILS_WITH_VERSION : error -30>
 printf() buffer size                            1048576 (1024KiB)
 Built-in kernels                                (n/a)
 Built-in kernels with version                   <printDeviceInfo:190: get CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION : error -30>
 Device Extensions                               cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_devic
e_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_device_uuid cl_khr_pci_bus_info
 Device Extensions with Version                  cl_khr_global_int32_base_atomics                                 0x400000 (1.0.0)
                                                 cl_khr_global_int32_extended_atomics                             0x400000 (1.0.0)
                                                 cl_khr_local_int32_base_atomics                                  0x400000 (1.0.0)
                                                 cl_khr_local_int32_extended_atomics                              0x400000 (1.0.0)
                                                 cl_khr_fp64                                                      0x400000 (1.0.0)
                                                 cl_khr_3d_image_writes                                           0x400000 (1.0.0)
                                                 cl_khr_byte_addressable_store                                    0x400000 (1.0.0)
                                                 cl_khr_icd                                                       0x400000 (1.0.0)
                                                 cl_khr_gl_sharing                                                0x400000 (1.0.0)
                                                 cl_nv_compiler_options                                           0x400000 (1.0.0)
                                                 cl_nv_device_attribute_query                                     0x400000 (1.0.0)
                                                 cl_nv_pragma_unroll                                              0x400000 (1.0.0)
                                                 cl_nv_copy_opts                                                  0x400000 (1.0.0)
                                                 cl_nv_create_buffer                                              0x400000 (1.0.0)
                                                 cl_khr_int64_base_atomics                                        0x400000 (1.0.0)
                                                 cl_khr_int64_extended_atomics                                    0x400000 (1.0.0)
                                                 cl_khr_device_uuid                                               0x400000 (1.0.0)
                                                 cl_khr_pci_bus_info                                              0x400000 (1.0.0)



NULL platform behavior
 clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  No platform
 clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   No platform
 clCreateContext(NULL, ...) [default]            No platform
 clCreateContext(NULL, ...) [other]              Success [INTEL]
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
   Platform Name                                 Intel(R) OpenCL
   Device Name                                   Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  Success (1)
   Platform Name                                 Intel(R) OpenCL
   Device Name                                   Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
 clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
   Platform Name                                 Intel(R) OpenCL
   Device Name                                   Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz

~~~


watching the `clinfo' output with `strace`, i see the output posted above, then i think my problems is because the library `libirml.so`not exist in the system, and searching the wrole apt repository, no one packages provided that file.

what package provide that library?


as note, i thry to use opencl cpu with Xeon E5-2650-v4

 

greetings

NoorjahanSk_Intel
Moderator
744 Views

Hi,

Thanks for providing the information.

>>My system is archlinux.

As per the oneAPI base toolkit system requirements, archlinux is not supported by oneAPI.


Please refer to the below link for more details:

https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-base-toolkit-system-requi...


Thanks & Regards

Noorjahan.


sl1pkn07
Beginner
706 Views

hi

 

that distribution share the same version of all components with other distribution like mine, so is not a trammel, also, oneapi (some components) is opensource, so any distritbution or system can take it and install without problem. this is not a exception

 

so please. dont toss the ball to other roof

 

also you can explain (like you asked me) what is the real impediment for this refuse to work

 

in that document only i can see what is the distribution you test, but not what is the real impediment (custom kernel with custom patch with custom modules builded with custom compiler, for example)

 

i'm not angry, just a little cold with that reply

 

greetings

NoorjahanSk_Intel
Moderator
457 Views

Hi,


Apologies for the delay.


libirml is distributed only with tbb4py packages, for example through conda and pip channels

Please refer to the below link:

https://www.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-to...


We understood that you are having some issues with libirml.so. oneTBB 2021.4 doesn’t need libirml.so and OpenCL from oneAPI 2021.4 package shouldn’t require it as well.

we think that there may be a mix of old/new versions of software installed in the user system. So we suggest you to have a clean environment and reinstall the oneTBB package.


To install a standalone oneTBB package please refer to the below link:

https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html 


If the installation procedure for oneAPI packages is not working smoothly on Arch Linux, you can use open-source packages from the below link. The installation is as simple as unpacking the archive and running vars script


https://github.com/oneapi-src/oneTBB/releases/tag/v2021.4.0


Thanks & Regards,

Noorjahan.


NoorjahanSk_Intel
Moderator
400 Views

Hi,

Has the information provided above helped? If yes, could you please confirm whether we can close this thread from our end?


Thanks & Regards

Noorjahan.



sl1pkn07
Beginner
336 Views

Hi

 

Unfortunately, tbb4py only install if have python 3.5 to 3.8, my system uses 3.9

 

and about mixed versions. i have sure i'm doing the correct when use patchelf for set the rpath for hail the versions

 

~~~

# set hardcoded RPATH
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/libpi_opencl.so
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/icx-lto.so

patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libclang_compiler.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libcl_logger.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libcommon_clang.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libcpu_device.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libimf.so
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libintelocl.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libintlc.so.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libOclCpuBackEnd.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libpdbx.so.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libqkmalloc.so
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libsvml.so
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libtask_executor.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libtbbbind.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libtbbmalloc_proxy.so.*.*
patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libtbbmalloc.so.*.*

~~~

 

install newer TBB in system is not allowed at the moment because some software use older version (2020.3-1) and is not prepare to use newer versions. (https://github.com/PixarAnimationStudios/USD/issues/1471)

 

greetings

NoorjahanSk_Intel
Moderator
264 Views

Hi,


Intel oneTBB is not tested on ArchLinux. As it is not supported officially by intel oneAPI we cannot provide the support from our end, but you can raise this request in the below GitHub page with clear steps to reproduce. 


GitHub link:

https://github.com/oneapi-src/oneTBB/issues



Thanks & Regards,

Noorjahan.


sl1pkn07
Beginner
253 Views

hi

i have already open issue in the intel github repository (get opencl cpu stack open source)

 

https://github.com/intel/llvm/issues/3025

 

but unfortunately not ETA

 

greetings

NoorjahanSk_Intel
Moderator
164 Views

Hi,


We are trying to reproduce the issue from our end on an environment similar to yours.

Could you please provide the below details to reproduce the issue:

OS version

OneAPI version

Also, provide the detailed installation steps that you have followed.


Thanks & Regards,

Noorjahan.



sl1pkn07
Beginner
153 Views

Hi

 

System: Archlinux (full sync)

Oneapi verson: provided from Intel's APT repository. 2021.4.0 (in the moment i test) (see how i install it below)

 

Steps i follow to install:

 

install this packages:

https://aur.archlinux.org/packages/khronos-ocl-icd-git/

or generic opencl stack (one of two)

https://archlinux.org/packages/extra/x86_64/ocl-icd/ 

 

https://archlinux.org/packages/community/x86_64/clinfo/

 

for Intel opencl CPU stack, i use this PKGBUILD (script for make archlinux packages)

this download, uncompress, setup and package the bits downloaded from Intel APT repository

 

 

 

# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>

pkgname=opencl-intel-cpu
pkgver=2021.4.0
_ver_ocl="2021.4.0-3561"
_ver_tbb="2021.4.0-643"
pkgrel=1
pkgdesc="OpenCL Runtime Library for Intel CPU"
url='https://software.intel.com/en-us/intel-opencl'
arch=('x86_64')
license=('custom:Intel')
provides=('opencl-driver')
depends=('hwloc')
makedepends=('patchelf')
# fetch the direct download link
#sudo /usr/lib/apt-move/fetch -t intel-oneapi-runtime-{opencl,tbb,tbb-common,openmp}
source=("https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-opencl-${_ver_ocl}_amd64.deb"
        "https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-tbb-${_ver_tbb}_amd64.deb"
        "https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-tbb-common-${_ver_tbb}_all.deb"
        "https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-runtime-compilers-${_ver_ocl}_amd64.deb"
        )
sha256sums=('1abfebcc3dba9fe042ec21f9936fb6ae9b8ef60c25e34b4a138a15a552beaf2e'
            'fc15bbbc6b6b3aed7785b247e98d66ab33b26a28050b49a9a7ad895dd1538a41'
            '3fe07a57227e9dcb340ea887f1b5118366b74e287200af6f88106151ea690af7'
            '37ee9277b8b7b5486ec2a44cb66575b94dcc2b927f1825f88cdf2c1de54de656'
            )
noextract=("intel-oneapi-runtime-opencl-${_ver_ocl}_amd64.deb"
           "intel-oneapi-runtime-tbb-${_ver_tbb}_amd64.deb"
           "intel-oneapi-runtime-tbb-common-${_ver_tbb}_all.deb"
           "intel-oneapi-runtime-compilers-${_ver_ocl}_amd64.deb"
           )

prepare() {
  (mkdir ocl; cd ocl; bsdtar -xf "${srcdir}/intel-oneapi-runtime-opencl-${_ver_ocl}_amd64.deb" data.tar.xz)
  (mkdir tbb; cd tbb; bsdtar -xf "${srcdir}/intel-oneapi-runtime-tbb-${_ver_tbb}_amd64.deb" data.tar.xz)
  (mkdir tbbc; cd tbbc; bsdtar -xf "${srcdir}/intel-oneapi-runtime-tbb-common-${_ver_tbb}_all.deb" data.tar.xz)
  (mkdir comp; cd comp; bsdtar -xf "${srcdir}/intel-oneapi-runtime-compilers-${_ver_ocl}_amd64.deb" data.tar.xz)
}

package() {
  cd "${pkgdir}"
  bsdtar --no-same-owner -xf "${srcdir}/ocl/data.tar.xz"
  bsdtar --no-same-owner -xf "${srcdir}/tbb/data.tar.xz"
  bsdtar --no-same-owner -xf "${srcdir}/tbbc/data.tar.xz"
  bsdtar --no-same-owner -xf "${srcdir}/comp/data.tar.xz"

  # Fix(?) permissions
  chmod +x opt/intel/oneapi/lib/*.so.*
  chmod +x opt/intel/oneapi/lib/intel64/*.so*

  # Remove env file (not used in archlinux)
  # libOpenCL provided by other packages
  rm -fr opt/intel/oneapi/lib/env
  rm -fr opt/intel/oneapi/lib/libOpenCL.*

  # set hardcoded RPATH
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/libpi_opencl.so
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/icx-lto.so

  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libclang_compiler.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libcl_logger.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libcommon_clang.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libcpu_device.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libimf.so
  (cd opt/intel/oneapi/lib/intel64; ln -sf libintlc.so.5 libintlc.so)
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libintelocl.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libintlc.so.*
  (cd opt/intel/oneapi/lib/intel64; ln -sf libpdbx.so.5 libpdbx.so)
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libOclCpuBackEnd.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libpdbx.so.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libqkmalloc.so
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libsvml.so
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libtask_executor.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libtbbbind.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libtbbmalloc_proxy.so.*.*
  patchelf --set-rpath /opt/intel/oneapi/lib/intel64 opt/intel/oneapi/lib/intel64/libtbbmalloc.so.*.*

  # Fix missing symlink
  ln -s /usr/lib/libhwloc.so.*.*.* opt/intel/oneapi/lib/intel64/libhwloc.so.5

  # Install ICD
  install -d etc/OpenCL/vendors
  ln -s "/opt/intel/oneapi/lib/etc/intel64.icd" etc/OpenCL/vendors/intel-cpu.icd
  echo "/opt/intel/oneapi/lib/intel64/libintelocl.so" > opt/intel/oneapi/lib/etc/intel64.icd

  install -d usr/share/licenses/opencl-intel-cpu
  ln -s /opt/intel/oneapi/lib/licensing/* usr/share/licenses/opencl-intel-cpu/
}

 

save as PKGBUILD and run the `makepkg` command (provided by pacman (Archlinux package manager)

 

run `clinfo` and see the output

 

greetings

 

Reply