sgminer-dev / sgminer

Scrypt GPU miner
GNU General Public License v3.0
632 stars 827 forks source link

Error building sgminer 5_0 using VC 2012 #229

Closed Bllacky closed 10 years ago

Bllacky commented 10 years ago

I have been building sgminer for a long time using VC 2012.

With Sgminer 5.0 I get the following error: http://i57.tinypic.com/2nbg5y8.jpg

I also now need to add the following dlls to the sgminer folder: libeay32.dll ssleay32.dll

mrbrdo commented 10 years ago

Have you built v5_0 before? I had exactly the same error when I tried to build it, and I never solved it. Someone else seems to have been able to build it, since there are builds in the wild. But I have no idea why that happens :-/

mrbrdo commented 10 years ago

What do you mean merged? I only merged it into v5_0, it wasn't merged into master yet.

Bllacky commented 10 years ago

Sorry. I accidentally deleted the previous post. I mean merged into 5_0 , not into master.

I am currently building with mingw32, but VS is better.

It may be related to the fact that I am building in 64-bit using VS. Maybe those building in 32-bit don't have this problem.

After I manage to successfully build in 64-bit I will update the Readme.txt with instructions. So far it looks like a problem in the source code. Unfortunately I don't have time to look into it right now. I am positive one of those VS warnings is related to this problem.

bsom commented 10 years ago

I compiled it in 32-bit, but it took some tweaking to get it done. And VS keep griping about duplicate OBJ files and would quit:

https://github.com/sgminer-dev/sgminer/pull/226

Bllacky commented 10 years ago

I didn't have to do any tweaking. Worked like a charm following the instructions in the Readme.txt (which I edited and tested some time ago). But the end result is not working.

Bsom, what VS version did you use ?

bsom commented 10 years ago

I tried both VS2010 Express and VS2012 Express.

bsom commented 10 years ago

A working copy that I have compiled is available here: http://sgminer.builders

Bllacky commented 10 years ago

I use exactly the same environment and libs, except that this time I used ADL_SDK 7.0. The only difference is that I compiled using release x64... hmmm.

bsom commented 10 years ago

Yeah, I used both ADL_SDK 6.0 and 7.0 and both worked. The only difference I see is that I did 32-bit, just as you have stated.

mrbrdo commented 10 years ago

@bsom I had the object files issue too (understandable), I thought I commited that option into the MSVC project though? I would really appreciate if you can help with the MSVC project so it actually works :)

Bllacky commented 10 years ago

@bsom, if I give you the x64 compiled libs, can you try and build in x64 to see if you get the same error ?

Also your 32-bit version includes the 2 dlls mentioned already in the exe file, my version doesn't include them.

@mrbrdo I think that's why I didn't get the error, because you already fixed it.

bsom commented 10 years ago

@mrbrdo: I downloaded the latest commit yesterday and I still needed to make the change.

bsom commented 10 years ago

@Bllacky: I can give it a try.

Bllacky commented 10 years ago

Here you go: http://www.mediafire.com/download/6wohlwo99wy2tlq/dist.zip Remember to install OpenSSL Windows 64-bit.

bsom commented 10 years ago

@Bllacky Got 'em. Trying it out now.

bsom commented 10 years ago

@Bllacky I didn't have the x64 compilers installed. Installing now...

Bllacky commented 10 years ago

I am here, waiting. No worries.

mrbrdo commented 10 years ago

@bsom I would appreciate any pull request making the MSVC build work out of the box.

bsom commented 10 years ago

@mrbrdo I'll send a pull request with the parts I had trouble with...as soon as I'm done with @Bllacky :-)

bsom commented 10 years ago

@Bllacky Good gravy, this Win7.1 SDK takes a long time to install!! :-)

Bllacky commented 10 years ago

I don't think you need Win 7.1 SDK for VS 2012. You only need it for VS 2010.

troky commented 10 years ago

I am building VS2010 32/64 bit without problems... @Bllacky wht kernel you used to get error from OP?

troky commented 10 years ago

btw... I have all dependent libs build statically so only sgminer.exe is built. No need for additional dlls.

Bllacky commented 10 years ago

marucoin-mod. you want me to try another one. Then what exactly am I doing wrong? I downloaded from git, built my own libs, everything should have been fine... there are no compiling errors. Maybe I should paste the compile log here.

mrbrdo commented 10 years ago

@troky I tried to build v5_0 via instructions in the docs with MSVS 2010 Express, but I got that LOOKUP_GAP error when compiling the cl file (after starting sgminer).

Bllacky commented 10 years ago

Got the same error trying to compile cl with zuikkis for scrypt and nscrypt. This error is nonexistent in my mingw32 build.

bsom commented 10 years ago

I can't even get the damn Windows 7.1 SDK to install properly. Keeps giving an error and quitting. Let me check my build for stability. I'll try different cl's.

Bllacky commented 10 years ago

If you use VS 2012, you shouldn't need the SDK. VS 2012 has native x64 support.

bsom commented 10 years ago

Well, I'm going to use 2012 from now on since I won't have the SDK. :-)

bsom commented 10 years ago

Of course, 20 seconds after I type that, it starts installing properly. Sigh.

Bllacky commented 10 years ago

Take control of your computer, don't let IT take control of you :)

bsom commented 10 years ago

OK. I'm really batting .1000 today. I got it compiled in x64 but it won't execute at all. My game is off.

Bllacky commented 10 years ago

What error do you get ?

BTW, this is the output of my build: http://www.mediafire.com/view/p62ok2ibaql85ii/output.txt

bsom commented 10 years ago

0xc000007b Usually that means that the VC++ runtime is missing. But it's there...

Bllacky commented 10 years ago

I had the same error. My solution was to add the OpenCL libs from the bin folder to the sgminer folder. There are 2 which are missing. You can find my sgminer build here: https://www.mediafire.com/?cp66ayqt766xx0f with the dlls.

bsom commented 10 years ago

OK. I can get it to 'run' of a sort. It refuses to compile any CL files: Error -11: Building Program (clBuildProgram) but I think that's because I'm on my dev machine right now and it has a turd for a video card.

mrbrdo commented 10 years ago

@bsom just in case it's some old amd card.. since v5_0 (because of X11 kernels etc), it doesn't work for AMD Legacy drivers anymore (won't compile cl files).

bsom commented 10 years ago

Yeah, that's what I'm thinking is the problem. Unfortunately, I don't have access to any of my miners at the moment. Trying to remedy that so I can test this fully.

troky commented 10 years ago

8198286597f01d19f845d0699e6d4d7213d5e346 fixed kernel build.

bsom commented 10 years ago

OK...Compiles CL's just fine now. Even on my crappy dev computer.

mrbrdo commented 10 years ago

That's awesome guys. Does this mean this is resolved?

bsom commented 10 years ago

@mrbrdo It's solved for me. Don't know about @Bllacky

troky commented 10 years ago

I believe it is.

Bllacky commented 10 years ago

I still need to add the following dlls to the sgminer folder: libeay32.dll ssleay32.dll

But apart from that it seems to work.

troky commented 10 years ago

I can provide compiled static libs (x86/x64) for vs2010 if someone is interested.

Bllacky commented 10 years ago

I have tried to build SGminer this morning. I have tried to build Sgminer again now. Although it says build is successful, when I try to run it (using marucoin-mod). This is the result:

http://tinypic.com/view.php?pic=rtn8qw&s=8

troky commented 10 years ago

Do you have blake.cl in kernel/ folder? Can you post debug log (-T --debug)?

Bllacky commented 10 years ago

Yes. I have blake.cl in kernel folder. I have also tried to move the blake.cl from the kernel to root folder of sgminer. Still not working.

kernel path in config: "tcp-keepalive" : "30", "temp-hysteresis" : "3", "shares" : "0", "kernel-path" : "/usr/local/bin" }

Here is the output of debug:

[23:36:32] Failed to init GPU thread 2, disabling device 1 [23:36:32] Init GPU thread 3 GPU 1 virtual GPU 1 [23:36:32] CL Platform vendor: Advanced Micro Devices, Inc. [23:36:32] CL Platform name: AMD Accelerated Parallel Processing

[23:36:32] CL Platform version: OpenCL 1.2 AMD-APP (1348.5) [23:36:32] Platform devices: 5 [23:36:32] 0 Tahiti [23:36:32] 1 Tahiti [23:36:32] 2 Pitcairn [23:36:32] 3 Tahiti [23:36:32] 4 Tahiti [23:36:33] List of devices: [23:36:33] 0 Tahiti [23:36:33] 1 Tahiti [23:36:33] Selected 1: Tahiti [23:36:33] 2 Pitcairn [23:36:33] 3 Tahiti [23:36:33] 4 Tahiti [23:36:33] Preferred vector width reported 1 [23:36:33] Max work group size reported 256 [23:36:33] Max shaders calculated 2048 [23:36:33] Max mem alloc size is 2951741440 [23:36:33] Setting worksize to 128 [23:36:33] cl_amd_media_ops found, setting BITALIGN [23:36:33] BFI_INT patch requiring device not found, will not BFI_INT patch

[23:36:33] No binary found, generating from source [23:36:33] Building binary marucoin-modTahitigw128l4big4.bin

[23:36:33] CompilerOptions: -I "C:\Users\Admin\Desktop\Release\" -I "C:\Users\S ilviu\Desktop\Release\kernel" -I "." -D WORKSIZE=128 -D BITALIGN -I "/usr/local/ bin\" -D SPH_HAMSI_EXPAND_BIG=4 [23:36:33] Error -11: Building Program (clBuildProgram) [23:36:33] "C:\Users\Admin\AppData\Local\Temp\OCL8738.tmp.cl", line 82: catastr ophic error: cannot open source file "blake.cl"

include "blake.cl"

                 ^

1 catastrophic error detected in the compilation of "C:\Users\Admin\AppData\Loc alT☺ [23:36:33] Failed to init GPU thread 3, disabling device 1 [23:36:33] Init GPU thread 4 GPU 2 virtual GPU 2 [23:36:33] CL Platform vendor: Advanced Micro Devices, Inc. [23:36:33] CL Platform name: AMD Accelerated Parallel Processing

[23:36:33] CL Platform version: OpenCL 1.2 AMD-APP (1348.5) [23:36:33] Platform devices: 5

troky commented 10 years ago

try to remove kernel-path option from config

Bllacky commented 10 years ago

The result is:

00:00:26] Failed to init GPU thread 2, disabling device 1 [00:00:26] Init GPU thread 3 GPU 1 virtual GPU 1 [00:00:26] CL Platform vendor: Advanced Micro Devices, Inc. [00:00:26] CL Platform name: AMD Accelerated Parallel Processing

[00:00:26] CL Platform version: OpenCL 1.2 AMD-APP (1348.5) [00:00:26] Platform devices: 5 [00:00:26] 0 Tahiti [00:00:26] 1 Tahiti [00:00:26] 2 Pitcairn [00:00:26] 3 Tahiti [00:00:26] 4 Tahiti [00:00:26] List of devices: [00:00:26] 0 Tahiti [00:00:26] 1 Tahiti [00:00:26] Selected 1: Tahiti [00:00:26] 2 Pitcairn [00:00:26] 3 Tahiti [00:00:26] 4 Tahiti [00:00:26] Preferred vector width reported 1 [00:00:26] Max work group size reported 256 [00:00:26] Max shaders calculated 2048 [00:00:26] Max mem alloc size is 2951741440 [00:00:26] Setting worksize to 128 [00:00:26] cl_amd_media_ops found, setting BITALIGN [00:00:26] BFI_INT patch requiring device not found, will not BFI_INT patch

[00:00:26] No binary found, generating from source [00:00:26] Building binary marucoin-modTahitigw128l4big4.bin

[00:00:26] CompilerOptions: -I "C:\Users\Admin\Desktop\Release\" -I "C:\Users\Admin\Desktop\Release\kernel" -I "." -D WORKSIZE=128 -D BITALIGN -I "\" -D SPH_H AMSI_EXPAND_BIG=4 Command-line error: missing source file name

1 catastrophic error detected in this compilation. Compilation terminated. [00:00:26] Error -11: Building Program (clBuildProgram) [00:00:26] Frontend phase failed compilation.

[00:00:26] Failed to init GPU thread 3, disabling device 1 [00:00:26] Init GPU thread 4 GPU 2 virtual GPU 2