MrMEEE / ironhide

Optimus Support for Linux Through VirtualGL - PPA version also available: https://launchpad.net/~mj-casalogic/+archive/ironhide
http://www.martin-juhl.dk
88 stars 0 forks source link

Can run OpenCL program #128

Closed jarl-haggerty closed 12 years ago

jarl-haggerty commented 12 years ago

I don't know if this is actually an ironhide problem but I get the impression that ironhide does things in a very particular way and advice on an openCL forum wouldn't help.

I have an ASUS U36JC laptop with ironhide on it. A few weeks ago I could run a very tiny openCL program. The program gets a platform ID and prints the name. Back then the program would easily print, "NVIDIA CUDA" when I ran it with optirun. But then I upgraded to 11.10 and I had a lot of problems, one of them was that the clPlatformIDs in the openCL program returns -1001 instead of CL_SUCCESS. Eventually I found that /etc/OpenCL/vendors was empty and put in a link to /usr/share/nvidia-current/nvidia.icd. OpenCL started working, but I probably because of other things I didn't I couldn't reliably toggle nvidia so I just reinstalled Ubuntu 11.10.

So, I have a fresh installation of Ubuntu and the first thing I did was install ironhide and configure it, I rebooted it once before I remembered to write the ironhide-(dis/en)ablecard files (does that matter?) and I put the link back in the vendors folder and everything was perfect. Then I rebooted and now clPlatformIDs returns the same error.

jarl-haggerty commented 12 years ago

I'm very embarrassed. I just realized that my laptop as been running on battery power since this morning and all I had to do was add a -f flag to optirun. I seem to have a tendency of finding solutions to problems immediately after I post them on the Internet.

vacaloca commented 12 years ago

Just wanted to say thanks for posting this! =) I had ironhide working on Ubuntu 11.10 with CUDA (sdk examples, optix) but any compiled OpenCL binaries returned:

Error -1001 in clGetPlatformIDs Call !!!

The fix, as jarl-haggerty mentions, is to create a symbolic link as he explained... the exact command is:

sudo ln -s /usr/share/nvidia-current/nvidia.icd /etc/OpenCL/vendors/nvidia.icd

I figured I'd post this because Google failed to find this exact issue when I looked yesterday.