This commit is contained in:
Dobromir Popov
2025-09-07 15:03:47 +03:00
parent 00cda24e71
commit 2d2653551b
132 changed files with 34281 additions and 5 deletions

View File

@@ -31,3 +31,7 @@ target_compile_options(rinhash-gpu-miner PRIVATE -O3 -march=native)
# Install target
install(TARGETS rinhash-gpu-miner DESTINATION bin)

View File

@@ -177,7 +177,7 @@ extern "C" void rinhash_hip_batch(const uint8_t* input_template, size_t input_le
if (!persistent_memory_initialized || batch_size > persistent_max_batch) {
// Free old memory if we're expanding
if (persistent_memory_initialized) {
printf("RinHashGPU: Expanding memory from %u to %u nonces\n", persistent_max_batch, batch_size);
// printf("RinHashGPU: Expanding memory from %u to %u nonces\n", persistent_max_batch, batch_size);
hipFree(d_input_persistent);
hipFree(d_output_persistent);
hipFree(d_memory_persistent);
@@ -197,14 +197,14 @@ extern "C" void rinhash_hip_batch(const uint8_t* input_template, size_t input_le
// Allocate PERSISTENT buffers with headroom
err = hipMalloc(&d_input_persistent, input_size);
if (err != hipSuccess) {
fprintf(stderr, "HIP error: Failed to allocate persistent input (%zu MB): %s\n", input_size / (1024*1024), hipGetErrorString(err));
// fprintf(stderr, "HIP error: Failed to allocate persistent input (%zu MB): %s\n", input_size / (1024*1024), hipGetErrorString(err));
persistent_memory_initialized = false;
return;
}
err = hipMalloc(&d_output_persistent, output_size);
if (err != hipSuccess) {
fprintf(stderr, "HIP error: Failed to allocate persistent output (%zu MB): %s\n", output_size / (1024*1024), hipGetErrorString(err));
// fprintf(stderr, "HIP error: Failed to allocate persistent output (%zu MB): %s\n", output_size / (1024*1024), hipGetErrorString(err));
hipFree(d_input_persistent);
persistent_memory_initialized = false;
return;
@@ -212,7 +212,7 @@ extern "C" void rinhash_hip_batch(const uint8_t* input_template, size_t input_le
err = hipMalloc(&d_memory_persistent, memory_size);
if (err != hipSuccess) {
fprintf(stderr, "HIP error: Failed to allocate persistent Argon2 memory (%zu MB): %s\n", memory_size / (1024*1024), hipGetErrorString(err));
// fprintf(stderr, "HIP error: Failed to allocate persistent Argon2 memory (%zu MB): %s\n", memory_size / (1024*1024), hipGetErrorString(err));
hipFree(d_input_persistent);
hipFree(d_output_persistent);
persistent_memory_initialized = false;
@@ -220,7 +220,7 @@ extern "C" void rinhash_hip_batch(const uint8_t* input_template, size_t input_le
}
persistent_memory_initialized = true;
printf("RinHashGPU: PERSISTENT MEMORY initialized - NO MORE ALLOCATIONS until expansion needed!\n");
// printf("RinHashGPU: PERSISTENT MEMORY initialized - NO MORE ALLOCATIONS until expansion needed!\n");
}
// Prepare batch input data on host