diff --git a/xmrstak/backend/amd/amd_gpu/gpu.cpp b/xmrstak/backend/amd/amd_gpu/gpu.cpp
index 9c9db2ee3d274fa1d170b043548e4f1b116b72de..62e7323b4fae3c83b48c9777739cf417a677f2d4 100644
--- a/xmrstak/backend/amd/amd_gpu/gpu.cpp
+++ b/xmrstak/backend/amd/amd_gpu/gpu.cpp
@@ -48,25 +48,12 @@
 
 #ifdef _WIN32
 #include <windows.h>
-#include <Shlobj.h>
 
 static inline void create_directory(std::string dirname)
 {
     _mkdir(dirname.data());
 }
 
-static inline std::string get_home()
-{
-	char path[MAX_PATH + 1];
-	// get folder "appdata\local"
-	if (SHGetSpecialFolderPathA(HWND_DESKTOP, path, CSIDL_LOCAL_APPDATA, FALSE))
-	{
-		return path;
-	}
-	else
-		return ".";
-}
-
 static inline void port_sleep(size_t sec)
 {
 	Sleep(sec * 1000);
@@ -80,16 +67,6 @@ static inline void create_directory(std::string dirname)
 	mkdir(dirname.data(), 0744);
 }
 
-static inline std::string get_home()
-{
-	const char *home = ".";
-
-	if ((home = getenv("HOME")) == nullptr)
-		home = getpwuid(getuid())->pw_dir;
-
-	return home;
-}
-
 static inline void port_sleep(size_t sec)
 {
 	sleep(sec);
@@ -339,7 +316,7 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
 		isWindowsOs = 1;
 #endif
 		options += " -DIS_WINDOWS_OS=" + std::to_string(isWindowsOs);
-		
+
 		if(miner_algo == cryptonight_gpu)
 			options += " -cl-fp32-correctly-rounded-divide-sqrt";
 
@@ -358,7 +335,9 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
 		std::string hash_hex_str;
 		picosha2::hash256_hex_string(src_str, hash_hex_str);
 
-		std::string cache_file = get_home() + "/.openclcache/" + hash_hex_str + ".openclbin";
+		const std::string cache_dir = xmrstak::params::inst().rootAMDCacheDir;
+
+		std::string cache_file = cache_dir + hash_hex_str + ".openclbin";
 		std::ifstream clBinFile(cache_file, std::ofstream::in | std::ofstream::binary);
 		if(xmrstak::params::inst().AMDCache == false || !clBinFile.good())
 		{
@@ -854,7 +833,8 @@ size_t InitOpenCL(GpuContext* ctx, size_t num_gpus, size_t platform_idx)
 	source_code = std::regex_replace(source_code, std::regex("XMRSTAK_INCLUDE_CN_GPU"), cryptonight_gpu);
 
 	// create a directory  for the OpenCL compile cache
-	create_directory(get_home() + "/.openclcache");
+	const std::string cache_dir = xmrstak::params::inst().rootAMDCacheDir;
+	create_directory(cache_dir);
 
 	std::vector<std::shared_ptr<InterleaveData>> interleaveData(num_gpus, nullptr);
 
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp
index d6822cd63c544e07975d22ecd28474a6e2be904b..7b974f66946a6f4eb61c5eef0a077f15c1f5f964 100644
--- a/xmrstak/cli/cli-miner.cpp
+++ b/xmrstak/cli/cli-miner.cpp
@@ -84,6 +84,7 @@ void help()
 	cout<<"  --noAMDCache               disable the AMD(OpenCL) cache for precompiled binaries"<<endl;
 	cout<<"  --openCLVendor VENDOR      use OpenCL driver of VENDOR and devices [AMD,NVIDIA]"<<endl;
 	cout<<"                             default: AMD"<<endl;
+	cout<<"  --amdCacheDir DIRECTORY    directory to store AMD binary files"<<endl;
 	cout<<"  --amd FILE                 AMD backend miner config file"<<endl;
 #endif
 #ifndef CONF_NO_CUDA
@@ -502,6 +503,17 @@ int main(int argc, char *argv[])
 			}
 			params::inst().configFileAMD = argv[i];
 		}
+		else if(opName.compare("--amdCacheDir") == 0)
+		{
+			++i;
+			if( i >=argc )
+			{
+				printer::inst()->print_msg(L0, "No argument for parameter '--amdCacheDir' given");
+				win_exit();
+				return 1;
+			}
+			params::inst().rootAMDCacheDir = std::string(argv[i]) + "/";
+		}
 		else if(opName.compare("--nvidia") == 0)
 		{
 			++i;
diff --git a/xmrstak/misc/home_dir.hpp b/xmrstak/misc/home_dir.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..8eb0fa4ea2a5256495bc4975f5ba1aebec93ba72
--- /dev/null
+++ b/xmrstak/misc/home_dir.hpp
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <string>
+
+#ifdef _WIN32
+#include <WinSock2.h>
+#include <Shlobj.h>
+
+namespace
+{
+	inline std::string get_home()
+	{
+		char path[MAX_PATH + 1];
+		// get folder "appdata\local"
+		if (SHGetSpecialFolderPathA(HWND_DESKTOP, path, CSIDL_LOCAL_APPDATA, FALSE))
+		{
+			return path;
+		}
+		else
+			return ".";
+	}
+} // namespace anonymous
+
+#else
+#include <unistd.h>
+#include <pwd.h>
+#include <cstdlib>
+
+namespace
+{
+	inline std::string get_home()
+	{
+		const char *home = ".";
+
+		if ((home = getenv("HOME")) == nullptr)
+			home = getpwuid(getuid())->pw_dir;
+
+		return home;
+	}
+} // namespace anonymous
+
+#endif // _WIN32
diff --git a/xmrstak/params.hpp b/xmrstak/params.hpp
index 16089aed7e524979e03ac031e272bb1a19f279c1..146aaa42fd387a826bbf2a8a1c17c0f31ebc5479 100644
--- a/xmrstak/params.hpp
+++ b/xmrstak/params.hpp
@@ -1,6 +1,7 @@
 #pragma once
 
 #include "xmrstak/misc/environment.hpp"
+#include "xmrstak/misc/home_dir.hpp"
 
 #include <string>
 
@@ -45,6 +46,7 @@ struct params
 	std::string configFile;
 	std::string configFilePools;
 	std::string configFileAMD;
+	std::string rootAMDCacheDir;
 	std::string configFileNVIDIA;
 	std::string configFileCPU;
 
@@ -68,6 +70,7 @@ struct params
 		configFile("config.txt"),
 		configFilePools("pools.txt"),
 		configFileAMD("amd.txt"),
+		rootAMDCacheDir(get_home() + "/.openclcache/"),
 		configFileCPU("cpu.txt"),
 		configFileNVIDIA("nvidia.txt")
 	{}