Let's start with OpenCL 1.1 support.
OpenCL 1.1 doesn't actually support the 'static' storage class specifier and so running ethminer on Mesa results is a bunch of
input.cl:114:1: error: OpenCL version 1.1 does not support the 'static' storage class specifier
obviously with different line numbers. To fix that I used the solution from cpp-ethereum issue #3020 , where @lvella cleverly figured out you could enable the specifier anyway by prepending
#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
at the top of
/libethash-cl/ethash_cl_miner_kernel.cl
which still works with the latest git of ethminer.
With that out of the way, the issue I'm facing now is that I'm instead getting
[OPENCL]:<unknown>:0:0: in function ethash_calculate_dag_item void (i32, %union.compute_hash_share addrspace(1)*, %union.compute_hash_share addrspace(1)*, i32): unsupported initializer for address space
I have no clue what this means since I don't know more than incredibly basic OpenCL. Grepping the source tree reveals this line:
./libethash-cl/ethash_cl_miner_kernel.cl:386:__kernel void ethash_calculate_dag_item(uint start, __global hash64_t const* g_light, __global hash64_t * g_dag, uint isolate)
which I, again, have no clue what it actually does. I presume the solution to this one isn't as simple as adding a #pragma directive.
How do I proceed from here?
Sample benchmark run, including Ctrl+C at the end where the program simply stopped for several minutes:
ethminer/build$ ./ethminer/ethminer -G -M
[OPENCL]:Found suitable OpenCL device [AMD TAHITI (DRM 2.48.0 / 4.9.0-3-amd64, LLVM 3.9.1)] with 3221225472 bytes of GPU memory
Benchmarking on platform: CL
Preparing DAG for block #0
Warming up...
ℹ 03:06:46|openclminer0 set work; seed: #00000000, target: #000000000000
ℹ 03:06:46|openclminer0 Initialising miner...
[OPENCL]:Using platform: Clover
[OPENCL]:Using device: AMD TAHITI (DRM 2.48.0 / 4.9.0-3-amd64, LLVM 3.9.1)(OpenCL 1.1 Mesa 13.0.6)
[OPENCL]:<unknown>:0:0: in function ethash_calculate_dag_item void (i32, %union.compute_hash_share addrspace(1)*, %union.compute_hash_share addrspace(1)*, i32): unsupported initializer for address space
[OPENCL]:clEnqueueWriteBuffer(-38)
Trial 1... 0
Trial 2... 0
Trial 3... 0
Trial 4... 0
Trial 5... 0
^C
ethminer/build$
Edit: Sorry, there's no simple way to prevent GitHub from butchering the formatting in the last code block.
Fyi, you can use three backticks to do code blocks. See https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code
I'm getting this error too for my Gigabyte R9 280X 3GB Rev 2 on Ubuntu 17.04.
Hmmn, I've compiled this with #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable and things were looking good but then I got a few radeon: Failed to allocate a buffer errors and it just hangs on Received new job:
[OPENCL]:Found suitable OpenCL device [AMD TAHITI (DRM 2.43.0 / 4.4.0-62-generic, LLVM 4.0.1)] with 3221225472 bytes of GPU memory
ℹ 12:03:33|ethminer Connecting to stratum server eu1.ethermine.org:4444
ℹ 12:03:33|stratum Connected to stratum server eu1.ethermine.org : 4444
ℹ 12:03:33|stratum Starting farm
ℹ 12:03:33|stratum Subscribed to stratum server
ℹ 12:03:33|stratum Authorized worker 0xA3BdD96b08A1bd921c2a98e28Cd69B197963A588.picaxe
ℹ 12:03:33|stratum Received new job #158ea4c1
ℹ 12:03:33|openclminer0 set work; seed: #39c5f107, target: #0000000112e0
ℹ 12:03:33|openclminer0 Initialising miner...
ℹ 12:03:33|openclminer1 set work; seed: #39c5f107, target: #0000000112e0
ℹ 12:03:33|openclminer1 Initialising miner...
m 12:03:33|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:34|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:34|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:34|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:34|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:34|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:35|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:35|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:35|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:35|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
[OPENCL]:Using platform: Clover
[OPENCL]:Using device: AMD TAHITI (DRM 2.43.0 / 4.4.0-62-generic, LLVM 4.0.1)(OpenCL 1.1 Mesa 17.2.0-devel)
[OPENCL]:Using platform: Clover
[OPENCL]:Using device: AMD TAHITI (DRM 2.43.0 / 4.4.0-62-generic, LLVM 4.0.1)(OpenCL 1.1 Mesa 17.2.0-devel)
m 12:03:35|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:36|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:36|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:36|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:36|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
[OPENCL]:[OPENCL]:Printing program logPrinting program log
[OPENCL]:
[OPENCL]:Creating cache buffer
[OPENCL]:[OPENCL]:
[OPENCL]:Creating cache buffer
Creating DAG buffer
[OPENCL]:Loading kernels
[OPENCL]:Creating DAG buffer
[OPENCL]:Loading kernels
[OPENCL]:Writing cache buffer
[OPENCL]:Writing cache buffer
[OPENCL]:[OPENCL]:Creating buffer for header.Creating buffer for header.
[OPENCL]:Creating mining buffer [OPENCL]:Creating mining buffer 00
[OPENCL]:Creating mining buffer 1
[OPENCL]:Generating DAG data
[OPENCL]:Creating mining buffer 1
[OPENCL]:Generating DAG data
radeon: Failed to allocate a buffer:
radeon: size : 2181038080 bytes
radeon: alignment : 4096 bytes
radeon: Failed to allocate a buffer:
radeon: size : 2181038080 bytes
radeon: alignment : 4096 bytes
radeon: domains : 4
radeon: domains : 4
radeon: flags : 4
radeon: flags : 4
radeon: Failed to allocate a buffer:
radeon: size : 2181038080 bytes
radeon: alignment : 4096 bytes
radeon: domains : 4
radeon: flags : 4
radeon: Failed to allocate a buffer:
radeon: size : 2181038080 bytes
radeon: alignment : 4096 bytes
radeon: domains : 4
radeon: flags : 4
[OPENCL]:[OPENCL]:clEnqueueNDRangeKernelclEnqueueNDRangeKernel((-5-5)
)
m 12:03:36|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:37|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:37|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:37|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:37|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:37|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:38|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:38|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:38|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:38|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:38|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:39|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:39|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:39|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:39|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:39|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:40|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:40|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:40|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:40|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:40|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:41|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:41|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:41|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:41|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:41|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:42|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:42|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:42|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:42|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:42|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:43|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:43|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:43|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:43|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:43|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:44|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:44|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:44|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:44|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:44|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:45|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:45|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:45|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:45|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:45|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:46|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:46|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:46|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:46|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:46|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:47|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:47|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:47|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:47|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:47|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:48|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:48|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:48|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:48|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:48|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:49|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:49|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:49|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:49|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:49|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:50|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:50|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:50|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:50|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:50|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:51|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:51|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:51|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:51|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:51|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:52|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
m 12:03:52|ethminer Mining on PoWhash #158ea4c1 : 0.00MH/s [A0+0:R0+0:F0]
ℹ 12:03:52|stratum Received new job #ea73a523
Using Ubuntu Server 16.04 with an HD 7950 running Oibaf drivers.
I ended up downgrading my Ubuntu 17.04 to 16.04 so that I can install the amdgpu-pro driver. It did not install on 17.04. After that I don't have this OpenCL 1.1 issue anymore, because the amdgpu-pro driver comes with OpenCL 1.2 support.
That's another thing I have 50% MH/s than it is supposed to be. Gotta fine tune my settings I guess.
@papaiatis Do you have a link to the driver you used? I didn't think amdgpu-pro supported the 280X? I'm trying to get this working with a HD 7950 (very similar to 280X) and the amdgpu-pro drivers gave me the error Internal error: Input OpenCL binary is not for the target!.
I have 280X and I'm using OpenCL 1.2 (old fglrx-core headless driver for Ubunut 16.04).
@lukechilds I followed these steps: http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%E2%80%93Release-Notes.aspx
Interestingly the 280X is not mentioned on that page, but still seem to be working.
@chfast are you able to send a link to where I could find those drivers? I was under the impression fglrx was completely incompatible with 16.04 due to the version of X.Org it uses.
@papaiatis Thanks, that's what I tried previously.
Yes, because AMD has fucked you in (select a body part you want) and dropped official OpenCL support for you card on Linux. amdgpu-pro driver does not support chips of GCN 1.0 nor GCN 1.1. Even if you installed it, it did not mean the Linux kernel was using it.
@chfast thanks so much for the link, it's working. Are you able to set the clock speeds of your card using that driver? Apologies for hijacking this issue btw, happy to take this conversation elsewhere if you'd prefer.
Is there any reason the actual fix of this bug has not been committed yet?
diff --git a/libethash-cl/ethash_cl_miner_kernel.cl b/libethash-cl/ethash_cl_miner_kernel.cl
index a3e190034..74681f52c 100644
--- a/libethash-cl/ethash_cl_miner_kernel.cl
+++ b/libethash-cl/ethash_cl_miner_kernel.cl
@@ -60,6 +60,10 @@ __constant uint2 const Keccak_f1600_RC[24] = {
(uint2)(0x80008008, 0x80000000),
};
+#ifdef cl_clang_storage_class_specifiers
+#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
+#endif
+
#if PLATFORM == OPENCL_PLATFORM_NVIDIA && COMPUTE >= 35
static uint2 ROL2(const uint2 a, const int offset) {
uint2 result;
See for example: ethereum/libethereum@86d472ab705eb40a6e504949e334ec1e48da3f43
And the proper spec: https://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/storageQualifiers.html
@EoD That fix is needed too but it doesn't affect the actual issue we're all having here.
This issue is about running ethminer on Mesa and getting
[OPENCL]:<unknown>:0:0: in function ethash_calculate_dag_item void (i32, %union.compute_hash_share addrspace(1)*, %union.compute_hash_share addrspace(1)*, i32): unsupported initializer for address space
not
[19:15:44] input.cl:369:1: error: OpenCL does not support the 'static' storage class specifier
@Djhg2000 Maybe your version of Mesa is too old? Ethminer works fine for me in benchmark mode with the above patch. I am using current Mesa 17.2-git.
The only issue I ran into was unsupported call to function get_local_size, but that seems to be libclc's fault. See https://bugs.freedesktop.org/show_bug.cgi?id=99856 .
@EoD wouldn't this commit prevent it from running on your machine? https://github.com/ethereum-mining/ethminer/commit/a78634499f0006c7f04ff98808fb18cee9aa6c6a
@smasher816 No, I missed this commit. I rebase my branch on top of the current master and added some code to let Clover work again.
@EoD According the Debian package version it seems like I have Mesa 13.0.6-1+b2. Please note that Mesa 17 was preceded by Mesa 13 (14-16 was skipped), so it's not that old.
@Djhg2000 Just a guess, but can you try using kernel 4.11+ and enabling amdgpu for GCN1.0?
@EoD I seem to have forgotten to mention it in the thread, but I'm already running Linux 4.11.6 compiled with AMDGPU support for SI and CIK. The issue happens with both radeon and amdgpu so I think it's a userspace thing. My best guess would be either a compiler bug in Mesa or more unsupported OpenCL 1.2 stuff in etherminer. Which distro are you using?
@Alpherie @Djhg2000 Are you sure, you are not running into a libclc bug (or missing feature)?
Can you try upgrading libclc together with the patch https://bugs.freedesktop.org/show_bug.cgi?id=99856 and try it again?
Random guess
I assume you are using debian and hence this package which currently exists in version 0.2.0+git20160907-4. This would mean you are missing out on the following commit llvm-mirror/libclc@2fa037473ccbdd50dd43d27050955e7f3c8d3824 which might cause the error you see.
Most helpful comment
Fyi, you can use three backticks to do code blocks. See https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code