diff --git a/src/3rdparty/libethash/ethash_internal.c b/src/3rdparty/libethash/ethash_internal.c index 6f9aac47c..586a77fc7 100644 --- a/src/3rdparty/libethash/ethash_internal.c +++ b/src/3rdparty/libethash/ethash_internal.c @@ -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); diff --git a/src/backend/opencl/wrappers/AdlLib_linux.cpp b/src/backend/opencl/wrappers/AdlLib_linux.cpp index 7dbb1ea2a..b297ec719 100644 --- a/src/backend/opencl/wrappers/AdlLib_linux.cpp +++ b/src/backend/opencl/wrappers/AdlLib_linux.cpp @@ -1,6 +1,7 @@ /* XMRig * Copyright 2008-2018 Advanced Micro Devices, Inc. * Copyright 2018-2020 SChernykh + * Copyright 2020 Patrick Bollinger * Copyright 2016-2020 XMRig , * * 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; }