OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

Ubuntu: application detects 1 device while clinfo detects 2

Olivier_P_
Beginner
1,533 Views

Hi I've installed both CPU and GPU Intel OpenCL drivers on a x86_64 machine running Ubuntu 16.10 and I've encountered an unexplainable (yet) behaviour on my OpenCL project. My application only detects the Intel HD Graphics device but not the Core i7 device. The strangest thing is when I run the clinfo program, it lists both devices. Even stranger, I've downloaded the original source code of the clinfo program to check any difference in code and after building it with the same compile options (-g -O0 -DDEBUG=1) and debugging it under gdb, it does detect two devices with code that seems identical to my program. The only difference I see is that the clinfo program is written in C and compiles with gcc while my program is in C++, uses the C++ wrapper and uses g++.

Here is how clinfo detects the number of devices:

	error = clGetPlatformIDs(0, NULL, &num_platforms);
	if (error != CL_PLATFORM_NOT_FOUND_KHR)
		CHECK_ERROR("number of platforms");

	ALLOC(platform, num_platforms, "platform IDs", cl_platform_id);
	error = clGetPlatformIDs(num_platforms, platform, NULL);
	CHECK_ERROR("platform IDs");

	for (p = 0; p < num_platforms; ++p) {
		error = clGetDeviceIDs(pid, CL_DEVICE_TYPE_ALL, 0, NULL, &(pdata

.ndevs)); if (error == CL_DEVICE_NOT_FOUND) pdata

.ndevs = 0; else CHECK_ERROR("number of devices"); }

And here's how my program works:

Error CLRuntime::createPlatform(const char* pPlatformRequest, cl::Platform& pPlatform)
{
    std::vector<cl_platform_id> lPlatforms;
    std::string                 lInfo;
    cl_uint                     lCount;
    
    clGetPlatformIDs(0, NULL, &lCount);
    if (lCount == 0)
    {
        HS_LOG(error) << "OpenCL has zero platforms";
        return ERR_FATAL;
    }
    
    lPlatforms.resize(lCount);
    
    clGetPlatformIDs(lCount, &lPlatforms.front(), NULL);

	// Default is to use first platform found
	pPlatform = lPlatforms[0];

	for (auto i = 0; i < lPlatforms.size(); i++)
	{
                cl::Platform    lPlatform(lPlatforms);
        
		HS_LOG(debug) << "Platform #" << i << " :";
		lInfo = lPlatform.getInfo<CL_PLATFORM_VERSION>();
		HS_LOG(debug) << '\t' << lInfo;
		lInfo = lPlatform.getInfo<CL_PLATFORM_NAME>();
		HS_LOG(debug) << "\tname: " << lInfo;

		if (pPlatformRequest!=nullptr && *pPlatformRequest!='\0' && lInfo.find(pPlatformRequest) != std::string::npos)
		{
			pPlatform = lPlatforms;
		}

		lInfo = lPlatform.getInfo<CL_PLATFORM_VENDOR>();
		HS_LOG(debug) << "\tvendor: " << lInfo;
        
                clGetDeviceIDs(lPlatforms, CL_DEVICE_TYPE_ALL, 0, NULL, &lCount);
		HS_LOG(debug) << "\tDevice count: " << lCount;
	}

	HS_LOG(info) << ">> Using platform " << pPlatform.getInfo<CL_PLATFORM_NAME>();

    return ERR_NONE;
}

What other factor could possibly influence this difference in behaviour??

0 Kudos
6 Replies
Paul_K_Intel1
Employee
1,533 Views

Hi Olivier,

It is possible that your system has more than one OpenCL ICD installed.  It is possible to install Ubuntu along with the beignet OpenCL driver, which is in the package, beignet-opencl-icd.  Is there anything other than "intel.icd" in "/etc/OpenCL/vendors?"  You should also verify that the SRB3 libOpenCL.so will be found by the dynamic linker:

$ sudo ldconfig -p | grep libOpenCL
    libOpenCL.so.1 (libc6,x86-64) => /opt/intel/opencl/libOpenCL.so.1
    libOpenCL.so (libc6,x86-64) => /opt/intel/opencl/libOpenCL.so

For both applications, verify how they are linking against libOpenCL.so.  For example, my version of clinfo does this dynamically:

$ ldd clinfo
    libOpenCL.so.1 => /opt/intel/opencl/libOpenCL.so.1

If the above output lists a different libOpenCL.so library, update the dynamic linker change with "sudo ldconfig".

If this doesn't help, you can use the "strace" utility to log all attempts at loading shared libraries.  We've seen complications in the platform enumeration interface with the ICD provided by ocl-icd-libopencl1 identical to what you're observing.  Since the version of clinfo you are using lists both the GPU and CPU devices, your application may be loading/linking or specifying an rpath to a non-SRB3 libOpenCL.so.  Once you see both the CPU and GPU with the device string "Intel(R) HD Graphics," you should be okay.

Cheers,
Paul

0 Kudos
Olivier_P_
Beginner
1,533 Views

Hi Paul,

Thanks for your quick answer. Here is the story so far:

Paul K. (Intel) wrote:

It is possible that your system has more than one OpenCL ICD installed.  It is possible to install Ubuntu along with the beignet OpenCL driver, which is in the package, beignet-opencl-icd.

I've uninstalled the beignet-opencl-icd prior to installing the Intel driver as asked in the GUI installation process. If I remember correctly I've uninstalled it with the --purge option too. I did a apt list --installed | grep beignet which returned nothing so I assume that it HAS been completely removed.

Paul K. (Intel) wrote:

Is there anything other than "intel.icd" in "/etc/OpenCL/vendors?"

There is also a nvidia.icd as I am running this on a dual GPU laptop, Intel HD Graphics alongside with an NVIDIA GPU. I should have stated this, sorry for that. I've did a test by temporarily removing the nvidia.icd from the /etc/OpenCL/vendors folder and rerunning my program but it still only lists the Intel GPU device. By the way, OpenCL doesn't list the NVIDIA platform so I assume in some way the nvidia.icd is not properly installed or... the fact it is not showing up is part of the same issue.

Paul K. (Intel) wrote:

You should also verify that the SRB3 libOpenCL.so will be found by the dynamic linker:

$ sudo ldconfig -p | grep libOpenCL
    libOpenCL.so.1 (libc6,x86-64) => /opt/intel/opencl/libOpenCL.so.1
    libOpenCL.so (libc6,x86-64) => /opt/intel/opencl/libOpenCL.so

Running that command on my system lists two libOpenCL.so: one in /opt/intel/opencl/ and the other in /usr/lib/x86_64-linux-gnu/. I've temporarily removed the latter, called sudo ldconfig, and rerun my program to no effect. Still only the GPU device detected. I tried to find what package had installed this second lib by doing a apt-file list opencl | grep /usr/lib/x86_64-linux-gnu/ and have listed:

  • nvidia-libopencl1-367
  • nvidia-opencl-dev
  • ocl-icd-libopencl1
  • ocl-icd-opencl-dev

I have proceeded to uninstalling all these with --purge option and a pinch of sudo apt-get autoremove (even though I only had the last two installed, I think) but the problem persists

Paul K. (Intel) wrote:

For both applications, verify how they are linking against libOpenCL.so.  For example, my version of clinfo does this dynamically:

$ ldd clinfo
    libOpenCL.so.1 => /opt/intel/opencl/libOpenCL.so.1

If the above output lists a different libOpenCL.so library, update the dynamic linker change with "sudo ldconfig".

So ldd with a grep CL on both clinfo and my application listed only /opt/intel/opencl/libOpenCL.so.1

Paul K. (Intel) wrote:

If this doesn't help, you can use the "strace" utility to log all attempts at loading shared libraries.  We've seen complications in the platform enumeration interface with the ICD provided by ocl-icd-libopencl1 identical to what you're observing.  

After a strace with a grep CL, I did notice that my application was trying to find a libOpenCL on a Matlab path (yes, the application is linking to a Matlab lib) but that open failed and only the open on /opt/intel/opencl/libOpenCL.so.1 was a success. So everything seems normal on that side.

Paul K. (Intel) wrote:

Since the version of clinfo you are using lists both the GPU and CPU devices, your application may be loading/linking or specifying an rpath to a non-SRB3 libOpenCL.so.  Once you see both the CPU and GPU with the device string "Intel(R) HD Graphics," you should be okay.

What is a SRB3 libOpenCL.so? How can I check if mine is (even though clinfo seems to find one that works)?

I hope I haven't missed out on something during all those checks but it seems that the problem still persists. I must admit that I am not sure that my system is totally 100% "clean" as I am having a very hard time installing the proper drivers what with all the possible sources (apt or script) on Ubuntu so I may have messed up the system in some way. But then again, clinfo seems to be able to sort that out...

And thanks for your time and help, Paul.

0 Kudos
Olivier_P_
Beginner
1,533 Views

I have some more info that maybe can shed some light. Here is a dump of strace on my application (with the trace=open option) and there is an open on the nvidia.icd but also some errors, even though they seem related to centos. I can upload a more detailed version of the strace dump if you wish.

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libmat.so", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libmx.so", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/opt/intel/opencl/libOpenCL.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libnetcdf.so.11", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/tls/x86_64/libmwfl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/tls/libmwfl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/x86_64/libmwfl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/libmwfl.so", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libmwi18n.so", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libut.so", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_filesystem.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_system.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libmwcpp11compat.so", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libhdf5_hl.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libhdf5.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libmwresource_core.so", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libmwMATLAB_res.so", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_date_time.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_signals.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_thread.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_log.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_log_setup.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libicudata.so.49", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libicuuc.so.49", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libicui18n.so.49", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libicuio.so.49", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libtbb.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libtbbmalloc.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/../../sys/os/glnxa64/tls/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/../../sys/os/glnxa64/tls/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/../../sys/os/glnxa64/x86_64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/../../sys/os/glnxa64/libz.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libsz.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/../../sys/os/glnxa64/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/../../sys/os/glnxa64/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_chrono.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_regex.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libboost_serialization.so.1.49.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libunwind.so.8", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/libexpat.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/glnxa64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/../../sys/os/glnxa64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/home/olivier/MATLAB/bin/glnxa64/../../sys/os/glnxa64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libaec.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libidn.so.11", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/librtmp.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libnettle.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libgnutls.so.30", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/liblber-2.4.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libhogweed.so.4", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libgmp.so.10", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libp11-kit.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libtasn1.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libkrb5.so.3", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libk5crypto.so.3", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libcom_err.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libkrb5support.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libsasl2.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libgssapi.so.3", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libffi.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libkeyutils.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libheimntlm.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libkrb5.so.26", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libasn1.so.8", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libhcrypto.so.4", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libroken.so.18", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libwind.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libheimbase.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libhx509.so.5", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/libsqlite3.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/home/olivier/MATLAB/bin/lcdata.xml", O_RDONLY) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("/proc/cpuinfo", O_RDONLY)         = 3
open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3
open("/etc/OpenCL/vendors/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
open("/etc/OpenCL/vendors/intel.icd", O_RDONLY) = 4
open("/opt/intel/opencl/libIntelOpenCL.so", O_RDONLY|O_CLOEXEC) = 5
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 5
open("/opt/intel/opencl/libintelocl.so", O_RDONLY|O_CLOEXEC) = 5
open("/opt/intel/opencl/tls/x86_64/libtask_executor.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/intel/opencl/tls/libtask_executor.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/intel/opencl/x86_64/libtask_executor.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/intel/opencl/libtask_executor.so", O_RDONLY|O_CLOEXEC) = 5
open("/opt/intel/opencl/libcl_logger.so", O_RDONLY|O_CLOEXEC) = 5
open("/opt/intel/opencl/libnuma.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("tls/x86_64/libnuma.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("tls/libnuma.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("x86_64/libnuma.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("libnuma.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libnuma.so.1", O_RDONLY|O_CLOEXEC) = 5
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 5
open("/opt/intel/opencl/libigdrcl.so", O_RDONLY|O_CLOEXEC) = 5
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 5
open("/lib/x86_64-linux-gnu/tls/x86_64/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/x86_64/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/x86_64/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/x86_64/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/libigfxdbgxchg64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/dev/dri/card0", O_RDWR)          = 9
open("/dev/dri/renderD128", O_RDWR)     = 9
open("/sys/bus/pci/devices/0000:00:02.0/resource", O_RDONLY) = 10
open("/sys/bus/pci/devices/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 10
open("/sys/bus/pci/devices/0000:00:1f.3/config", O_RDONLY) = 10
open("/sys/bus/pci/devices/0000:00:00.0/config", O_RDONLY) = 10
open("/sys/bus/pci/devices/0000:00:14.2/config", O_RDONLY) = 10
open("/sys/bus/pci/devices/0000:00:1c.4/config", O_RDONLY) = 10
open("/sys/bus/pci/devices/0000:00:02.0/config", O_RDONLY) = 10
open("/sys/bus/pci/devices/0000:00:02.0//drm/card0/gt_max_freq_mhz", O_RDONLY) = 10
open("/sys/devices/system/cpu", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 10
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 10
open("/opt/intel/opencl/libmd.so", O_RDONLY|O_CLOEXEC) = 10
open("/usr/lib/x86_64-linux-gnu/libpciaccess.so.0", O_RDONLY|O_CLOEXEC) = 10
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 10
open("/opt/intel/opencl/libigdfcl.so", O_RDONLY|O_CLOEXEC) = 10
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 10
open("/opt/intel/opencl/libigdmcl.so", O_RDONLY|O_CLOEXEC) = 10
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 10
open("/opt/intel/opencl/libigdccl.so", O_RDONLY|O_CLOEXEC) = 10
open("/qb/workspace/16522/p4gen/gfx_Development/dump/ocl-release-centos-6.6-x86_64/igdccl/tls/x86_64/libiga64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/qb/workspace/16522/p4gen/gfx_Development/dump/ocl-release-centos-6.6-x86_64/igdccl/tls/libiga64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/qb/workspace/16522/p4gen/gfx_Development/dump/ocl-release-centos-6.6-x86_64/igdccl/x86_64/libiga64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/qb/workspace/16522/p4gen/gfx_Development/dump/ocl-release-centos-6.6-x86_64/igdccl/libiga64.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/intel/opencl/libiga64.so", O_RDONLY|O_CLOEXEC) = 10
open("/etc/OpenCL/vendors/nvidia.icd", O_RDONLY) = 4
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 10
open("/usr/lib/x86_64-linux-gnu/libnvidia-opencl.so.1", O_RDONLY|O_CLOEXEC) = 10
open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 10
open("/dev/nvidiactl", O_RDWR)          = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 10
open("/usr/share/locale/fr_FR/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/fr/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/fr_FR/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/fr/LC_MESSAGES/libc.mo", O_RDONLY) = 10
open("/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 10
open("/proc/meminfo", O_RDONLY)         = 12
open("/proc/self/maps", O_RDONLY)       = 12
open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY) = -1 EACCES (Permission denied)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 11
open("/opt/intel/opencl/libcommon_clang.so", O_RDONLY|O_CLOEXEC) = 11
open("/lib/x86_64-linux-gnu/libtinfo.so.5", O_RDONLY|O_CLOEXEC) = 11
open("/opt/intel/opencl/igdclbif.bin", O_RDONLY) = 11
open("/System/Library/CoreServices/SystemVersion.plist", O_RDONLY) = -1 ENOENT (No such file or directory)
+++ killed by SIGINT +++
0 Kudos
Olivier_P_
Beginner
1,533 Views

Ok, so apparently this "bug" is linked to this one on Windows. On windows the CPU is listed as an available device but on my Ubuntu system, it is not listed, unless I remove from my program the dependencies (code and link) from two Matlab libraries, in which case the CPU is listed and the context is created normally. I still need to investigate why or how to work around this. But very strange indeed.

0 Kudos
Olivier_P_
Beginner
1,533 Views

Here is the conclusion to this bug. Instead of linking to the two Matlab libraries and loading the shared libraries implicitely, I've switched to loading them explicitely after creating the OpenCL context. It solved the issue of the CPU device not being listed. I still have no idea why.

0 Kudos
Vladimir_L_Intel
Employee
1,533 Views

The problem can be connected to Known TBB issue (see known issues section in release notes for standalone CPU RT https://software.intel.com/sites/default/files/managed/65/c8/opencl_runtime-16.1.1-release_notes.pdf).

Math lab contains lower version of TBB libraries. When they loaded first CPU RT is not able to operate.

Your solution is good one.

This is applicable both for Linux and Windows.

0 Kudos
Reply