decred / gominer

Go (golang) based GPU miner for Decred.
GNU General Public License v3.0
159 stars 77 forks source link

cuda: Add Windows Support #206

Closed matheusd closed 10 months ago

matheusd commented 10 months ago

This adds support to building the CUDA-enabled version of gominer on Windows, as well as adding instructions on how to do so.

Additionally, it switches from using a Makefile to using go generate in order to make the building process more idiomatic to Go projects.

matheusd commented 10 months ago

I wonder if the generate portion should just handle the building of the compiled blake3 cuda kernel and then a normal go build -tags cuda to actually build gominer after that?

Then we're back at having the user setup their own CGO_CFLAGS and CGO_LDFLAGS by hand, because those are also needed during the go build stage. Adding #cgo directives to the source code is not sufficient, because barnex/cuda5 requires cuda.h, and that isn't available by default on windows without setting up the env vars.

davecgh commented 10 months ago

Then we're back at having the user setup their own CGO_CFLAGS and CGO_LDFLAGS by hand, because those are also needed during the go build stage. Adding #cgo directives to the source code is not sufficient, because barnex/cuda5 requires cuda.h, and that isn't available by default on windows without setting up the env vars.

Ah, alright. I thought it was only needed for the nvcc bits to build the kernel.

matheusd commented 10 months ago

Updated readme with the various sections (view compiled file).

Also, I added a document which describes how to manually setup CUDA builds in windows (view)

matheusd commented 10 months ago

Made a first batch of review fixes.

davecgh commented 10 months ago

All of the updates thus far look good.

matheusd commented 10 months ago

Updated with changes to the debian section.

davecgh commented 10 months ago

I'll merge this after the squash.