Quick Guide on How To Compile CudaMiner for Windows from the Source Code

14 Apr
2014

cudaminer-latest-windows-build-from-source

It seems that a lot of people are having trouble figuring out how to compile CudaMiner from source for Windows and since our readers have also requested a simple and easy to use guide, we have prepared something that should help. The process is pretty simple and straight forward, so if you follow the steps you should be able to compile the code yourself in no time, probably…

First Download the required files:
– You need to have Visual Studio 2010 or 2012 with C++ installed, other versions might also work, but we have not tested.
– Download and install Nvidia CUDA Toolkit, do note that Visual Studio needs to be installed first for the CUDA Toolkit to properly work with it.
– You need to download the Windows versions of pthreads, OpenSSL and curl for the respective version you will be compiling for (32 or 64-bit), there is a complete package that contains all of these to make it simple for you, though they may not be the latest versions.
– Download the latest CudaMiner source code, use the Download ZIP button on the right to make it easier.

cudaminer-requirements

Prepare everything for compiling the project:
– Create a folder where you will place all of the required files, for example CUDAMINER-WIN and extract the complete package of prerequisites in it as well as the source code of CudaMiner, you should have things look like on the image above.
– Open the CudaMiner-master folder and open the cudaminer.sln project file, it should load up in Visual Studio. Note that the project is in VS2010 format and if using 2012 for example you will be asked to upgrade the project to the 2012 format, choose yes.

cudaminer-code-generation

Final tweaks and compiling the project in Visual studio:
– Make Sure you have selected Release build and choose if you are compiling a 32 or 64-bit version inside Visual Studio after you have opened up the cudaminer SLN file.
– If you wan to compile the code for a specific GPU architecture other than the default you will need to go to Project, Properties, Confguration Properties, CUDA C/C++, Device and select the required ones under Code Generation.
– Select Build Solution from the Build menu and wait for the compilation process to finish, you will find the executable file in the Release folder (or x64, Release for the 64-bit version).
– You need the cudaminer.exe executable file and the respective cudart DLL file (32 or 64-bit, depending on the version you are building).
– You also need to get the respective 32 or 64-bit version of the pthreadVC2.dll file from the phtreads folder.
– Put the executable file and the two DLL files in a single folder and you are ready to run CudaMiner.
– Note that on your system everything should be working fine, but on other computers lacking Visual C++ Redistributable for Visual Studio 2010/2012 installed you will need to also install this package (version depends on what version of Visual Studio you have used to compile the project). Alternatively you can just include the msvcp and msvcr DLL files along with the other files to make sure you have all of the required files packaged together.

Hopefully this guide will help you compile the CudaMiner source code for Windows on your own, this could also be helpful in compiling other projects if you haven’t used Visual Studio at all, though the guide is specifically for compiling CudaMiner.



Other Similar Publications:

12 Responses to Quick Guide on How To Compile CudaMiner for Windows from the Source Code

herehere

April 15th, 2014 at 15:39

Awesome! Have not tried this yet, but thanks so much for taking the time to post this, I will give it a shot later and report back.

Miner

April 16th, 2014 at 04:21

Thanks for posting this – much appreciated.

FinnKnite

April 16th, 2014 at 11:39

C:\Users\Marcus\Desktop\Cuda-Win\CudaMiner-master\CudaMiner-master\cudaminer.vcxproj : error : Unable to read the project file “cudaminer.vcxproj”.
C:\Users\Marcus\Desktop\Cuda-Win\CudaMiner-master\CudaMiner-master\cudaminer.vcxproj(50,5): The imported project “C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.props” was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I keep getting this error. What am I doing wrong?

admin

April 16th, 2014 at 17:37

FinnKnite, did you install the CUDA Toolkit, it seems that Visual Studio cannot find it?

FinnKnite

April 17th, 2014 at 00:13

Yes, I installed the toolkit. But I forgot to mention that whenever I install the toolkit its gives me a message that no compatible Visual Studio is found on my computer

admin

April 17th, 2014 at 10:42

FinnKnite, what version of Visual Studio are you using? The CUDA Toolking should detect it when installing and make the necessary preparations so it will work, not getting detected means something is not right…

FinnKnite

April 18th, 2014 at 01:41

I have tried 2010 and 2013. I can’t find 2012 anywhere.

Nick

April 19th, 2014 at 11:07

Any advantage to compiling with 2013 for my 750 tis?

admin

April 19th, 2014 at 13:25

Nick, no, not really.

tedd

October 21st, 2014 at 15:03

same here have cuda 6.5.1 loaded have vs 2010, 2012, 2013 too

one or more projects in the solution were not loaded correctly. please see the output windows for details
Unable to read the project file “ccminer.vcxproj”.
ccminer.vcxproj(57,5): The imported project “C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 6.5.props” was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

admin

October 21st, 2014 at 20:10

Make sure you have installed Visual Studio before the CUDA Toolkit, try reinstalling the CUDA Toolkit.

john

January 20th, 2015 at 17:00

I have changed the code generation to compute_50,sm_50 but when I compile I still get the following error: >C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 6.5.targets(593,9): error MSB3721: The command “”C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin\nvcc.exe” -gencode=arch=compute_10,code=\”sm_10,compute_10\” ……
So it still tries to compile with compute_10,sm_10 although I changed it.

Leave a Reply

Your email address will not be published. Required fields are marked *

top