ERROR: clGetPlatformIDs -1001 when running OpenCL code (Linux) - linux

After finally managing to get my code to compile with OpenCL, I cannot seem to get the output binary to run! This is on my linux laptop running Kubuntu 13.10 x64
The error I get is (Printed from cl::Error):
ERROR: clGetPlatformIDs
-1001
I found this post but there does not seem to be a clear solution.
I added myself to the video group but this does not seem to work.
With regards to the ICD profile... I am not sure what I need to do - shouldn't this be included with the cuda toolkit? If not, where could I download one?
EDIT: It seems I have an ICD file in my system under /usr/share/nvidia-331/nvidia.icd. It contains the following text:
libnvidia-opencl.so.1
The only file in my system that resembles this is:
/usr/lib/nvidia-331/libnvidia-opencl.so.331.20
Is my ICD profile somehow wrong? Does anyone know a way to fix it?

(Mods: I am not sure if this post should be moved to AskUbuntu seeing as it was an issue related to Linux bumblebee rather than OpenCL itself?)
Ok so I managed to solve the issue after loads of effort.
There are two things that I needed to do:
Getting ICD to work
create a symbolic link from /usr/share/nvidia-331/nvidia.icd to /etc/OpenCL/vendors
sudo ln -s /usr/share/nvidia-331/nvidia.icd /etc/OpenCL/vendors
NOTE: In most cases you would need to replace nvidia-331 with whatever driver you are using - most commonly nvidia-current
I am really curious as to why this isn't done automatically when installing the cuda toolkit - but I have noticed that OpenCL programs will not work without this step!
Nvidia Optimus with Bumblebee
The reason why this was so complicated to get working was that I have an nvidia optimus laptop with poor driver support on linux. To fix this I have bumblebee installed to allow switching between my nvidia card and intel card.
However, because I am using bumblebee - the nvidia graphics card (and nvidia driver) will be unloaded unless explicitly told so. In order to use OpenCL, we need to turn on the nvidia graphics card.
To do this we need to explicitly tell bumblebee to turn the nvidia card on by using the commands optirun or primusrun:
optirun myopenclprogram
Note however, because all that matters is that the nvidia card is turned on and the drivers are loaded, you do not need to keep using optirun myprogram to get this to work (as this always involves the initial delay of waiting for the graphics card to be initialised).
You can run optirun kate for example and this would turn on the nvidia graphics card. You can then, in a separate terminal just run you opencl program without optirun and it will work just fine since the graphics card has already been turned on (and will remain on as long as you leave e.g. kate running).
You will notice that there is no delay in starting your program this time! This saves you alot of waiting - especially if you are developing the opencl program in question.
Once again, as long as you keep the nvidia graphics card turned on, your opencl program will work.
I will probably contact the bumblebee devs to see if there is an easier way to get this to work and report what they say here. Hopefully there is some way to turn the nvidia card on and off without requiring to keep a program (like kate in my example) running.
I hope this helps anyone trying to use OpenCL on linux laptops with bumblebee in the future (I could not find any clear cut solutions myself)
EDIT2: Turning you graphics card on and off can be done as follows for bumlebee users:
Turn graphics card on and load nvidia module
sudo tee /proc/acpi/bbswitch <<< ON
sudo modprobe nvidia
Turn graphics card off (nvidia module is automatically unloaded)
sudo tee /proc/acpi/bbswitch <<< OFF

To share some add info. I have installed intel opencl version on Ubuntu 13.10 saucy. Problem has been the same: -1001 error. I solved it by link analogicly to previous post:
sudo ln -sf /opt/intel/opencl-1.2-3.2.1.16712/etc/intel64.icd /etc/OpenCL/vendors/nvidia.icd

Related

Virtual Monitor on Arch Linux and NVIDIA Proprietary Driver?

I want to add multiple Virtual Displays to my Linux PC, for VNC Purposes. I have an NVIDIA GeForce GTX 750 Ti and an Ryzen 3 1200 with no On-Board Graphics.
I have already tried:
The Option "ConnectedMonitor" in /etc/X11/xorg.conf (Works, but only allows for one output at the moment, because xrandr only shows 5 outputs. When I try and add the fifth output tho, nvidia-settings throws me some kind of error, that i can only use 4 Monitors, and other programs just straight up crash when they try to change the X Screen Config...)
The EVDI Driver (After the Modprobe the X Screen crashes as expected, but xrandr --listproviders doesn't show the driver and xrandr --setprovideroutputsource doesn't work either...)
Wayland (I am an KDE Plasma user and Wayland support of KDE is Trash with the proprietary NVIDIA Driver)
Adding the Dummy Driver (Doesn't work because of NVIDIA's Proprietary trash Xinerama [I also have multiple Physical Displays])
Is it maybe possible to somehow use the nouveau driver at the same time? Or am i just adding the Dummy Driver wrong? Is it possible to get the EVDI Driver working?
I really hope someone helps me very soon...

Executable gives different FPS values ​in Yocto and Raspbian(everything looks the same in terms of configuration)

In Yocto project, built my project which is running on Raspbian OS. When i run executable, i get half FPS compared to executable running on Raspbian OS.
The libraries i use:
OpenCV
Tensorflow-Lite, Flatbuffer, Libedgetpu
I use Libedgetpu1-std, Tensorflow-lite 2.4.0 on Raspbian and Libedgetpu 2.5.0, Tensorflow-lite 2.5.0 on Yocto.
Thinking that the problem is that the versions or configurations of the libraries are not the same, i followed these steps:
I ran the executable which i built in Raspbian directly in the runtime of the Yocto project.(I have set the required library versions to the same library versions available in raspbian for it to work in runtime.)
But i still got low FPS. Here is how i calculate that i get half the FPS:
I am using TFLite's interpreter invoke function. I set a timer when entering and exiting the function, i calculate FPS over it. I can exemplify like this:
Timer_Begin();
m_tf_interpreter->Invoke();
Timer_End();
Somehow i think the Interpreter Invoke function is running slower on the Yocto side. I checked Kernel versions, CPU speeds, /boot/config.txt contents, USB power consumes of Raspbian and Yocto. However, I couldn't catch anything from anywhere.
Note : Using RPI4 and Coral-TPU(Plugged into USB 2.0).
We spoke with #Paulo Neves. He recommend Perf profiling and i did . In the perf profiling, i noticed that the CPU is running slowly. Although the frequencies are the same.
When i check the "scaling_governor", i saw that it was in "powersave" mode. The problem solved when i switched from "powersave" to "performance" mode from virtual kernel.
In addition, if you want to make the governor change permanent, you need to create a kernel config fragment.

AMD GPU won't work with Blender's "Cycles Render" on Linux

I've been working a lot with Blender and it's "Cycles Render" on Fedora lately. But Blender keeps getting a lot slower while rendering. So I discovered that my Blender is only capable of rendering with my CPU. I tried running Blender from the terminal, so I could see any errors. And if I set "Device" to "GPU Compute" in the rendering settings, I get this output:
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [2]
param: 4, val: 0
My machine's specifications are:
Operaring system: Fedora GNU/Linux 27
Blender version: 2.79
Graphics card: AMD Radeon RX 480 using "amdgpu" driver (default open-source driver)
So it seems like, Blender's Cycle Render won't work with my AMD GPU...
Any ideas?
As far as I've seen on the release docs, the Blender cycles engine is not yet fully optimized for all AMD graphics cards, currently they only support AMD cards with GCN architecture 2.0 and above. The dev team focuses on NVIDIA cards mostly (also blender is most optimized for windows).
However, you might as well try to change the settings, first you must make sure you are using OpenCL and not CUDA in your User Preferences, under the System tab, Compute Device(s). Then if your card is not supported, enable the experimental features on the render properties of your workspace, which warn you that will make everything go unstable, this usually enables most AMD GPUs to be selectable as a render device. here on the render properties, you will also be selecting the compute device you desire to use for each scene.
Also, Using an official AMD driver would make rendering faster (also this is a requirement by Blender to use AMD cards) but its not available for fedora as far as I know. I suggest changing your distro to Ubuntu.
EDIT: You MUST use an official AMD driver for the desired card, I have checked the card you have is on the list of supported cards, just that it IS a requirement to have the AMD driver and not opensource. this is the list of supported cards https://en.wikipedia.org/wiki/List_of_AMD_graphics_processing_units, according to the blender documentation.
But it must be a driver from this list: https://support.amd.com/en-us/download/linux, according to the blender documentation.
Now if that doesn't solve the issue then it must be a hardware issue or blender bug, although you could try to run it on windows to discard it being a hardware issue, if you are willing to do a dual boot or usb boot test.

backtrack 5 wont boot

First off, sorry for my english, it is not very good.
I have a Toshiba satellite c885d running windows 8.1. I have a lexar 4 gigabyte usb flashdrive. It says on the back: LJDS50-4GB. I used Linuxlive usb creator and backtrack 5 r3 gnome 32 bit. I downloaded the ISO from backtrack-linux.org.
When I put my usb into my computer, hold f12, and power it on, it takes me to the boot menu, where it gives me 4 options to boot from. after each one, there is a little bit of text. except after "usb" is blank. and then at the bottom is two more options, one taking you to the menu that you can also access by pressing f2 durring startup.
If I hit enter when usb is selected, it takes me to a black screen that says two words (something like checking usb, but I forgot. I will put in an edit that will contain a picture and the exact text.) then after 2 seconds, it says failed, and then launches windows. PLEASE PLEASE PLEASE help me out. I tried researching a solution to the problem, none of which worked. I have successfully run backtrack from the VM thingy that linuxlive has with all of the usb stuff, and It works fine, but it is really slow, as I have too many windows processes running at the same time. If anyone can diagnose me with a problem, awesome. If you can give me a solution, stupendous.
edit: it says "checking media" and then "failed"
images:
Ok, after some discussion in question comments I suspect that the problem is in your install image. If you can't see GRUB menu then you are unable to enter bootloader on your USB drive. It might be several things causing your problem with common denominator - UEFI:
You have written your install image incorrectly and UEFI is not recognizing it.
You have written your install image correctly, but that image is not capable to run on UEFI - see discussion here.
Anyway 100% way to make Backtrack like most of current Linux distros to work on UEFI is to turn UEFI to legacy mode (BIOS), though you have to unninstall Windows 8 ;-)
I would not give lot of hopes to that because Backtrack 5 is based on Ubuntu 10.04 which is way too old - earliest Ubuntu supporting UEFI is 12.04.
I can recommend a few things that might help:
Erase your usb flash drive and write Backtrack image to it again, but with UnetBootIn. There is an official tutorial for that.
Do not try to install Backtrack 5 if don't know what GRUB is. You can install latest Ubuntu that can run on UEFI with SecureBoot (not sure it's easy) and enjoy all of the tools from Backtrack repositories.
Good Luck and have a lot of fun!
I figured it out, just had to follow the tutorial from this page: https://askubuntu.com/questions/221835/installing-ubuntu-on-a-pre-installed-windows-8-64-bit-system-uefi-supported

Linux RFID reader HID Device not matching driver

I got a RFID reader (GigaTek PCR330A-00) that is meant to be recognized under linux/windows as a (Human Interface Device) keyboard/USB.
I hate to say this but it is working as a charm under Win7 but not "really" under Linux.
Under Debian-like distros (x/k/Ubuntu, Debian,..), or Gentoo, or... I just can't have the device working at all: the device scan well (it has its USB 5V, so it is happy/beeping/blinking) something happened in the dmesg, but no immediate screen display of the RFID Tag code as expected (and seen under win7)
Support is claiming it is ok under RHEL or SLED "enterprises" distros... and I must admit I saw it working under a RHEL4... I tried stealing the driver but did not succeed having my reader working...
My question is thus double:
1./ How can I hack the kernel to add support to my device (simply register PID/VID?) ?
2./ What is different at all in a "enterprise" proprietary distro? how can I re-use it?
Thank you for any hint/help.
Cheers,
If you have the source code of the driver you can compile it against the current Kernel your system uses, since the Kernel only allows drivers for its current version. Then you can try to load it as a Kernel module, notice that by doing this, you do not hack the Kernel you just need your current system's Kernel header to compile the driver against it.
You may want to check this http://www.freesoftwaremagazine.com/articles/drivers_linux in order to grasp the basics.
Hope this helps.

Resources