I'v been trying for the past day to get Tensorflow built with OpenCL on the Linux Subsystem.
I followed this guide. But when typing clinfo it says
Number of platforms 0
Then typing /usr/local/computecpp/bin/computecpp_info gives me
OpenCL error -1001: Unable to retrieve number of platforms. Device Info:
Cannot find any devices on the system. Please refer to your OpenCL vendor documentation.
Note that OPENCL_VENDOR_PATH is not defined. Some vendors may require this environment variable to be set.
Am I doing anything wrong? Is it even possible to install OpenCL on Windows Linux Subsystem?
Note:
I'm using an AMD R9 390X from MSI, 64bit Windows Home Edition
With the launch of WSL2, CUDA programs are now supported in WSL (more information here), however there is still no support for OpenCL as of this writing: https://github.com/microsoft/WSL/issues/6951.
According to a Microsoft representative in this forum post, Windows Subsystem for Linux does not support OpenCL or CUDA GPU programs, and support is not currently planned. To experiment with TensorFlow/OpenCL it would probably be easiest to install Linux in a dual-boot configuration.
You could use the Intel OpenCL SDK for the CPU, https://software.intel.com/en-us/articles/opencl-drivers.
Related
I'm about to enter the next phase of a project where I am moving computation to the GPU. Unfortunately, I have had very poor success setting up OpenCL in my environment. I hoped I could garner some specific direction about what implementation of OpenCL to use and how to avoid certain pitfalls upon installation.
My machine:
Linux Mint 17.3
Dell XPS 15 9550 with an Nvidia GTX 960M graphics chip
Some specifics:
I have been unable to find any graphics drivers that work with this hardware other than the Nvidia-352 version found in this PPA:
https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa
Every other one I try bricks the machine. I've reinstalled Mint more times than I can count finding this one driver. Keep in mind that I must use this configuration for my machine to work.
I attempted to install Nvidia's CUDA toolkit from their site (https://developer.nvidia.com/cuda-downloads) and for some reason the installation overwrote my Nvidia-352 driver and bricked the machine again.
At this point Im not certain which implementation is correct anyway. I do not want to try another and have the same thing happen.
Some specific questions:
Does every implementation of OpenCL assert itself over the currently installed drivers?
If it does then how can I direct my machine to use the correct one?
Which implementation would be right for my machine?
Can you think of any resources or links that I might be interested in to keep me moving forward? Specifically some installation instructions?
Thanks,
Chronic
Disclaimer: all this is based on my experience with Ubuntu 15.10, but hopefully Mint isn't too different.
Does every OpenCL installation overwrite the others?
If you're installing two different vendor's OpenCL implementations then no, they shouldn't overwrite each other. For example, I have Nvidia, Intel CPU, POCL and Beignet (Intel GPU) platforms installed and working. The only caveat is that the Intel CPU runtime overwrote libOpenCL.so* files, resulting in a crash in clinfo because it required libOpenCL.so.1 which the Intel CPU runtime decided to delete. Re-installing the package ocl-icd-opencl-dev fixed this and you can also make libOpenCL.so.1 a symlink to the actual .so file left by the Intel CPU runtime.
If you try installing two versions for the same platform, like you tried, then yes the last one you install will overwrite the previous one. In your case, remember that the CUDA toolkit also includes the GPU drivers. I haven't played with the CUDA toolkit in a while, perhaps there is an option to install the toolkit only and not the drivers, but since each toolkit requires a certain minimum driver version, you'd have to pick a toolkit version that works with the driver version you can get installed.
On Ubuntu, there is an nvidia-cuda-toolkit package you can sudo apt-get install. Id doesn't ask to change my drivers, hopefully it will work for you. I don't know what version of the toolkit this one installs.
Which implementation is right
If you only want to do OpenCL development then install the nvidia-352 package that worked for you, as well as installing ocl-icd-opencl-dev. This package installs the ocl-icd-libopencl and opencl-headers packages, giving the header files and libOpenCL.so (the ICD loader). You also need to sudo apt-get install nvidia-opencl-icd-352 as that provides the OpenCL runtime for Nvidia GPUs. If you also want to do CUDA development then you need the toolkit.
As a side note, install one of the CPU runtimes, e.g. POCL, in addition to the Nvidia runtime. I found this useful for detecting a bug in my kernel - the kernel worked most of the time on my Nvidia GPU but failed consistently on POCL. It was a race condition.
Useful links
Sorry, no up-to-date installation instructions. However, the instructions provided by each vendor with their OpenCL runtime (except Nvidia) seem to be good enough for me.
Here's some older instructions:
https://wiki.tiker.net/OpenCLHowTo
https://streamcomputing.eu/blog/2011-06-24/install-opencl-on-debianubuntu-orderly/ - The rest of the StreamComputing blog is also interesting.
I want to determine exactly how AMD schedules its OpenCL kernels on the CPU and I could not find any OpenCL function to determine the physical processor/core id on which it is running.
I could only find the following links related to my problem:
Getting the machine serial number and CPU ID using C/C++ in Linux
How to know on which physical processor and on which physical core my code is running
NUMA Get Current Node/Core
I tried the above but none of the solutions worked. I saw that OpenCL kernels do not support C99 headers like stddef.h which is required for sched.h or even fopen().
Is there any way I can see exactly how the openCL kernels have been assigned to each CPU core/processor?
Note: I am using Ubuntu 14.04, gcc version 4.8.2 and AMD APP SDK 3.0.
Thanks for your help!
Hello Stackoverflow community,
I don't know if it's possible but I would like to have a portable linux Ubuntu OS on my USB stick:
wich I can lauch from any windows PC where I don't have administrator right
without having to "boot on it" but with launching it as an "application" in the windows OS (as MS excel for example and probably with virtualbox, vmware, or others)
without installing anything on the windows host PC
which keep the persistence (I want to work on this portable OS, install things, and find them again at the next start.)
Is that possible?
I'v found many things on the net but each time and for what I understood:
either you need the admistrator right (portable virtualbox)
or it cannot keep the persistence (live linux) so I have no choice to boot on the portable linux OS (wich I don't want)
or it's not portable so I have to install things on the PC I'm trying to work on
Any suggestion, idea, workaround would be strongly appreciated.
Thanks in advance,
Mat
I am aware that qemu does not require administrator rights. The problem is all virtualisation solutions require administrator rights either at installation time or in the case of portability beginning of runtime.
Qemu is not virtualisation, it is emulation so would be slower than virtualisation. It does run Linux, have persistance and is portable.
On the plus side, you can run amd64 on 32 bit machines (even slower), mips, arm and other architectures also.
I found this link with drivers and runtimes.
And also as per this , OpenCL codebuilder is now part of INDE/Media server Studio and these are not free (Though they come with trial version)
So my ultimate question is how to get started with OpenCL with Intel HD Graphics?
There is a starter edition of the Intel INDE suite, which is free (and is not just a trial). This contains their core OpenCL SDK. The Media Server Studio may contain some additional tools to aid OpenCL development on Intel HD Graphics, but is certainly not required in order to develop or run OpenCL programs.
You don't actually need any OpenCL SDK to get started with OpenCL development. You need a driver/runtime in order to run OpenCL programs (these are freely available, as per your first link). To develop OpenCL programs you just need the headers and a library to link against, which are both also freely available (more info in this answer).
Which programming language would you like to use? In Java you can start with a simple Java SE application and integrate the JavaCL package. You do not need any further vendor specific drivers.
Has anyone tried to compile Intel xf86_video_intel for another OS. This code is written for Linux. I am wondering if there is any experience with porting the code to another operating system? The code is located at:
http://intellinuxgraphics.org/documentation.html
Thanks,
FM
The latest Intel Linux graphics drivers are very dependent of features of the linux kernel (kernel mode setting being one of the most talked about recently). Porting the driver may not be a trivial, if possible, task.
Usually Linux graphic code is written for the X server. X is available for many different platforms / OS'es. For more information see (http://www.x.org/wiki/).