Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ cd boost_1_86_0
./b2 debug release
sudo ./b2 install
```

gpu performance api:
```sh
wget https://github.com/GPUOpen-Tools/gpu_performance_api/releases/download/v4.3-tag/GPUPerfAPI-Linux-4.3.0.2.tgz
tar -xvf GPUPerfAPI-Linux-4.3.0.2.tgz
mv 4_4 gpu_performance_api
```

# Platforms

Expand Down
2 changes: 1 addition & 1 deletion sources/algo/ethash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (BUILD_EXE_UNIT_TEST)
)
endif()

if (BUILD_EXE_MINER)
if (BUILD_EXE_BENCHMARK)
target_sources(${BENCH_EXE} PUBLIC
${HEADERS}
${SOURCES}
Expand Down
19 changes: 17 additions & 2 deletions sources/benchmark/amd/kawpow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,27 @@
#include <benchmark/workflow.hpp>
#include <common/opencl/buffer_wrapper.hpp>
#include <common/opencl/buffer_mapped.hpp>
#include <common/custom.hpp>
#include <common/kernel_generator/opencl.hpp>
#include <common/custom.hpp>
#include <common/date.hpp>


bool benchmark::BenchmarkWorkflow::runAmdKawpow()
{
////////////////////////////////////////////////////////////////////////////
using namespace std::string_literals;

////////////////////////////////////////////////////////////////////////////

common::Dashboard dashboard{};
dashboard.setTitle("[AMD] KAWPOW");
dashboard.addColumn("Kernel");
dashboard.addColumn("Blocks");
dashboard.addColumn("Threads");
dashboard.addColumn("Hashrate");
dashboard.addColumn("Time");
dashboard.setDate(common::getDate());

////////////////////////////////////////////////////////////////////////////
bool dagInitialized{ false };
algo::hash256 const headerHash
Expand Down Expand Up @@ -189,7 +201,7 @@ bool benchmark::BenchmarkWorkflow::runAmdKawpow()
)
);
OPENCL_ER(propertiesAmd.clQueue.finish());
stopChrono(i);
stopChrono(i, dashboard);
}

return true;
Expand All @@ -212,6 +224,9 @@ bool benchmark::BenchmarkWorkflow::runAmdKawpow()
headerCache.free();
resultCache.free();

////////////////////////////////////////////////////////////////////////////
dashboards.emplace_back(dashboard);

////////////////////////////////////////////////////////////////////////////
return true;
}
Expand Down
41 changes: 40 additions & 1 deletion sources/benchmark/workflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ void benchmark::BenchmarkWorkflow::run()
runAmd();
}
#endif
for (auto dashboard : dashboards)
{
dashboard.show();
}
writeReport();
}

Expand Down Expand Up @@ -142,6 +146,42 @@ void benchmark::BenchmarkWorkflow::stopChrono(uint32_t const index)
}


void benchmark::BenchmarkWorkflow::stopChrono(
uint32_t const index,
common::Dashboard& dashboard)
{
////////////////////////////////////////////////////////////////////////////
stats.increaseKernelExecuted();
stats.stop();
stats.updateHashrate();
double const hashrate{ (stats.getHashrate() * multiplicator) / divisor };
logInfo() << currentBenchName << ": " << common::hashrateToString(hashrate);

////////////////////////////////////////////////////////////////////////////
benchmark::Snapshot snapshot{};
snapshot.deviceType = currentdeviceType;
snapshot.name = currentBenchName;
snapshot.threads = threads;
snapshot.blocks = blocks;
snapshot.perform = hashrate;

////////////////////////////////////////////////////////////////////////////
snapshots.emplace_back(snapshot);

////////////////////////////////////////////////////////////////////////////
dashboard.addLine
(
{
currentBenchName,
std::to_string(blocks),
std::to_string(threads),
common::hashrateToString(hashrate),
std::to_string(stats.getElapsed())
}
);
}


void benchmark::BenchmarkWorkflow::writeReport()
{
boost::json::object root{};
Expand Down Expand Up @@ -329,6 +369,5 @@ void benchmark::BenchmarkWorkflow::runAmd()
{
logErr() << "AMD kawpow failed";
}

}
#endif
3 changes: 3 additions & 0 deletions sources/benchmark/workflow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <benchmark/amd.hpp>
#include <benchmark/nvidia.hpp>
#include <benchmark/result.hpp>
#include <common/dashboard.hpp>
#include <device/type.hpp>
#include <statistical/statistical.hpp>

Expand Down Expand Up @@ -83,6 +84,7 @@ namespace benchmark
uint32_t divisor{ 1u };
statistical::Statistical stats{};
std::vector<benchmark::Snapshot> snapshots{};
std::vector<common::Dashboard> dashboards{};

void writeReport();

Expand All @@ -91,6 +93,7 @@ namespace benchmark
void setGrid(uint32_t const _threads, uint32_t _blocks);
void startChrono(std::string const& benchName);
void stopChrono(uint32_t const index);
void stopChrono(uint32_t const index, common::Dashboard& dashboard);

bool initCleanResult(t_result** result);
bool initCleanResult32(t_result_32** result);
Expand Down
7 changes: 4 additions & 3 deletions sources/common/dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ void common::Dashboard::setFooter(

void common::Dashboard::addColumn(std::string const& name)
{
Column col{ name, name.size() };
common::Dashboard::Column col{ name, name.size() };
columns.emplace_back(col);
}


void common::Dashboard::addLine(std::vector<std::string> const& line)
{
std::vector<Line> data;
std::vector<common::Dashboard::Line> data;
for (auto const& value : line)
{
Line l{ value, value.size() };
common::Dashboard::Line l{ value, value.size() };
logInfo() << "line: " << l.value;
data.emplace_back(std::move(l));
}
lines.emplace_back(data);
Expand Down
2 changes: 2 additions & 0 deletions sources/device/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ namespace device
#endif
UNKNOWN
};

constexpr uint8_t MAX_DEVICE_TYPE{ 2 };
}
Loading