1

I've installed libgpuarray as stated in this link.

The test

python -c "import pygpu;pygpu.test()"

only gives a sequence of errors, all ending with

======================================================================
ERROR: pygpu.tests.test_blas.test_ger(4, 5, 'float32', 'f', 1, 1, False, True)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygpu-0.2.1-py2.7-macosx-10.9-x86_64.egg/pygpu/tests/test_blas.py", line 155, in ger
    gr = gblas.ger(1.0, gX, gY, gA, overwrite_a=overwrite)
  File "pygpu/blas.pyx", line 127, in pygpu.blas.ger (pygpu/blas.c:2681)
  File "pygpu/blas.pyx", line 44, in pygpu.blas.pygpu_blas_rger (pygpu/blas.c:1561)
GpuArrayException: ('Device does not support operation', 8)

Is it even possible to do GPU programming with the Intel HD Graphics 5000 provided along with MacBook (early 2014)?

1 Answer 1

2

Typically GPU libraries exist to take advantage of OpenCL and/or CUDA. So there are really 2 questions here:

  1. Does your CPU support CUDA/OpenCL?
  2. Does the particular library you want to use have support for it?

I can't answer #2 as I'm not familiar with that particular library, but with regards to #1: yes, it's possible.

For starters, you won't see CUDA support on Intel integrated graphics/CPUs. In older processors you won't see OpenCL support either.

You didn't mention which type of Macbook you have, but 2014 Airs and Pros had newer generation Haswell CPUs, which do have OpenCL support.

So yes, hardware wise, you can do graphics programming using OpenCL with the CPU/laptop that you have.

If you want to use OpenCL in Python you can use something like PyOpenCL

But whether specific libraries have good support for this platform combination, whether libgpuarray will work with integrated graphics, whether you'll see any substantive performance increase with the iGPU over just using the CPU is a whole other question.

6
  • Yes Simon, I am confident that OpenCL works in my Mac tested positive with this program, comparable with OpenCL 1.2. PyOpenCL was also successfully installed. I just need to get PyGPU working so that I could use Theano with GPU support. Is there anything else I should do?
    – Ébe Isaac
    Apr 8, 2016 at 8:35
  • That's tricky because for the longest time theano has had major support for CUDA. Recently they've started working on an openCL backend but last I heard its extremely buggy and not much functionality has been ported over. So I'm not sure what else you could do to solve this, but even if you could I'm not sure that the current state of theano openCL would be worth the effort. Sorry I couldn't be of more help
    – Simon
    Apr 8, 2016 at 8:58
  • I noticed that the link you provided is actually to a deep learning website. If your interest is in machine learning, and you're not tied to python, you could take a look at the openCL versions of caffe and torch as well
    – Simon
    Apr 8, 2016 at 8:59
  • Thanks for trying, Simon. Anyway, do you think Theano can still do better optimisation even without access to the GPU?
    – Ébe Isaac
    Apr 8, 2016 at 9:01
  • I guess it depends on what you're comparing it to. I used to run theano on cpu before I picked up some nvidia cards and it worked fine without gpu access. I've personally never tried torch or caffe so can't say whether theano runs better compared to those alternatives for deep learning
    – Simon
    Apr 8, 2016 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.