Skip to content

Commit 7a9361b

Browse files
authored
Merge pull request #2570 from fireice-uk/xmr-stak-rx-dev
xmr-stak-rx 1.0.1 release
2 parents 90c8ebd + e46dfe6 commit 7a9361b

File tree

13 files changed

+81
-54
lines changed

13 files changed

+81
-54
lines changed

.appveyor.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# image
2-
image: Visual Studio 2015
2+
image: Visual Studio 2017
33

44
# build platform
55
platform: x64
@@ -9,25 +9,26 @@ clone_folder: c:\xmr-stak
99

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

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

2829
test_script:
2930
- cd c:\xmr-stak\build\bin\Release
3031
- dir
3132
- copy C:\xmr-stak-dep\openssl\bin\* .
3233
- set XMRSTAK_NOWAIT=1
33-
- xmr-stak.exe --help --noUAC
34+
- xmr-stak-rx.exe --help --noUAC

.travis.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ language: cpp
99
cache:
1010
apt: true
1111
directories:
12-
- $HOME/.cache/cuda
12+
- $HOME/.cache/cuda9
1313

1414
addons:
1515
apt:
@@ -21,25 +21,25 @@ addons:
2121

2222
env:
2323
global:
24-
- CUDA_ROOT: $HOME/.cache/cuda
24+
- CUDA_ROOT: $HOME/.cache/cuda9
2525

2626
matrix:
2727
include:
28-
- os: linux
29-
compiler: gcc
30-
addons:
31-
apt:
32-
sources:
33-
- ubuntu-toolchain-r-test
34-
packages:
35-
- *default_packages
36-
- gcc-5
37-
- g++-5
38-
env:
39-
- CMAKE_CXX_COMPILER=g++-5
40-
- CMAKE_C_COMPILER=gcc-5
41-
- XMRSTAK_CMAKE_FLAGS="-DCUDA_ARCH=30 -DOpenCL_ENABLE=OFF"
42-
28+
# - os: linux
29+
# compiler: gcc
30+
# addons:
31+
# apt:
32+
# sources:
33+
# - ubuntu-toolchain-r-test
34+
# packages:
35+
# - *default_packages
36+
# - gcc-5
37+
# - g++-5
38+
# env:
39+
# - CMAKE_CXX_COMPILER=g++-5
40+
# - CMAKE_C_COMPILER=gcc-5
41+
# - XMRSTAK_CMAKE_FLAGS="-DCUDA_ARCH=30 -DOpenCL_ENABLE=OFF"
42+
#
4343
- os: linux
4444
compiler: gcc
4545
addons:
@@ -106,11 +106,11 @@ install:
106106
if [ $NVCC_FOUND -ne 0 ]; then
107107
mkdir -p $CUDA_ROOT &&
108108
cd $CUDA_ROOT &&
109-
travis_retry wget https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda_8.0.44_linux-run &&
109+
travis_retry wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run &&
110110
ls -la &&
111111
chmod u+x *-run &&
112-
./cuda_8.0.44_linux-run --silent --toolkit --toolkitpath=$CUDA_ROOT &&
113-
rm -rf ./cuda_8.0.44_linux-run $CUDA_ROOT/{samples,jre,doc,share} &&
112+
./cuda_9.0.176_384.81_linux-run --silent --toolkit --toolkitpath=$CUDA_ROOT &&
113+
rm -rf ./cuda_9.0.176_384.81_linux-run $CUDA_ROOT/{samples,jre,doc,share} &&
114114
cd -;
115115
fi
116116
fi;
@@ -123,4 +123,4 @@ script:
123123
cmake -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} ${XMRSTAK_CMAKE_FLAGS} .;
124124
fi;
125125
- make VERBOSE=1 install
126-
- ./bin/xmr-stak --help
126+
- ./bin/xmr-stak-rx --help

xmrstak/backend/cpu/crypto/cryptonight_aesni.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ struct RandomX_generator
167167
}
168168
else if(algorithm_switched)
169169
{
170+
printer::inst()->print_msg(LDEBUG,"%s switched to %s",ctx[0]->last_algo.Name().c_str(), POW(ALGO).Name().c_str());
170171
// remove old vm and re-initialize the full randomx context
171172
for(size_t i = 0; i < N; i++)
172173
{

xmrstak/backend/cpu/hwlocMemory.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66

77
#include <hwloc.h>
88

9+
static __hwloc_inline int
10+
xmrstak_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
11+
{
12+
#if HWLOC_API_VERSION >= 0x20000
13+
return hwloc_set_membind(
14+
topology,
15+
nodeset,
16+
policy,
17+
flags| HWLOC_MEMBIND_BYNODESET);
18+
#else
19+
return hwloc_set_membind_nodeset(
20+
topology,
21+
nodeset,
22+
policy,
23+
flags);
24+
#endif
25+
}
26+
927
/** pin memory to NUMA node
1028
*
1129
* Set the default memory policy for the current thread to bind memory to the
@@ -37,7 +55,7 @@ void bindMemoryToNUMANode(size_t puId)
3755
hwloc_obj_t pu = hwloc_get_obj_by_depth(topology, depth, i);
3856
if(pu->os_index == puId)
3957
{
40-
if(0 > hwloc_set_membind_nodeset(
58+
if(0 > xmrstak_set_membind_nodeset(
4159
topology,
4260
pu->nodeset,
4361
HWLOC_MEMBIND_BIND,

xmrstak/backend/cpu/minethd.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ bool minethd::self_test()
283283
xmrstak::globalStates::inst().iThreadCount = 1;
284284
if(algo == POW(randomX))
285285
{
286-
printer::inst()->print_msg(L0, "start self test for 'randomx'");
286+
printer::inst()->print_msg(L0, "start self test for 'randomx' (can be disabled with the command line option '--noTest')");
287287
minethd::cn_on_new_job set_job;
288288
func_multi_selector<1>(ctx, set_job, ::jconf::inst()->HaveHardwareAes(), algo);
289289
miner_work work;
@@ -295,7 +295,7 @@ bool minethd::self_test()
295295
}
296296
else if(algo == POW(randomX_loki))
297297
{
298-
printer::inst()->print_msg(L0, "start self test for 'randomx_loki'");
298+
printer::inst()->print_msg(L0, "start self test for 'randomx_loki' (can be disabled with the command line option '--noTest')");
299299
minethd::cn_on_new_job set_job;
300300
func_multi_selector<1>(ctx, set_job, ::jconf::inst()->HaveHardwareAes(), algo);
301301
miner_work work;
@@ -307,7 +307,7 @@ bool minethd::self_test()
307307
}
308308
else if(algo == POW(randomX_wow))
309309
{
310-
printer::inst()->print_msg(L0, "start self test for 'randomx_wow'");
310+
printer::inst()->print_msg(L0, "start self test for 'randomx_wow' (can be disabled with the command line option '--noTest')");
311311
minethd::cn_on_new_job set_job;
312312
func_multi_selector<1>(ctx, set_job, ::jconf::inst()->HaveHardwareAes(), algo);
313313
miner_work work;
@@ -480,12 +480,6 @@ void minethd::func_multi_selector(cryptonight_ctx** ctx, minethd::cn_on_new_job&
480480
on_new_job = nullptr;
481481
}
482482

483-
void minethd::func_selector(cryptonight_ctx** ctx, bool bHaveAes, const xmrstak_algo& algo)
484-
{
485-
minethd::cn_on_new_job dm;
486-
func_multi_selector<1>(ctx, dm, bHaveAes, algo); // for testing us eauto, must be removed before the release
487-
}
488-
489483
void minethd::work_main()
490484
{
491485
multiway_work_main<1u>();

xmrstak/backend/cpu/minethd.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class minethd : public iBackend
2424

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

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

3029
static cryptonight_ctx* minethd_alloc_ctx();

xmrstak/backend/nvidia/nvcc_code/cuda_extra.cu

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)
322322
hashMemSize = std::max(hashMemSize, algo.Mem());
323323
}
324324

325+
const size_t dataset_size = getRandomXDatasetSize();
326+
/* increase maxMemUsage by the dataset because the upper limits are
327+
* only for the scratchpad and does not take the randomX dataset into account.
328+
*/
329+
maxMemUsage += dataset_size;
330+
325331
#ifdef WIN32
326332
/* We use in windows bfactor (split slow kernel into smaller parts) to avoid
327333
* that windows is killing long running kernel.
@@ -346,7 +352,6 @@ extern "C" int cuda_get_deviceinfo(nvid_ctx* ctx)
346352
size_t availableMem = freeMemory - (128u * byteToMiB) - 200u;
347353
size_t limitedMemory = std::min(availableMem, maxMemUsage);
348354

349-
const size_t dataset_size = getRandomXDatasetSize();
350355
if(limitedMemory <= dataset_size)
351356
limitedMemory = 0;
352357
else

xmrstak/cli/cli-miner.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void do_guided_pool_config()
219219
configTpl.set(std::string(tpl));
220220
bool prompted = false;
221221

222-
auto& currency = params::inst().currency;
222+
auto currency = params::inst().currency;
223223
if(currency.empty() || !jconf::IsOnAlgoList(currency))
224224
{
225225
prompt_once(prompted);
@@ -236,7 +236,7 @@ void do_guided_pool_config()
236236
currency = tmp;
237237
}
238238

239-
auto& pool = params::inst().poolURL;
239+
auto pool = params::inst().poolURL;
240240
bool userSetPool = true;
241241
if(pool.empty())
242242
{
@@ -247,7 +247,7 @@ void do_guided_pool_config()
247247
std::cin >> pool;
248248
}
249249

250-
auto& userName = params::inst().poolUsername;
250+
auto userName = params::inst().poolUsername;
251251
if(userName.empty())
252252
{
253253
prompt_once(prompted);
@@ -257,7 +257,7 @@ void do_guided_pool_config()
257257
}
258258

259259
bool stdin_flushed = false;
260-
auto& passwd = params::inst().poolPasswd;
260+
auto passwd = params::inst().poolPasswd;
261261
if(passwd.empty() && !params::inst().userSetPwd)
262262
{
263263
prompt_once(prompted);
@@ -271,7 +271,7 @@ void do_guided_pool_config()
271271
getline(std::cin, passwd);
272272
}
273273

274-
auto& rigid = params::inst().poolRigid;
274+
auto rigid = params::inst().poolRigid;
275275
if(rigid.empty() && !params::inst().userSetRigid)
276276
{
277277
if(!use_simple_start())
@@ -366,7 +366,7 @@ void do_guided_config()
366366
configTpl.set(std::string(tpl));
367367
bool prompted = false;
368368

369-
auto& http_port = params::inst().httpd_port;
369+
auto http_port = params::inst().httpd_port;
370370
if(http_port == params::httpd_port_unset)
371371
{
372372
http_port = params::httpd_port_disabled;
@@ -943,6 +943,12 @@ int do_benchmark(int block_version, int wait_sec, int work_sec)
943943

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

946+
if(block_version <= 0)
947+
{
948+
printer::inst()->print_msg(L0, "Block version must be >0, current value is %u.", block_version);
949+
return 1;
950+
}
951+
946952
uint8_t work[128];
947953
memset(work, 0, 128);
948954
work[0] = static_cast<uint8_t>(block_version);

xmrstak/jconf.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,13 @@ configVal oConfigValues[] = {
100100
constexpr size_t iConfigCnt = (sizeof(oConfigValues) / sizeof(oConfigValues[0]));
101101

102102
xmrstak::coin_selection coins[] = {
103-
// name, userpool, devpool, default_pool_suggestion
103+
// name, userpool, default_pool_suggestion
104+
{"loki", {POW(randomX_loki)}, {POW(randomX_loki)}, nullptr},
105+
{"monero", {POW(randomX)}, {POW(randomX)}, nullptr},
104106
{"randomx", {POW(randomX)}, {POW(randomX)}, nullptr},
105107
{"randomx_loki", {POW(randomX_loki)}, {POW(randomX_loki)}, nullptr},
106-
{"randomx_wow", {POW(randomX_wow)}, {POW(randomX_wow)}, nullptr}
108+
{"randomx_wow", {POW(randomX_wow)}, {POW(randomX_wow)}, nullptr},
109+
{"wownero", {POW(randomX_wow)}, {POW(randomX_wow)}, nullptr}
107110
};
108111

109112
constexpr size_t coin_algo_size = (sizeof(coins) / sizeof(coins[0]));

xmrstak/misc/executor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,9 @@ void executor::ex_main()
525525
const char* rigid = params.userSetRigid ? params.poolRigid.c_str() : cfg.sRigId;
526526
const char* pwd = params.userSetPwd ? params.poolPasswd.c_str() : cfg.sPasswd;
527527
bool nicehash = cfg.nicehash || params.nicehashMode;
528+
bool tls = params.poolUseTls;
528529

529-
pools.emplace_back(i, cfg.sPoolAddr, wallet, rigid, pwd, 9.9, params.poolUseTls, cfg.tls_fingerprint, nicehash);
530+
pools.emplace_back(i, cfg.sPoolAddr, wallet, rigid, pwd, 9.9, tls, cfg.tls_fingerprint, nicehash);
530531
}
531532
else
532533
pools.emplace_back(i, cfg.sPoolAddr, cfg.sWalletAddr, cfg.sRigId, cfg.sPasswd, cfg.weight, cfg.tls, cfg.tls_fingerprint, cfg.nicehash);

0 commit comments

Comments
 (0)