"clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR" on Windows? How to install driver? - pyopencl

I am using a microsoft azure notebook to write a PyOpenCL code, and am using windows 10 with Intel i7-4770K CPU processor.
I managed to install PyOpenCL library, but it throws the error "clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR" when I write the code:
cl.create_some_context()
I am guessing no context is being found, so I followed the PyOpenCL documentation which says I need to install the CPU OpenCL driver from Intel from this link: https://software.intel.com/en-us/articles/opencl-drivers#latest_CPU_runtime
And this is the most confusing page I have ever come across. I am not sure what exactly I am supposed to download and install here. Could someone please help me out?
This is my code:
import pyopencl as cl
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
And it throws this error: LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR
I install PyOpenCL using this code:
import sys
!{sys.executable} -m pip install pyopencl

Using regular OpenCL doesn't need any special Intel driver. Its packaged with production drivers.
Please show the code inside "create_some_context()". You must be doing a clIcdGetPlatformIDsKHR (which requires a device with the cl_khr_icd extension), instead of a regular clGetPlatformIDs. Your device likely doesn't have cl_khr_icd support.
https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/cl_khr_icd.html

A solution that worked for me after I got the same error message:
conda install -c conda-forge pocl
This answer is strongly inspired by the solution provided here:
Python LogicError: clGetPlatformIDs failed: platform not found khr

Related

How to cross-build luajit-5.1 for an ARM Linux device? (Trying to build LÖVE framework)

I'm trying to cross-build LÖVE (https://love2d.org) for an ARM Linux device (Rockchip RK3066) from Ubuntu 16.04.
As the documentation says, I installed all dependencies on Ubuntu and was able to build it (for Ubuntu, as a test). Now I'm going for the cross-build.
Before building, I have to run ./configure. So far I've been able to get the toolchain's gcc compiler to be accepted, but when it looks for the dependencies, I get this error:
checking for luajit5.1... no
checking for luajit51... no
checking for luajit... no
configure: error: Package requirements (luajit) were not met:
No package 'luajit' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables lua_CFLAGS
and lua_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Could this be fixed by cross-building luajit for the device and add it to the toolchain binaries, or could I just try to make the ./configure script look for the luajit I installed in Ubuntu?
If it's the latter, would someone kindly point me on the right direction? I've opened like 20 pages already with a similar error message and none of them had a valid answer.
Thanks a lot in advance.

Yocto Build - loadlocale.c #130

So I've upgraded to a newer version of Linux kernel using Yocto. The new kernel version is for 4.1.15 and runs on an iMX6 chip. I've also included openssh-server, tools-sdk, and tools-debug for development recipes. The problem is that when I connect to build I get the following error:
loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof
(_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))'
failed
Now if I type into the command prompt sh -c "LANG=en_US" I get the same error as above. If I type in sh -c "LANG=/usr/lib/locale/en_US" then I do not get an error. When I type locale everything is listed as POSIX and when I type locale -a I get:
C
POSIX
en_GB
en_US
The last two are stored under /usr/lib/locale. My version of gcc is 5.2 and my glibc is v2.22. I've looked all over the internet for other solutions but they are either for Ubuntu where the package manager comes in handy or it's some really specific fix like editing a file that I don't have in my Yocto build.
Edit:
The machine is for a SMARC-FiMX6 SoM and the instructions are here. I'm not sure what branch of Yocto is being pulled down.
After troubleshooting the problem is from the glibc library. A patch, #114739, is on the openembedded website which details what to do to fix this issue. Just patch the file, rebuild, and the issue is fixed. See here for details, the patch is at the bottom of the page.

Qemu configure throws zlib,pthread and kvm missing errors

I have been trying to get my qemu version running on a new machine. I installed zlib1g-dev, zlib-bin etc. When I do a whereis zlib, I get
zlib: /usr/include/zlib.h /usr/share/man/man3/zlib.3.gz
I tried compiling and installing zlib from source too, but the same issue was present.
The exact error I get is
big/little test failed
Error: zlib check failed
Make sure to have the zlib libs and headers installed.
Additionally, if I comment out the the exit due to this, I get
Error: pthread check failed
and
ERROR: User requested feature kvm
ERROR: configure was not able to find it
kvm modules are enabled and the machine supports hardware virtualization. I had checked it using kvm-ok. lsmod shows kvm and kvm_intel modules.
I am really stumped about these errors. Any help or pointers would be greatly appreciated.
I am still not sure of the actual dependencies that caused the problem, but all the issues were fixed by using
sudo apt-get depmod qemu
After this, I am now able to configure qemu

Sourcery G++ (cross-compiler for ARM) installation failure

I was trying to install Sourcery G++ cross-compiler for ARM on Ubuntu 10.04 LTS from the following link ->http://www.codesourcery.com/sgpp/lite/arm/portal/release644
I did not use the graphical interface since I got java.awt error. While using the console mode of installation, I provided all the details asked by the program.(changed the default location of installation)
Some time into the installation, I got this error:
Unable to create file links
An error occurred while running an internal program.
Please remove the toolchain from "/home//cross_compiler".
EXITCODE=-1
I'm not sure what the reason is. I redid this process as a root user and I still got the same error.I am trying to install this on a 64 bit machine.
I suppose it is important to check your system requirements.
There is the possibility you are running a 64bit build of Ubuntu.
Sourcery G++ requires 32bit host libraries. Ensure those are installed.
In my mind, it may be easier to run a 32bit installation in a VM.
If that is not possible, there are installation logs in the 'uninstall' directory of your installation attempt directory. That may help you troubleshoot the issue.
You must have the 32-bit compatibility libraries installed to install Sourcery CodeBench.
From the FAQ: "What do I need to do to install and run Sourcery CodeBench on an x86 64-bit Linux host system?"
https://sourcery.mentor.com/sgpp/lite/arm/portal/kbentry62
Full FAQ here:
https://sourcery.mentor.com/sgpp/lite/arm/portal/target_arch?#action=faq&target_arch=arm
The ARM Lite edition tools have their own mailing list where you can ask such questions.
Go to sourcerytools.com and use the "arm-gnu" mailing list for ARM Lite edition questions.
Cheers!

Clutter on OSX -- "Unable to find suitable GL visual" error

I am looking to try out clutter (http://www.clutter-project.org) on an OSX machine (10.6). I installed the toolkit first by setting up required dependencies via macports and then installing clutter from source (with needed osx flags).
When I try to compile any sample code, it succeeds. However, I always get a "ClutterGLX-CRITICAL **: Unable to find suitable GL visual." error.
I tried googling for answers but couldn't find anything useful.
Help!
Thanks.
I saw the same problem on my MacBook using the standard build from MacPorts, but the no_x11 variant worked okay for me. I am also using the universal variant because I'm using the library from a 32-bit app, so this is what my MacPorts command line looked like:
sudo port install clutter +universal +no_x11
You can probably omit the '+universal' if you only want the library built for your default architecture.

Resources