summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml16
-rw-r--r--doc/usage.md1
-rw-r--r--xmrstak/backend/amd/amd_gpu/gpu.cpp48
-rw-r--r--xmrstak/backend/cpu/autoAdjust.hpp14
-rw-r--r--xmrstak/cli/cli-miner.cpp5
-rw-r--r--xmrstak/params.hpp2
6 files changed, 52 insertions, 34 deletions
diff --git a/.travis.yml b/.travis.yml
index de5b45f..f263e86 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -55,6 +55,22 @@ matrix:
- CMAKE_C_COMPILER=gcc-6
- XMRSTAK_CMAKE_FLAGS="-DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF"
+ # test with disabled HWLOC, MICROHTTPD, OpenSSL and no accelerators
+ - os: linux
+ compiler: gcc
+ addons:
+ apt:
+ sources:
+ - ubuntu-toolchain-r-test
+ packages:
+ - *default_packages
+ - gcc-6
+ - g++-6
+ env:
+ - CMAKE_CXX_COMPILER=g++-6
+ - CMAKE_C_COMPILER=gcc-6
+ - XMRSTAK_CMAKE_FLAGS="-DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF -DHWLOC_ENABLE=OFF -DOpenSSL_ENABLE=OFF -DMICROHTTPD_ENABLE=OFF"
+
- os: linux
compiler: gcc
addons:
diff --git a/doc/usage.md b/doc/usage.md
index 1f1fb09..886c1b3 100644
--- a/doc/usage.md
+++ b/doc/usage.md
@@ -16,6 +16,7 @@ The number of files depends on the available backends.
`pools.txt` contains the selected mining pools and currency to mine.
`amd.txt`, `cpu.txt` and `nvidia.txt` contains miner backend specific settings and can be used for further tuning ([Tuning Guide](tuning.md)).
+Note: If the pool is ignoring the option `rig_id` in `pools.txt` to name your worker please check the pool documentation how a worker name can be set.
## Usage on Windows
1) Double click the `xmr-stak.exe` file
diff --git a/xmrstak/backend/amd/amd_gpu/gpu.cpp b/xmrstak/backend/amd/amd_gpu/gpu.cpp
index 80d852a..4a82fab 100644
--- a/xmrstak/backend/amd/amd_gpu/gpu.cpp
+++ b/xmrstak/backend/amd/amd_gpu/gpu.cpp
@@ -16,6 +16,7 @@
#include "xmrstak/backend/cryptonight.hpp"
#include "xmrstak/jconf.hpp"
#include "xmrstak/picosha2/picosha2.hpp"
+#include "xmrstak/params.hpp"
#include <stdio.h>
#include <string.h>
@@ -393,9 +394,10 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
std::string cache_file = get_home() + "/.openclcache/" + hash_hex_str + ".openclbin";
std::ifstream clBinFile(cache_file, std::ofstream::in | std::ofstream::binary);
- if(!clBinFile.good())
+ if(xmrstak::params::inst().AMDCache == false || !clBinFile.good())
{
- printer::inst()->print_msg(L1,"OpenCL device %u - Precompiled code %s not found. Compiling ...",ctx->deviceIdx, cache_file.c_str());
+ if(xmrstak::params::inst().AMDCache)
+ printer::inst()->print_msg(L1,"OpenCL device %u - Precompiled code %s not found. Compiling ...",ctx->deviceIdx, cache_file.c_str());
ctx->Program = clCreateProgramWithSource(opencl_ctx, 1, (const char**)&source_code, NULL, &ret);
if(ret != CL_SUCCESS)
{
@@ -467,29 +469,31 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
std::vector<char*> all_programs(num_devices);
std::vector<std::vector<char>> program_storage;
- int p_id = 0;
- size_t mem_size = 0;
- // create memory structure to query all OpenCL program binaries
- for(auto & p : all_programs)
+ if(xmrstak::params::inst().AMDCache)
{
- program_storage.emplace_back(std::vector<char>(binary_sizes[p_id]));
- all_programs[p_id] = program_storage[p_id].data();
- mem_size += binary_sizes[p_id];
- p_id++;
- }
+ int p_id = 0;
+ size_t mem_size = 0;
+ // create memory structure to query all OpenCL program binaries
+ for(auto & p : all_programs)
+ {
+ program_storage.emplace_back(std::vector<char>(binary_sizes[p_id]));
+ all_programs[p_id] = program_storage[p_id].data();
+ mem_size += binary_sizes[p_id];
+ p_id++;
+ }
- if( ret = clGetProgramInfo(ctx->Program, CL_PROGRAM_BINARIES, num_devices * sizeof(char*), all_programs.data(),NULL) != CL_SUCCESS)
- {
- printer::inst()->print_msg(L1,"Error %s when calling clGetProgramInfo.", err_to_str(ret));
- return ERR_OCL_API;
- }
+ if((ret = clGetProgramInfo(ctx->Program, CL_PROGRAM_BINARIES, num_devices * sizeof(char*), all_programs.data(),NULL)) != CL_SUCCESS)
+ {
+ printer::inst()->print_msg(L1,"Error %s when calling clGetProgramInfo.", err_to_str(ret));
+ return ERR_OCL_API;
+ }
- std::ofstream file_stream;
- std::cout<<get_home() + "/.openclcache/" + hash_hex_str + ".openclbin"<<std::endl;
- file_stream.open(cache_file, std::ofstream::out | std::ofstream::binary);
- file_stream.write(all_programs[dev_id], binary_sizes[dev_id]);
- file_stream.close();
- printer::inst()->print_msg(L1, "OpenCL device %u - Precompiled code stored in file %s",ctx->deviceIdx, cache_file.c_str());
+ std::ofstream file_stream;
+ file_stream.open(cache_file, std::ofstream::out | std::ofstream::binary);
+ file_stream.write(all_programs[dev_id], binary_sizes[dev_id]);
+ file_stream.close();
+ printer::inst()->print_msg(L1, "OpenCL device %u - Precompiled code stored in file %s",ctx->deviceIdx, cache_file.c_str());
+ }
}
else
{
diff --git a/xmrstak/backend/cpu/autoAdjust.hpp b/xmrstak/backend/cpu/autoAdjust.hpp
index db805ec..969d478 100644
--- a/xmrstak/backend/cpu/autoAdjust.hpp
+++ b/xmrstak/backend/cpu/autoAdjust.hpp
@@ -35,19 +35,9 @@ public:
bool printConfig()
{
- size_t hashMemSizeKB;
- size_t halfHashMemSizeKB;
- if(::jconf::inst()->IsCurrencyMonero())
- {
- hashMemSizeKB = MONERO_MEMORY / 1024u;
- halfHashMemSizeKB = hashMemSizeKB / 2u;
- }
- else
- {
- hashMemSizeKB = AEON_MEMORY / 1024u;
- halfHashMemSizeKB = hashMemSizeKB / 2u;
- }
+ const size_t hashMemSizeKB = cn_select_memory(::jconf::inst()->GetMiningAlgo()) / 1024u;
+ const size_t halfHashMemSizeKB = hashMemSizeKB / 2u;
configEditor configTpl{};
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp
index 2e84ec5..c425f04 100644
--- a/xmrstak/cli/cli-miner.cpp
+++ b/xmrstak/cli/cli-miner.cpp
@@ -79,6 +79,7 @@ void help()
#endif
#ifndef CONF_NO_OPENCL
cout<<" --noAMD disable the AMD miner backend"<<endl;
+ cout<<" --noAMDCache disable the AMD(OpenCL) cache for precompiled binaries"<<endl;
cout<<" --amd FILE AMD backend miner config file"<<endl;
#endif
#ifndef CONF_NO_CUDA
@@ -449,6 +450,10 @@ int main(int argc, char *argv[])
{
params::inst().useAMD = false;
}
+ else if(opName.compare("--noAMDCache") == 0)
+ {
+ params::inst().AMDCache = false;
+ }
else if(opName.compare("--noNVIDIA") == 0)
{
params::inst().useNVIDIA = false;
diff --git a/xmrstak/params.hpp b/xmrstak/params.hpp
index 6928df5..3d584b9 100644
--- a/xmrstak/params.hpp
+++ b/xmrstak/params.hpp
@@ -21,6 +21,7 @@ struct params
std::string executablePrefix;
std::string binaryName;
bool useAMD;
+ bool AMDCache;
bool useNVIDIA;
bool useCPU;
@@ -56,6 +57,7 @@ struct params
binaryName("xmr-stak"),
executablePrefix(""),
useAMD(true),
+ AMDCache(true),
useNVIDIA(true),
useCPU(true),
configFile("config.txt"),
OpenPOWER on IntegriCloud