OpenCL Runtime: Workaround ROCm OpenCL driver problem trying to write temporary file into readonly folder by setting TMPDIR environment variable

This commit is contained in:
Jens Steube
2019-06-17 17:35:23 +02:00
parent 5e0eb288c9
commit 62d5d2dfbb
4 changed files with 16 additions and 3 deletions

View File

@@ -1108,7 +1108,7 @@ int hashcat_session_init (hashcat_ctx_t *hashcat_ctx, const char *install_folder
* To help users a bit
*/
setup_environment_variables ();
setup_environment_variables (hashcat_ctx->folder_config);
setup_umask ();

View File

@@ -7,6 +7,7 @@
#include "types.h"
#include "convert.h"
#include "shared.h"
#include "memory.h"
#if defined (__CYGWIN__)
#include <sys/cygwin.h>
@@ -467,7 +468,7 @@ bool hc_string_is_digit (const char *s)
return true;
}
void setup_environment_variables ()
void setup_environment_variables (const folder_config_t *folder_config)
{
char *compute = getenv ("COMPUTE");
@@ -498,6 +499,17 @@ void setup_environment_variables ()
putenv ((char *) "POCL_KERNEL_CACHE=0");
*/
if (getenv ("TMPDIR") == NULL)
{
char *tmpdir = NULL;
hc_asprintf (&tmpdir, "TMPDIR=%s", folder_config->profile_dir);
putenv (tmpdir);
// we can't free tmpdir at this point!
}
if (getenv ("CL_CONFIG_USE_VECTORIZER") == NULL)
putenv ((char *) "CL_CONFIG_USE_VECTORIZER=False");