New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSX Rundown #195
Comments
If it doesn't install cURL globally, where does it install it? The purpose of autoconf is to detect things like this, so it'd be nice to support it. Regarding CPU mining, I'm guessing there's an ABI issue involving the leading underscore. CalcSha256_x64_sse4 is defined in x86_64/sha256_sse4_amd64.asm. Probably there's some GNUism we need to tell GCC not to use the leading underscore for the assembly functions. Regarding OpenCL mining, did you try any of the GPU options, such as other kernels? What do you consider "latest tagged" to be? There haven't been any changes to endian or OpenCL handling since 2.10.0. |
Doh. Yeah I went back and diablo worked fine. I assume the others are patched to take advantage of ATI cards hence the crashing.
haha. welcome to OSX. You will probably gag at this.
and
the brew formula fixes this easily
Doh, I was pulling against 2.3.1-2 as I didn't scroll down far enough to see the tag formats had changed >_< Changing to 2.10 and 2.9.5 results in it stalling at
of course libblkmaker/ is empty >_< Anyway a git clone to fix that and we are back to CL/cl.h errors and endian issue. |
I think they shouldn't patch unless an AMD card is detected, so maybe something to check into still... Can you post the OpenCL info for your card from --debug? Looks like you didn't re-run autogen.sh after changing to newer tags. That uses git to populate libblkmaker. ;) |
Ok to fix the endian issue add a line to detect OSX and do nothing.
|
It errors out because the zip files from the tags don't include the .git directory >_< |
Yeah, don't grab zip files from GitHub... ;) Can you test this code: #if !(defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN))
#ifdef WIN32
#ifndef __LITTLE_ENDIAN
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#endif
#ifndef __BYTE_ORDER
#define __BYTE_ORDER __LITTLE_ENDIAN
#endif
#else
#include <endian.h>
#endif
#endif |
Hmm that causes the file to be included still. Which means those symbols aren't added >_< I'm gonna go jump off a cliff now and do some more research. |
This works. For some reason
Yay \o/
Thus this should work:
|
Is there a specific reason for CL/ being included with the project? I would assume that Linux and OSX would have their own headers (though some it is of course OpenCL/cl.h on apple and CL/cl.h on other platforms). Also looks like some copying of the header to |
CL/ is included because it is a standard interface and the headers are not provided by operating systems (at least not Linux). AMD and nVidia have their own OpenCL headers, but BFGMiner is portable at runtime by dynamically linking to any compliant OpenCL implementation. If I compiled releases against AMD's headers/library, BFGMiner might not run without the same environment, and the binary might include AMD code in violation of the GPL terms. The current arrangement is GPL-compliant and does not use any non-free software to build. |
https://gist.github.com/6533a4e260cea8fbd4e3/ Any idea what is going on here? Looking at CL/cl.h and OpenCL/cl.h it looks like the stuff that errors isn't in the OS provided headers.... clCreateSubDevices, clRetainDevice, clReleaseDevice, clCreateImage, clCreateProgramWithBuiltInKernels, etc. All are OpenCL 1.2 specifications. |
Oooh. CL_API_SUFFIX__VERSION_1_2 is not defined under the Here is the section of the header in the 10.8 API:
|
Hmm, does the OpenCL problem solve if you update the CL headers from http://www.khronos.org/registry/cl/ ? |
Wow. That was a little hacky. In
to
It was still erroring on Now we are back to the errors I was getting before I forcefully removed the copied headers from
or if you enjoy GCCs error syntax.
https://gist.github.com/743354baace43ffd92c3/fbca133d2b648ce3cd84050a96e74fedb10e08a4 I assume the redefinitions inside driver_opencl.c and ocl.c will need to be updated to work with the newer opencl headers. It looks like you could throw both sets into one file with a preprocessor directive to omit |
Does the OpenCL problem solve if you update the CL headers from http://www.khronos.org/registry/cl/ ? Are the __BYTE_ORDER macros defined if you include <sys/param.h>? Can you post the output of this:
|
No. Specifically it causes a different set of problems which I think is do to the mismatch between the new headers and definitions in driver_opencl.c and ocl.c. The errors are posted here.
|
Please pull and check that the new endian/byteswap checks work on Mac. |
Also please report on the updated CL/* in git too. |
Doesn't work >_<. Looks like it isn't linking to the byteswap functions. The OpenGL stuff seems to have worked as it compiles if I use the miner.h header I had. |
Looks like we're getting closer, though! Can you pastebin your config.log ? |
Posting that into gist almost crashed my browser... I'll just post it to dropbox, config.log. |
Hmm, this is odd. When configure links its test, it succeeds, but then not when the build system does it. |
https://gist.github.com/3efe5ef1d8df348b701e Doesn't seem to be anything diff |
brew: superenv removed: -g -O2 Can you stop it from removing -O2? :) |
Maybe. A lot of stuff is lolundocumented. I just recently found the |
How about trying to build it without brew again?
|
Same errors outside of brew even though that configure line worked. https://gist.github.com/3efe5ef1d8df348b701e/
|
Can you post the config.log from that one? Looks different... I am suspecting -O2 related in case of something weird going on with the function being inlined. Without optimization, inlines are ignored... |
Really? I wasn't expecting it to be that easy! CPU mining actually works and all? |
I tested it with my p2pool node and got accepted shares and now with your url rejected shares so it should be working fine! It is a lot slower than poolers cpu miner though… |
Cannot say I am as lucky: using yasm 1.2; what version should I be using? |
@ibd1279 Does this patch help? http://codepad.org/p6fXPB9P |
That gets me a little further, but then I get this one: I tried adding the qword onto what I think is the problem on that one (g_4sha256_k -- yasm error messages seem especially unhelpful), but then I get: |
Are you using the latest git? Line 239 doesn't have any code in it... |
https://github.com/luke-jr/bfgminer/blob/bfgminer/x86_64/sha256_sse4_amd64.asm#L239 ?? 239 is the unroll. That is what I meant by the yasm error messages are not very helpful. Anything that happens in that macro gets spit out where the unroll happens. That is why I am not sure if I was putting the qword even in the right place. |
Ah, nasty. I suppose you could manually unroll the loop (even just once should expose the error)? |
sha256_sse4_amd64.asm:237: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for pointers. line 237 is: movntdqa xmm1, g_4sha256_k[rax*4] sha256_sse4_amd64.asm:237: error: invalid size for operand 2 My assembly-fu is somewhere between "non-existant" and "I think I did a mov ax, bx thing once at band camp", but is this expected to use C-style pointer math? as in ((void*)((char*)g_4sha256_k) + (rax4)) or is it supposed to some weird assembly/pointer math thing like ((void)((char*)g_4sha256_k) + ((qword)(rax*4)). I always thought square brackets meant "fetch the value from this address", and I don't remember identifier[offset] syntax... but my assembly-fu just plain sucks. Ugh, escaping the dereference/pointer op sucks. |
Try this: http://codepad.org/TyaNGJIn |
That builds, but it doesn't love it running: |
Sorry to have misled you before - I'd compiled without yasm so it didn't kick up a fuss. |
I was able to build bfgminer a few days ago from git with ./configure PKG_CONFIG_PATH=/Applications/MacMiner.app/Contents/Resources/curl/lib/pkgconfig:/Applications/MacMiner.app/Contents/Resources/jansson/lib/pkgconfig --enable-scrypt --enable-cpumining CPPFLAGS="-I/uthash-master/src/" there were just a few errors during compilation, mostly unused variables, and /usr/bin/ranlib: file: libgnu.a(dummy.o) has no symbols |
@fabulouspanda Can you bisect this? |
It was this commit that broke it: |
Not if you compile without CPU... O.o |
I was compiling without CPU. Go figure. |
hang on, it seems like it works if I specifically state --disable-cpu although it says it's disabled after configure either way let me make sure i've not done something wrong here |
Sorry I was running the wrong binary there probably. I just installed from git and it looks as though one of your recent commits has fixed it. Thanks! |
the 3.1.0 released tarball compile crashes with segfault every time I run it. Traced it down to this: Program received signal EXC_BAD_ACCESS, Could not access memory. However, if I build from the git HEAD, it seemingly works fine. I use brew to install all the dependencies and then configured with this: env LIBCURL_LIBS="-L/usr/local/Cellar/curl/7.30.0/lib -lcurl" LIBCURL_CFLAGS=-I/usr/local/Cellar/curl/7.30.0/include ./configure For what its worth, I have shared a brew for this, which is currently at 3.0.2 since 3.1.0 will not run. You can access it with "brew tap khera/homebrew-vick" then simply 'brew install bfgminer --HEAD' to get the latest from git. I try to keep it updated so normal brew upgrade should keep you up to date. |
Getting |
I'm having trouble making 3.1.2
|
I was having the same problem as fabulouspanda, but it appears fixed in the latest pull. |
I got my jalapeño in today. You may also need to install the x64 drivers from here. I am not 100% on this though. Seems to be getting fairly fast speeds while running cool. |
You do need the ftdi usb serial drivers but the 3.1.3 version i pulled from github for the latest beta version of MacMiner (a few fixes from the released 3.1.3) allows you to use -S all rather than specifying the device, so if that doesn't work for you something's wrong in 3.1.4 - I haven't checked it yet though and not sure whether you tried that? I'm using a jala too. |
|
I'm gonna go ahead and close the super mega OSX thread. Good job to all the devs for keeping OSX a usable platform. |
Status: OpenCL kernel issue/detection?
Status: OpenCL header compile problem - resolved in git
Status: Mac endian.h missing - resolved in git
Status:
--enable-cpumining
doesn't linkGreetings. I had an OSX machine I had lying around and figured I would test it and point out any issues. The initial portion of this deals with building the latest tagged version in the repository. With the last segment covering issues building against HEAD.
Requirements / Building
First up the method. I chose to make a brew formula since it doesn't detect the system's curl.
HomeBrew has a curl package but it doesn't install globally to avoid conflicts. So I just made a formula for homebrew to get around that small issue with a forced breakpoint to test the binary incase it works.
Without the formula you can install all the dependencies with
automake was missing from the dependencies list in the readme causing it to error out on aclocal being missing. Also the AMD APP SDK link is a 404 now so you may need to fix that.
CPU Mining
With cpumining enabled there is a linker error that I don't know how to fix. This happens when building with both clang and gcc-llvm.
GPUs
GPUs don't seem to work. I only have a shitty nvidia 9400 on this mac mini so I wasn't expecting much anyway. Upon connecting to a pool it throws:
Then it loops those messages unless you explicitly disable the GPU. Since most OSX systems don't have a GPU worthwhile this isn't really necessary IMO.
HEAD Issues
When building against head there is an issue with the endian detection.
miner.h
was fairly weird as it handles it fine around 122-127 with:then fails starting at 146 with it falling back on endian.h by default.
Also CL/cl.h produces a ton of errors. Starting with:
or Clang
The text was updated successfully, but these errors were encountered: