mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-22 02:34:58 +00:00
Allow use of the previous CUDA plugin version with a warning.
This commit is contained in:
parent
0229c65232
commit
16ecb8f085
5 changed files with 26 additions and 18 deletions
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2024 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,7 +22,6 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "backend/cuda/runners/CudaRxRunner.h"
|
#include "backend/cuda/runners/CudaRxRunner.h"
|
||||||
#include "backend/cuda/CudaLaunchData.h"
|
#include "backend/cuda/CudaLaunchData.h"
|
||||||
#include "backend/cuda/wrappers/CudaLib.h"
|
#include "backend/cuda/wrappers/CudaLib.h"
|
||||||
|
@ -59,7 +58,7 @@ bool xmrig::CudaRxRunner::set(const Job &job, uint8_t *blob)
|
||||||
m_seed = job.seed();
|
m_seed = job.seed();
|
||||||
|
|
||||||
if (m_ready) {
|
if (m_ready) {
|
||||||
auto dataset = Rx::dataset(job, 0);
|
const auto *dataset = Rx::dataset(job, 0);
|
||||||
callWrapper(CudaLib::rxUpdateDataset(m_ctx, dataset->raw(), dataset->size(false)));
|
callWrapper(CudaLib::rxUpdateDataset(m_ctx, dataset->raw(), dataset->size(false)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +68,7 @@ bool xmrig::CudaRxRunner::set(const Job &job, uint8_t *blob)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dataset = Rx::dataset(job, 0);
|
const auto *dataset = Rx::dataset(job, 0);
|
||||||
m_ready = callWrapper(CudaLib::rxPrepare(m_ctx, dataset->raw(), dataset->size(false), m_datasetHost, m_intensity));
|
m_ready = callWrapper(CudaLib::rxPrepare(m_ctx, dataset->raw(), dataset->size(false), m_datasetHost, m_intensity));
|
||||||
|
|
||||||
return m_ready;
|
return m_ready;
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
* Copyright 2018-2024 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
|
||||||
#include "backend/cuda/wrappers/CudaLib.h"
|
#include "backend/cuda/wrappers/CudaLib.h"
|
||||||
#include "base/io/Env.h"
|
#include "base/io/Env.h"
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
|
#include "base/io/log/Tags.h"
|
||||||
#include "base/kernel/Process.h"
|
#include "base/kernel/Process.h"
|
||||||
#include "crypto/rx/RxAlgo.h"
|
#include "crypto/rx/RxAlgo.h"
|
||||||
|
|
||||||
|
@ -205,13 +205,23 @@ bool xmrig::CudaLib::rxHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t target,
|
||||||
|
|
||||||
bool xmrig::CudaLib::rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, bool dataset_host, uint32_t batchSize) noexcept
|
bool xmrig::CudaLib::rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, bool dataset_host, uint32_t batchSize) noexcept
|
||||||
{
|
{
|
||||||
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
|
if (!pRxUpdateDataset) {
|
||||||
|
LOG_WARN("%s" YELLOW_BOLD("CUDA plugin is outdated. Please update to the latest version"), Tags::randomx());
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
return pRxPrepare(ctx, dataset, datasetSize, dataset_host, batchSize);
|
return pRxPrepare(ctx, dataset, datasetSize, dataset_host, batchSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool xmrig::CudaLib::rxUpdateDataset(nvid_ctx* ctx, const void* dataset, size_t datasetSize) noexcept
|
bool xmrig::CudaLib::rxUpdateDataset(nvid_ctx *ctx, const void *dataset, size_t datasetSize) noexcept
|
||||||
{
|
{
|
||||||
return pRxUpdateDataset(ctx, dataset, datasetSize);
|
if (pRxUpdateDataset) {
|
||||||
|
return pRxUpdateDataset(ctx, dataset, datasetSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -397,7 +407,6 @@ void xmrig::CudaLib::load()
|
||||||
DLSYM(Release);
|
DLSYM(Release);
|
||||||
DLSYM(RxHash);
|
DLSYM(RxHash);
|
||||||
DLSYM(RxPrepare);
|
DLSYM(RxPrepare);
|
||||||
DLSYM(RxUpdateDataset);
|
|
||||||
DLSYM(KawPowHash);
|
DLSYM(KawPowHash);
|
||||||
DLSYM(KawPowPrepare_v2);
|
DLSYM(KawPowPrepare_v2);
|
||||||
DLSYM(KawPowStopHash);
|
DLSYM(KawPowStopHash);
|
||||||
|
@ -411,5 +420,7 @@ void xmrig::CudaLib::load()
|
||||||
DLSYM(SetJob_v2);
|
DLSYM(SetJob_v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uv_dlsym(&cudaLib, kRxUpdateDataset, reinterpret_cast<void**>(&pRxUpdateDataset));
|
||||||
|
|
||||||
pInit();
|
pInit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
* Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright (c) 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -71,7 +71,7 @@ public:
|
||||||
static bool deviceInit(nvid_ctx *ctx) noexcept;
|
static bool deviceInit(nvid_ctx *ctx) noexcept;
|
||||||
static bool rxHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t target, uint32_t *rescount, uint32_t *resnonce) noexcept;
|
static bool rxHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t target, uint32_t *rescount, uint32_t *resnonce) noexcept;
|
||||||
static bool rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, bool dataset_host, uint32_t batchSize) noexcept;
|
static bool rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, bool dataset_host, uint32_t batchSize) noexcept;
|
||||||
static bool rxUpdateDataset(nvid_ctx* ctx, const void* dataset, size_t datasetSize) noexcept;
|
static bool rxUpdateDataset(nvid_ctx *ctx, const void *dataset, size_t datasetSize) noexcept;
|
||||||
static bool kawPowHash(nvid_ctx *ctx, uint8_t* job_blob, uint64_t target, uint32_t *rescount, uint32_t *resnonce, uint32_t *skipped_hashes) noexcept;
|
static bool kawPowHash(nvid_ctx *ctx, uint8_t* job_blob, uint64_t target, uint32_t *rescount, uint32_t *resnonce, uint32_t *skipped_hashes) noexcept;
|
||||||
static bool kawPowPrepare(nvid_ctx *ctx, const void* cache, size_t cache_size, const void* dag_precalc, size_t dag_size, uint32_t height, const uint64_t* dag_sizes) noexcept;
|
static bool kawPowPrepare(nvid_ctx *ctx, const void* cache, size_t cache_size, const void* dag_precalc, size_t dag_size, uint32_t height, const uint64_t* dag_sizes) noexcept;
|
||||||
static bool kawPowStopHash(nvid_ctx *ctx) noexcept;
|
static bool kawPowStopHash(nvid_ctx *ctx) noexcept;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* XMRig
|
/* XMRig
|
||||||
* Copyright (c) 2018-2019 tevador <tevador@gmail.com>
|
* Copyright (c) 2018-2019 tevador <tevador@gmail.com>
|
||||||
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
|
* Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh>
|
||||||
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
* Copyright (c) 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -17,9 +17,7 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "crypto/rx/RxBasicStorage.h"
|
#include "crypto/rx/RxBasicStorage.h"
|
||||||
#include "backend/common/Tags.h"
|
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
#include "base/io/log/Tags.h"
|
#include "base/io/log/Tags.h"
|
||||||
#include "base/tools/Chrono.h"
|
#include "base/tools/Chrono.h"
|
||||||
|
|
Loading…
Reference in a new issue