Skip to content

Commit

Permalink
The ccminer console output looks a bit more like cudaMiner now. 64 bi…
Browse files Browse the repository at this point in the history
…t Windows compilation should no longer take "forever" but only "annoyingly long"
  • Loading branch information
cbuchner1 committed May 19, 2014
1 parent be5ba30 commit ac40fac
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
1 change: 1 addition & 0 deletions ccminer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
14 changes: 12 additions & 2 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ extern "C"
{
#endif
int cuda_num_devices();
void cuda_devicenames();
int cuda_finddevice(char *name);
#ifdef __cplusplus
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand All @@ -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.;
Expand Down Expand Up @@ -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);
Expand Down
24 changes: 24 additions & 0 deletions heavy/heavy.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ac40fac

Please sign in to comment.