mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-22 18:54:43 +00:00
#1754 Fixed GPU health readings for pre Vega GPUs.
This commit is contained in:
parent
ccfbba94f2
commit
bf32802a82
2 changed files with 9 additions and 3 deletions
4
src/3rdparty/libethash/ethash_internal.c
vendored
4
src/3rdparty/libethash/ethash_internal.c
vendored
|
@ -187,7 +187,7 @@ void ethash_calculate_dag_item4_opt(
|
|||
ethash_light_t const light
|
||||
)
|
||||
{
|
||||
node const* cache_nodes = (node const*)light->cache;
|
||||
node const* cache_nodes = (node const*)light->cache;
|
||||
|
||||
for (size_t i = 0; i < 4; ++i) {
|
||||
node const* init = &cache_nodes[fast_mod(node_index + i, light->num_parent_nodes, light->reciprocal, light->increment, light->shift)];
|
||||
|
@ -197,7 +197,7 @@ void ethash_calculate_dag_item4_opt(
|
|||
}
|
||||
|
||||
for (uint32_t i = 0; i != num_parents; ++i) {
|
||||
node* parent[4];
|
||||
node const* parent[4];
|
||||
|
||||
for (uint32_t j = 0; j < 4; ++j) {
|
||||
const uint32_t parent_index = fast_mod(fnv_hash((node_index + j) ^ i, ret[j].words[i % NODE_WORDS]), light->num_parent_nodes, light->reciprocal, light->increment, light->shift);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* XMRig
|
||||
* Copyright 2008-2018 Advanced Micro Devices, Inc.
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2020 Patrick Bollinger <https://github.com/pjbollinger>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
|
@ -82,7 +83,7 @@ static inline std::string sysfs_prefix(const PciTopology &topology)
|
|||
|
||||
for (uint32_t i = 1; i < 10; ++i) {
|
||||
const std::string prefix = path + std::to_string(i) + "/";
|
||||
if (sysfs_is_amdgpu(prefix + "name") && sysfs_read(prefix + "freq1_input")) {
|
||||
if (sysfs_is_amdgpu(prefix + "name") && (sysfs_read(prefix + "temp1_input") || sysfs_read(prefix + "power1_average"))) {
|
||||
return prefix;
|
||||
}
|
||||
}
|
||||
|
@ -116,6 +117,7 @@ void xmrig::AdlLib::close()
|
|||
}
|
||||
|
||||
|
||||
// https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
|
||||
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
|
||||
{
|
||||
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
|
||||
|
@ -134,6 +136,10 @@ AdlHealth xmrig::AdlLib::health(const OclDevice &device)
|
|||
health.rpm = sysfs_read(prefix + "fan1_input");
|
||||
health.temperature = sysfs_read(prefix + "temp2_input") / 1000;
|
||||
|
||||
if (!health.temperature) {
|
||||
health.temperature = sysfs_read(prefix + "temp1_input") / 1000;
|
||||
}
|
||||
|
||||
return health;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue