Bitcoin Forum

Bitcoin => Project Development => Topic started by: whanau on April 28, 2024, 09:36:07 PM



Title: Compiling KeyHunt_Cuda with gpu support
Post by: whanau on April 28, 2024, 09:36:07 PM
I am trying to compile this code
https://github.com/iceland2k14/KeyHunt-Cuda

but it will only compile without cuda support the error message is

 ./KeyHunt -l
GPU code not compiled, use -DWITHGPU when compiling.

However I can see it happening. A lot of output ending with

g++ -DWITHGPU -m64 -mssse3 -Wno-write-strings -O2 -I. -I/usr/local/cuda/include -o obj/GmpUtil.o -c GmpUtil.cpp
g++ -DWITHGPU -m64 -mssse3 -Wno-write-strings -O2 -I. -I/usr/local/cuda/include -o obj/CmdParse.o -c CmdParse.cpp
Making KeyHunt...

It works in cpu mode.

VanitySearch and kangaroo from JLP both compile with gpu support.

Any ideas please??


Title: Re: Compiling KeyHunt_Cuda with gpu support
Post by: PowerGlove on April 28, 2024, 10:15:19 PM
Any ideas please??
I've never used this tool, but, taking a quick peek at the code, it looks to me like the cause of your error message might be a bug...

The code starting at line 290 in Main.cpp (https://github.com/iceland2k14/KeyHunt-Cuda/blob/3ab94fb59ac18cb308815919b0d8a64ff214c2c2/KeyHunt-Cuda/Main.cpp#L290) looks like this:

Code:
			else if (optArg.equals("-l", "--list")) {
#ifdef WIN64
GPUEngine::PrintCudaInfo();
#else
printf("GPU code not compiled, use -DWITHGPU when compiling.\n");
#endif
return 0;
}

That #ifdef should probably be #ifdef WITHGPU, not #ifdef WIN64.

(Take the above with a grain of salt, though; like I said, I've never used this tool, much less tried to compile it.)


Title: Re: Compiling KeyHunt_Cuda with gpu support
Post by: whanau on April 28, 2024, 11:02:55 PM
Thank you. ;D
That was the issue which is now resolved.
It compiled and ran first time.


Title: Re: Compiling KeyHunt_Cuda with gpu support
Post by: Vod on April 29, 2024, 12:08:47 AM
You should move this to tech support, in case others have the same problem.