projects
/
hashcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eb88171
)
Pure black magic to workaround 100% CPU usage bug in NVidias OpenCL runtime on Linux
author
jsteube
<jens.steube@gmail.com>
Sun, 12 Jun 2016 10:26:47 +0000
(12:26 +0200)
committer
jsteube
<jens.steube@gmail.com>
Sun, 12 Jun 2016 10:26:47 +0000
(12:26 +0200)
src/hashcat.c
patch
|
blob
|
history
diff --git
a/src/hashcat.c
b/src/hashcat.c
index
de54214
..
eafc6f6
100644
(file)
--- a/
src/hashcat.c
+++ b/
src/hashcat.c
@@
-150,6
+150,8
@@
double TARGET_MS_PROFILE[4] = { 2, 12, 96, 480 };
#define NUM_DEFAULT_BENCHMARK_ALGORITHMS 143
#define NUM_DEFAULT_BENCHMARK_ALGORITHMS 143
+#define NVIDIA_100PERCENTCPU_WORKAROUND 100
+
#define global_free(attr) \
{ \
myfree ((void *) data.attr); \
#define global_free(attr) \
{ \
myfree ((void *) data.attr); \
@@
-5446,8
+5448,25
@@
void SetConsoleWindowSize (const int x)
}
#endif
}
#endif
+#ifdef _POSIX
+int (*clock_gettime_orig) (clockid_t clk_id, struct timespec *tp);
+
+int clock_gettime (clockid_t clk_id, struct timespec *tp)
+{
+ int r = clock_gettime_orig (clk_id, tp);
+
+ usleep (NVIDIA_100PERCENTCPU_WORKAROUND);
+
+ return r;
+}
+#endif
+
int main (int argc, char **argv)
{
int main (int argc, char **argv)
{
+ #ifdef _POSIX
+ clock_gettime_orig = dlsym (RTLD_NEXT, "clock_gettime");
+ #endif
+
#ifdef _WIN
SetConsoleWindowSize (132);
#endif
#ifdef _WIN
SetConsoleWindowSize (132);
#endif
@@
-18274,4
+18293,3
@@
int main (int argc, char **argv)
return -1;
}
return -1;
}
-