Wednesday, August 31, 2011

OpenCL and pyopencl error

I installed pyopencl on my new laptop, running Windows 7 x64.
I ran a demo from
and I got a mysterious error:
pyopencl.LogicError: Context failed: invalid gl sharegroup reference khr

I installed the latest drivers, and worried a bit, but then I realized the problem was the Optimus device in my laptop. I went into the 3D settings in the NVIDIA control panel and changed the Global setting to use my high performing NVIDIA card instead of the Optimus built-in one.
That solved it for me. Now I can run the OpenCL/OpenGL interop demos.

Saturday, January 23, 2010

Building linuxdcpp 1.0.3 on OpenSolaris 2009.06

I was pleasantly surprised to discover that linuxdcpp required very little tinkering to compile cleanly(-ish) on OpenSolaris. I say -ish because there were warning about redefined symbols, but they appeared to be of no consequence.

The following patch makes linuxdcpp 1.0.3 compile cleanly on OpenSolaris 2009.06, and at least start correctly (although I'm not sure about how well it actually works). You will probably need to install some packages for include headers. I believe that the following are required:
pkg install SUNWxwinc SUNWxorg-headers SUNWgnome-common-devel


Since I'm unable to correctly format a diff file here, I'll post a link to pastebin.com instead.
http://pastebin.com/f2887b38

Saturday, November 7, 2009

Reparera klockan

Så, jag har en klocka som jag fick av min pappa som studentgåva. Jag har inte använt den överdrivet mycket dom senaste åren, så när den slutade gå så brydde jag mig inte om att fixa den. Den behövde säkert bara nytt batteri eller nåt sånt.

Imorse var jag och tvättade. När jag skulle hämta tvätten märkte jag att klockan låg i tvättmaskinen. Aj. Sen tittade jag närmare och märkte att den börjat gå igen.

What. The. Fuck?

Saturday, September 19, 2009

Nüremberger, Rooibos: Jordgubb & Fläder

Nüremberger
Jag tyckte inte den smakade så mycket. Ganska menlös. Den kanske är subtil, och jag inte fattar det.

Rooibos: Jordgubb & Fläder
Jag var inte överdrivet förtjust i Rooibos. Den luktar gudomligt, men jag får för mig att den inte smakar lika fylligt som svart te. Inget koffein, så den går bort av den anledningen.

Pernod, Rabarber & grädde

Pernod
Smakar salmiak (typ?). Passar i enstaka koppar om man känner för det, men inte i för en hel kanna.

Rabarber & grädde
Väldigt len. Jag antar det är grädden. Rabarbern lyser igenom. Väldigt god.

Saturday, July 25, 2009

When Opera hangs on some pages

To the urlfilter.ini file (for me under .opera in my home directory) exclude the url 'http://pagead2.googlesyndication.com/*".

These instructions come from
http://groups.google.com/group/opera.os.solaris/browse_thread/thread/31e222e9f82bc04e.

Saturday, June 20, 2009

Changing the RPATH of a binary

Suppose that you have two different versions of a library installed on /usr/lib and /usr/local/lib. Further suppose that for most software you run you will want to use the standard one in /usr/lib, but for a specific program you're compiling you need to make it use /usr/local/lib. The problem is that GCC builds in a search path used at runtime where /usr/lib is always before /usr/local/lib. This means that the binary will always find the wrong library in /usr/lib before it finds the library in /usr/local/lib. You can use ldd and "ldd -s" to check which libraries the binary uses.

Because I don't have a good solution I do this: Use elfedit to edit the binary to change the search path.

Step 1.
Get the current search path. (-r means read-only so you will only display the current one)
# elfedit -r -e 'dyn:runpath' file
index tag value
[31] RUNPATH 0x494b /usr/ccs/lib:/lib:/usr/lib:/usr/sfw/lib:/usr/local/lib
[32] RPATH 0x494b /usr/ccs/lib:/lib:/usr/lib:/usr/sfw/lib:/usr/local/lib

See how /usr/lib is before /usr/local/lib? That is my problem here.

Step 2.
Change the path so that /usr/local/lib is before /usr/lib.
# elfedit -e 'dyn:runpath /usr/ccs/lib:/lib:/usr/local/lib:/usr/lib:/usr/sfw/lib' file

Step 3.
Verify that it has changed.
# elfedit -r -e 'dyn:runpath' file
index tag value
[31] RUNPATH 0x4982 /usr/ccs/lib:/lib:/usr/local/lib:/usr/lib:/usr/sfw/lib
[32] RPATH 0x4982 /usr/ccs/lib:/lib:/usr/local/lib:/usr/lib:/usr/sfw/lib

This is the problem I