<p>The following program will show you the OpenCL-capable devices on a given Macintosh:</p>

<pre><code>// clang -framework OpenCL dumpcl.c -o dumpcl &amp;&amp; ./dumpcl

# include &lt;stdio.h&gt;
# include &lt;stdlib.h&gt;
# include &lt;OpenCL/opencl.h&gt;


int main(int argc, char* const argv[]) {
    cl_uint num_devices, i;
    clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, 0, NULL, &amp;num_devices);

    cl_device_id* devices = calloc(sizeof(cl_device_id), num_devices);
    clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, num_devices, devices, NULL);

    char buf[128];
    for (i = 0; i &lt; num_devices; i++) {
        clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 128, buf, NULL);
        fprintf(stdout, "Device %s supports ", buf);

        clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, 128, buf, NULL);
        fprintf(stdout, "%s\n", buf);
    }

    free(devices);
}
</code></pre>

<p>If it fails to show you your GPU then its a driver issue.If it succeeds then its some kind of a configuration error.</p>

CC BY-SA 3.0
2013-12-05T01:16:00.470Z
In order to compile the above the following has to be done [cc dumpcl.c -o dumpcl -framework OpenCL](http://stackoverflow.com/a/20389401/2871638).
Deesbek
CC BY-SA 3.0
2013-12-05T01:16:45.647Z
Ok, it runs, so it is an configuration error.
Deesbek
CC BY-SA 3.0
2013-12-05T00:06:16.907Z
2013-12-05T00:06:16.907Z
Meterbuchus
<p>Upgrade to OS X Mavericks and it should work. It's a driver issue.</p>

<p>At least on my Macbook, after I upgraded to Mavericks I can mine on both the GeForce and the Intel HD 4000. Not that it makes sense to do so. ASICs have taken over, and even before that AMD was the GPU for mining.</p>

CC BY-SA 3.0
2013-12-18T16:01:32.953Z
I have upgraded to OS X Maverics and it has made no difference.
Deesbek
CC BY-SA 3.0
2014-01-07T02:09:14.293Z
Mine litecoins with GPU. @Deesbek
Prof. Falken
CC BY-SA 3.0
2014-01-08T13:48:56.203Z
@Prof.Falken thanks for the tip, I have friends who do that and Dogiecoin as well but I specifically needed to compare performance changes over time with GPU.
Deesbek
CC BY-SA 3.0
2013-12-06T00:12:32.390Z
2013-12-06T00:12:32.390Z
Dr.Haribo
<p>I am running Mac OS X 10.7 on a MBP and OS X 10.8 on a Mac Mini.  The Mini has a Intel HD Graphics 4000 GPU and the MBP has a 3000.</p>

<p>I know that I cannot mine with the MBP as the GPU does not support OpenCL.  The Mac Mini should be able to as the Intel HD 4000 supports OpenCL 1.2.</p>

<p>However when I run:</p>

<pre><code>bfgminer -n
 [2013-12-04 15:35:22] 0 GPU devices max detected
</code></pre>

<p>My GPU is not detected.  I have the latest XCode installed as the well as command line tools and compiled bfgminer with the latest install of brew.</p>

<p>I just want to play around with mining and am not interested in buying an ASIC set up.</p>

<p><strong>How can I get my GPU to be detected by bfgminer or cgminer?</strong></p>

<hr>

<h1>Update:</h1>

<p>When I run 'bfgminer --verbose' I get the following error:</p>

<blockquote>
  <p>[2013-12-04 17:30:57] JSON-RPC call failed: {    "code": -1,<br>
  "message": "Unsupported method 'getblocktemplate'" }</p>
</blockquote>

CC BY-SA 3.0
2013-12-04T23:39:29.410Z
What is the processor you are using on the Mac Mini ?
Meterbuchus
CC BY-SA 3.0
2013-12-04T23:41:52.210Z
@Meterbuchus The GPU or the CPU? As I stated in the question on the Mini it is an Intel HD Graphics 4000 GPU. CPU is: 2.3 GHz Intel core i7
Deesbek
CC BY-SA 3.0
2013-12-04T23:44:56.493Z
Do you know which generation of an i7 it is ? A specific model number would be helpful.
Meterbuchus
CC BY-SA 3.0
2013-12-04T23:53:05.127Z
`sysctl -n machdep.cpu.brand_string` yields:
Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
Deesbek
CC BY-SA 3.0
2013-12-05T01:23:29.327Z
Your error indicates you have pointed your mining program at an unsuitable source of work.
David Schwartz
<mac><miner-configuration><gpu-mining><bfgminer>
GPU mining with Intel HD Graphics 4000
Deesbek
# GPU mining with Intel HD Graphics 4000

(Asked by: username_0 on 2013-12-04)

I am running Mac OS X 10.7 on a MBP and OS X 10.8 on a Mac Mini. The Mini has a Intel HD Graphics 4000 GPU and the MBP has a 3000.

I know that I cannot mine with the MBP as the GPU does not support OpenCL. The Mac Mini should be able to as the Intel HD 4000 supports OpenCL 1.2.

However when I run:

```
bfgminer -n
 [2013-12-04 15:35:22] 0 GPU devices max detected

```

My GPU is not detected. I have the latest XCode installed as the well as command line tools and compiled bfgminer with the latest install of brew.

I just want to play around with mining and am not interested in buying an ASIC set up.

**How can I get my GPU to be detected by bfgminer or cgminer?**

---

# Update:

When I run 'bfgminer --verbose' I get the following error:

> [2013-12-04 17:30:57] JSON-RPC call failed: { "code": -1,  
> "message": "Unsupported method 'getblocktemplate'" }

**Tags:** mac, miner-configuration, gpu-mining, bfgminer

> **Comments:**
> **username_1**: What is the processor you are using on the Mac Mini ?  
> **username_0**: @username_1 The GPU or the CPU? As I stated in the question on the Mini it is an Intel HD Graphics 4000 GPU. CPU is: 2.3 GHz Intel core i7  
> **username_1**: Do you know which generation of an i7 it is ? A specific model number would be helpful.  
> **username_0**: `sysctl -n machdep.cpu.brand_string` yields: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz  
> **username_2**: Your error indicates you have pointed your mining program at an unsuitable source of work.  

---

## 2 answers

### Answer by username_1 on 2013-12-05. Score: 3

The following program will show you the OpenCL-capable devices on a given Macintosh:

```
// clang -framework OpenCL dumpcl.c -o dumpcl && ./dumpcl

# include <stdio.h>
# include <stdlib.h>
# include <OpenCL/opencl.h>

int main(int argc, char* const argv[]) {
    cl_uint num_devices, i;
    clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, 0, NULL, &num_devices);

    cl_device_id* devices = calloc(sizeof(cl_device_id), num_devices);
    clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, num_devices, devices, NULL);

    char buf[128];
    for (i = 0; i < num_devices; i++) {
        clGetDeviceInfo(devices[i], CL_DEVICE_NAME, 128, buf, NULL);
        fprintf(stdout, "Device %s supports ", buf);

        clGetDeviceInfo(devices[i], CL_DEVICE_VERSION, 128, buf, NULL);
        fprintf(stdout, "%s\n", buf);
    }

    free(devices);
}

```

If it fails to show you your GPU then its a driver issue.If it succeeds then its some kind of a configuration error.

> **Comments:**
> **username_0**: In order to compile the above the following has to be done [cc dumpcl.c -o dumpcl -framework OpenCL](http://stackoverflow.com/a/20389401/2871638).  
> **username_0**: Ok, it runs, so it is an configuration error.  

---

### Answer by username_3 on 2013-12-06. Score: 1

Upgrade to OS X Mavericks and it should work. It's a driver issue.

At least on my Macbook, after I upgraded to Mavericks I can mine on both the GeForce and the Intel HD 4000. Not that it makes sense to do so. ASICs have taken over, and even before that AMD was the GPU for mining.

> **Comments:**
> **username_0**: I have upgraded to OS X Maverics and it has made no difference.  
> **username_4**: Mine litecoins with GPU. @username_0  
> **username_0**: @username_4username_4 thanks for the tip, I have friends who do that and Dogiecoin as well but I specifically needed to compare performance changes over time with GPU.  

---

