Skip to content

Commit

Permalink
Merge pull request #2570 from fireice-uk/xmr-stak-rx-dev
Browse files Browse the repository at this point in the history
xmr-stak-rx 1.0.1 release
  • Loading branch information
psychocrypt authored Nov 26, 2019
2 parents 90c8ebd + e46dfe6 commit 7a9361b
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 54 deletions.
19 changes: 10 additions & 9 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# image
image: Visual Studio 2015
image: Visual Studio 2017

# build platform
platform: x64
Expand All @@ -9,25 +9,26 @@ clone_folder: c:\xmr-stak

install:
- mkdir c:\xmr-stak-dep
- curl -sL https://github.com/fireice-uk/xmr-stak-dep/releases/download/v1/xmr-stak-dep.zip -o xmr-stak-dep.zip
- 7z x xmr-stak-dep.zip -o"c:\xmr-stak-dep" -y > nul
- appveyor DownloadFile https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_windows-exe -FileName cuda_8.0.44_windows.exe
- cuda_8.0.44_windows.exe -s compiler_8.0 cudart_8.0 nvrtc_8.0 nvrtc_dev_8.0
- set PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp;%PATH%
- curl -sL https://github.com/fireice-uk/xmr-stak-dep/releases/download/v2/xmr-stak-dep.zip -o xmr-stak-dep.zip
- 7z x xmr-stak-dep.zip -o"c:\" -y > nul
- dir c:\xmr-stak-dep
- appveyor DownloadFile "https://developer.nvidia.com/compute/cuda/10.1/Prod/network_installers/cuda_10.1.105_win10_network.exe" -FileName install_cuda.exe
- install_cuda.exe -s nvcc_10.1 cudart_10.1
- set PATH=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;%PATH%
- nvcc -V

build_script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsMSBuildCmd.bat"
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
- cd c:\xmr-stak
- mkdir build
- cd build
- set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl;
- cmake -G "Visual Studio 14 2015 Win64" -T v140,host=x64 .. -DCUDA_ARCH=30
- cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 .. -DCUDA_ARCH=35
- cmake --build . --config Release --target install

test_script:
- cd c:\xmr-stak\build\bin\Release
- dir
- copy C:\xmr-stak-dep\openssl\bin\* .
- set XMRSTAK_NOWAIT=1
- xmr-stak.exe --help --noUAC
- xmr-stak-rx.exe --help --noUAC
42 changes: 21 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ language: cpp
cache:
apt: true
directories:
- $HOME/.cache/cuda
- $HOME/.cache/cuda9

addons:
apt:
Expand All @@ -21,25 +21,25 @@ addons:

env:
global:
- CUDA_ROOT: $HOME/.cache/cuda
- CUDA_ROOT: $HOME/.cache/cuda9

matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *default_packages
- gcc-5
- g++-5
env:
- CMAKE_CXX_COMPILER=g++-5
- CMAKE_C_COMPILER=gcc-5
- XMRSTAK_CMAKE_FLAGS="-DCUDA_ARCH=30 -DOpenCL_ENABLE=OFF"

# - os: linux
# compiler: gcc
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - *default_packages
# - gcc-5
# - g++-5
# env:
# - CMAKE_CXX_COMPILER=g++-5
# - CMAKE_C_COMPILER=gcc-5
# - XMRSTAK_CMAKE_FLAGS="-DCUDA_ARCH=30 -DOpenCL_ENABLE=OFF"
#
- os: linux
compiler: gcc
addons:
Expand Down Expand Up @@ -106,11 +106,11 @@ install:
if [ $NVCC_FOUND -ne 0 ]; then
mkdir -p $CUDA_ROOT &&
cd $CUDA_ROOT &&
travis_retry wget https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run &&
travis_retry wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run &&
ls -la &&
chmod u+x *-run &&
./cuda_8.0.44_linux-run --silent --toolkit --toolkitpath=$CUDA_ROOT &&
rm -rf ./cuda_8.0.44_linux-run $CUDA_ROOT/{samples,jre,doc,share} &&
./cuda_9.0.176_384.81_linux-run --silent --toolkit --toolkitpath=$CUDA_ROOT &&
rm -rf ./cuda_9.0.176_384.81_linux-run $CUDA_ROOT/{samples,jre,doc,share} &&
cd -;
fi
fi;
Expand All @@ -123,4 +123,4 @@ script:
cmake -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} ${XMRSTAK_CMAKE_FLAGS} .;
fi;
- make VERBOSE=1 install
- ./bin/xmr-stak --help
- ./bin/xmr-stak-rx --help
1 change: 1 addition & 0 deletions xmrstak/backend/cpu/crypto/cryptonight_aesni.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ struct RandomX_generator
}
else if(algorithm_switched)
{
printer::inst()->print_msg(LDEBUG,"%s switched to %s",ctx[0]->last_algo.Name().c_str(), POW(ALGO).Name().c_str());
// remove old vm and re-initialize the full randomx context
for(size_t i = 0; i < N; i++)
{
Expand Down
20 changes: 19 additions & 1 deletion xmrstak/backend/cpu/hwlocMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@

#include <hwloc.h>

static __hwloc_inline int
xmrstak_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
{
#if HWLOC_API_VERSION >= 0x20000
return hwloc_set_membind(
topology,
nodeset,
policy,
flags| HWLOC_MEMBIND_BYNODESET);
#else
return hwloc_set_membind_nodeset(
topology,
nodeset,
policy,
flags);
#endif
}

/** pin memory to NUMA node
*
* Set the default memory policy for the current thread to bind memory to the
Expand Down Expand Up @@ -37,7 +55,7 @@ void bindMemoryToNUMANode(size_t puId)
hwloc_obj_t pu = hwloc_get_obj_by_depth(topology, depth, i);
if(pu->os_index == puId)
{
if(0 > hwloc_set_membind_nodeset(
if(0 > xmrstak_set_membind_nodeset(
topology,
pu->nodeset,
HWLOC_MEMBIND_BIND,
Expand Down
12 changes: 3 additions & 9 deletions xmrstak/backend/cpu/minethd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ bool minethd::self_test()
xmrstak::globalStates::inst().iThreadCount = 1;
if(algo == POW(randomX))
{
printer::inst()->print_msg(L0, "start self test for 'randomx'");
printer::inst()->print_msg(L0, "start self test for 'randomx' (can be disabled with the command line option '--noTest')");
minethd::cn_on_new_job set_job;
func_multi_selector<1>(ctx, set_job, ::jconf::inst()->HaveHardwareAes(), algo);
miner_work work;
Expand All @@ -295,7 +295,7 @@ bool minethd::self_test()
}
else if(algo == POW(randomX_loki))
{
printer::inst()->print_msg(L0, "start self test for 'randomx_loki'");
printer::inst()->print_msg(L0, "start self test for 'randomx_loki' (can be disabled with the command line option '--noTest')");
minethd::cn_on_new_job set_job;
func_multi_selector<1>(ctx, set_job, ::jconf::inst()->HaveHardwareAes(), algo);
miner_work work;
Expand All @@ -307,7 +307,7 @@ bool minethd::self_test()
}
else if(algo == POW(randomX_wow))
{
printer::inst()->print_msg(L0, "start self test for 'randomx_wow'");
printer::inst()->print_msg(L0, "start self test for 'randomx_wow' (can be disabled with the command line option '--noTest')");
minethd::cn_on_new_job set_job;
func_multi_selector<1>(ctx, set_job, ::jconf::inst()->HaveHardwareAes(), algo);
miner_work work;
Expand Down Expand Up @@ -480,12 +480,6 @@ void minethd::func_multi_selector(cryptonight_ctx** ctx, minethd::cn_on_new_job&
on_new_job = nullptr;
}

void minethd::func_selector(cryptonight_ctx** ctx, bool bHaveAes, const xmrstak_algo& algo)
{
minethd::cn_on_new_job dm;
func_multi_selector<1>(ctx, dm, bHaveAes, algo); // for testing us eauto, must be removed before the release
}

void minethd::work_main()
{
multiway_work_main<1u>();
Expand Down
1 change: 0 additions & 1 deletion xmrstak/backend/cpu/minethd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class minethd : public iBackend

typedef void (*cn_on_new_job)(const miner_work&, cryptonight_ctx**);

static void func_selector(cryptonight_ctx**, bool bHaveAes, const xmrstak_algo& algo);
static bool thd_setaffinity(std::thread::native_handle_type h, uint64_t cpu_id);

static cryptonight_ctx* minethd_alloc_ctx();
Expand Down
7 changes: 6 additions & 1 deletion xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)
hashMemSize = std::max(hashMemSize, algo.Mem());
}

const size_t dataset_size = getRandomXDatasetSize();
/* increase maxMemUsage by the dataset because the upper limits are
* only for the scratchpad and does not take the randomX dataset into account.
*/
maxMemUsage += dataset_size;

#ifdef WIN32
/* We use in windows bfactor (split slow kernel into smaller parts) to avoid
* that windows is killing long running kernel.
Expand All @@ -346,7 +352,6 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)
size_t availableMem = freeMemory - (128u * byteToMiB) - 200u;
size_t limitedMemory = std::min(availableMem, maxMemUsage);

const size_t dataset_size = getRandomXDatasetSize();
if(limitedMemory <= dataset_size)
limitedMemory = 0;
else
Expand Down
18 changes: 12 additions & 6 deletions xmrstak/cli/cli-miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void do_guided_pool_config()
configTpl.set(std::string(tpl));
bool prompted = false;

auto& currency = params::inst().currency;
auto currency = params::inst().currency;
if(currency.empty() || !jconf::IsOnAlgoList(currency))
{
prompt_once(prompted);
Expand All @@ -236,7 +236,7 @@ void do_guided_pool_config()
currency = tmp;
}

auto& pool = params::inst().poolURL;
auto pool = params::inst().poolURL;
bool userSetPool = true;
if(pool.empty())
{
Expand All @@ -247,7 +247,7 @@ void do_guided_pool_config()
std::cin >> pool;
}

auto& userName = params::inst().poolUsername;
auto userName = params::inst().poolUsername;
if(userName.empty())
{
prompt_once(prompted);
Expand All @@ -257,7 +257,7 @@ void do_guided_pool_config()
}

bool stdin_flushed = false;
auto& passwd = params::inst().poolPasswd;
auto passwd = params::inst().poolPasswd;
if(passwd.empty() && !params::inst().userSetPwd)
{
prompt_once(prompted);
Expand All @@ -271,7 +271,7 @@ void do_guided_pool_config()
getline(std::cin, passwd);
}

auto& rigid = params::inst().poolRigid;
auto rigid = params::inst().poolRigid;
if(rigid.empty() && !params::inst().userSetRigid)
{
if(!use_simple_start())
Expand Down Expand Up @@ -366,7 +366,7 @@ void do_guided_config()
configTpl.set(std::string(tpl));
bool prompted = false;

auto& http_port = params::inst().httpd_port;
auto http_port = params::inst().httpd_port;
if(http_port == params::httpd_port_unset)
{
http_port = params::httpd_port_disabled;
Expand Down Expand Up @@ -943,6 +943,12 @@ int do_benchmark(int block_version, int wait_sec, int work_sec)

printer::inst()->print_msg(L0, "Prepare benchmark for block version %d", block_version);

if(block_version <= 0)
{
printer::inst()->print_msg(L0, "Block version must be >0, current value is %u.", block_version);
return 1;
}

uint8_t work[128];
memset(work, 0, 128);
work[0] = static_cast<uint8_t>(block_version);
Expand Down
7 changes: 5 additions & 2 deletions xmrstak/jconf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,13 @@ configVal oConfigValues[] = {
constexpr size_t iConfigCnt = (sizeof(oConfigValues) / sizeof(oConfigValues[0]));

xmrstak::coin_selection coins[] = {
// name, userpool, devpool, default_pool_suggestion
// name, userpool, default_pool_suggestion
{"loki", {POW(randomX_loki)}, {POW(randomX_loki)}, nullptr},
{"monero", {POW(randomX)}, {POW(randomX)}, nullptr},
{"randomx", {POW(randomX)}, {POW(randomX)}, nullptr},
{"randomx_loki", {POW(randomX_loki)}, {POW(randomX_loki)}, nullptr},
{"randomx_wow", {POW(randomX_wow)}, {POW(randomX_wow)}, nullptr}
{"randomx_wow", {POW(randomX_wow)}, {POW(randomX_wow)}, nullptr},
{"wownero", {POW(randomX_wow)}, {POW(randomX_wow)}, nullptr}
};

constexpr size_t coin_algo_size = (sizeof(coins) / sizeof(coins[0]));
Expand Down
3 changes: 2 additions & 1 deletion xmrstak/misc/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ void executor::ex_main()
const char* rigid = params.userSetRigid ? params.poolRigid.c_str() : cfg.sRigId;
const char* pwd = params.userSetPwd ? params.poolPasswd.c_str() : cfg.sPasswd;
bool nicehash = cfg.nicehash || params.nicehashMode;
bool tls = params.poolUseTls;

pools.emplace_back(i, cfg.sPoolAddr, wallet, rigid, pwd, 9.9, params.poolUseTls, cfg.tls_fingerprint, nicehash);
pools.emplace_back(i, cfg.sPoolAddr, wallet, rigid, pwd, 9.9, tls, cfg.tls_fingerprint, nicehash);
}
else
pools.emplace_back(i, cfg.sPoolAddr, cfg.sWalletAddr, cfg.sRigId, cfg.sPasswd, cfg.weight, cfg.tls, cfg.tls_fingerprint, cfg.nicehash);
Expand Down
1 change: 0 additions & 1 deletion xmrstak/net/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class callback_holder
bool set_socket_error(const char*, size_t len) { return true; }
bool set_socket_error(const char*) { return true; }
const char* get_tls_fp() { return ""; }
bool is_dev_pool() { false; }
const char* get_pool_addr() { return "";} ;
};

Expand Down
2 changes: 1 addition & 1 deletion xmrstak/pools.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ POOLCONF],
*
* loki
* monero
* wow
* wownero
*
* Native algorithms which do not depend on any block versions:
*
Expand Down
2 changes: 1 addition & 1 deletion xmrstak/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#endif

#define XMR_STAK_NAME "xmr-stak-rx"
#define XMR_STAK_VERSION "1.0.0-rx"
#define XMR_STAK_VERSION "1.0.1-rx"

#if defined(_WIN32)
#define OS_TYPE "win"
Expand Down

0 comments on commit 7a9361b

Please sign in to comment.