Browse Source

The ccminer console output looks a bit more like cudaMiner now. 64 bit Windows compilation should no longer take "forever" but only "annoyingly long"

2upstream
Christian Buchner 10 years ago
parent
commit
ac40fac038
  1. 1
      ccminer.vcxproj
  2. 14
      cpu-miner.c
  3. 24
      heavy/heavy.cu

1
ccminer.vcxproj

@ -465,6 +465,7 @@ copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command> @@ -465,6 +465,7 @@ copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">-Xptxas "-abi=no -v" %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">-Xptxas "-abi=no -v" %(AdditionalOptions)</AdditionalOptions>
<MaxRegCount Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">128</MaxRegCount>
<MaxRegCount Condition="'$(Configuration)|$(Platform)'=='Release|x64'">128</MaxRegCount>
</CudaCompile>
<CudaCompile Include="x11\cuda_x11_simd512.cu">
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">-Xptxas "-abi=no -v" %(AdditionalOptions)</AdditionalOptions>

14
cpu-miner.c

@ -55,6 +55,7 @@ extern "C" @@ -55,6 +55,7 @@ extern "C"
{
#endif
int cuda_num_devices();
void cuda_devicenames();
int cuda_finddevice(char *name);
#ifdef __cplusplus
}
@ -170,6 +171,7 @@ bool opt_trust_pool = false; @@ -170,6 +171,7 @@ bool opt_trust_pool = false;
uint16_t opt_vote = 9999;
static int num_processors;
int device_map[8] = {0,1,2,3,4,5,6,7}; // CB
char *device_name[8]; // CB
static char *rpc_url;
static char *rpc_userpass;
static char *rpc_user, *rpc_pass;
@ -780,6 +782,7 @@ static void *miner_thread(void *userdata) @@ -780,6 +782,7 @@ static void *miner_thread(void *userdata)
unsigned char *scratchbuf = NULL;
char s[16];
int i;
static int rounds = 0;
memset(&work, 0, sizeof(work)); // prevent work from being used uninitialized
@ -914,6 +917,9 @@ static void *miner_thread(void *userdata) @@ -914,6 +917,9 @@ static void *miner_thread(void *userdata)
goto out;
}
if (opt_benchmark)
if (++rounds == 1) exit(0);
/* record scanhash elapsed time */
gettimeofday(&tv_end, NULL);
timeval_subtract(&diff, &tv_end, &tv_start);
@ -926,8 +932,10 @@ static void *miner_thread(void *userdata) @@ -926,8 +932,10 @@ static void *miner_thread(void *userdata)
if (!opt_quiet) {
sprintf(s, thr_hashrates[thr_id] >= 1e6 ? "%.0f" : "%.2f",
1e-3 * thr_hashrates[thr_id]);
applog(LOG_INFO, "thread %d: %lu hashes, %s khash/s",
thr_id, hashes_done, s);
applog(LOG_INFO, "GPU #%d: %s, %s khash/s",
device_map[thr_id], device_name[thr_id], s);
// applog(LOG_INFO, "thread %d: %lu hashes, %s khash/s",
// thr_id, hashes_done, s);
}
if (opt_benchmark && thr_id == opt_n_threads - 1) {
double hashrate = 0.;
@ -1491,6 +1499,8 @@ int main(int argc, char *argv[]) @@ -1491,6 +1499,8 @@ int main(int argc, char *argv[])
/* parse command line */
parse_cmdline(argc, argv);
cuda_devicenames();
if (!opt_benchmark && !rpc_url) {
fprintf(stderr, "%s: no URL supplied\n", argv[0]);
show_usage_and_exit(1);

24
heavy/heavy.cu

@ -164,6 +164,30 @@ extern "C" int cuda_num_devices() @@ -164,6 +164,30 @@ extern "C" int cuda_num_devices()
return GPU_N;
}
// Gerätenamen holen
extern char *device_name[8];
extern int device_map[8];
extern "C" void cuda_devicenames()
{
cudaError_t err;
int GPU_N;
err = cudaGetDeviceCount(&GPU_N);
if (err != cudaSuccess)
{
applog(LOG_ERR, "Unable to query number of CUDA devices! Is an nVidia driver installed?");
exit(1);
}
for (int i=0; i < GPU_N; i++)
{
cudaDeviceProp props;
cudaGetDeviceProperties(&props, device_map[i]);
device_name[i] = strdup(props.name);
}
}
static bool substringsearch(const char *haystack, const char *needle, int &match)
{
int hlen = strlen(haystack);

Loading…
Cancel
Save