From f11ae25213340c36618910893394043fb493571c Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 9 Jan 2022 16:21:39 +0100 Subject: [PATCH] Disable ht2crack5gpu as ht2crack5opencl supercedes it and ht2crack5gpu can be difficult to get running on setups supporting OpenCL on more than one Nvidia GPU --- .../ISSUE_TEMPLATE/checklist-for-release.md | 2 +- doc/md/Development/Maintainers.md | 2 +- doc/md/Development/Makefile-vs-CMake.md | 2 +- docker/homebrew/README.md | 2 +- tools/hitag2crack/Makefile | 10 ++---- .../.gitignore | 0 .../Makefile | 0 .../README.md | 0 .../ht2crack5gpu.c | 0 .../ht2crack5kernel.cl | 0 tools/pm3_tests.sh | 35 +++++++------------ 11 files changed, 20 insertions(+), 33 deletions(-) rename tools/hitag2crack/{crack5gpu => crack5gpu_disabled}/.gitignore (100%) rename tools/hitag2crack/{crack5gpu => crack5gpu_disabled}/Makefile (100%) rename tools/hitag2crack/{crack5gpu => crack5gpu_disabled}/README.md (100%) rename tools/hitag2crack/{crack5gpu => crack5gpu_disabled}/ht2crack5gpu.c (100%) rename tools/hitag2crack/{crack5gpu => crack5gpu_disabled}/ht2crack5kernel.cl (100%) diff --git a/.github/ISSUE_TEMPLATE/checklist-for-release.md b/.github/ISSUE_TEMPLATE/checklist-for-release.md index e75aa2d22..cc123af85 100644 --- a/.github/ISSUE_TEMPLATE/checklist-for-release.md +++ b/.github/ISSUE_TEMPLATE/checklist-for-release.md @@ -35,7 +35,7 @@ make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS=BTADDON && sudo make install PLATFORM=P ( cd client; rm -rf build; mkdir build;cd build;cmake .. && make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS= && cp -a ../*scripts ../*libs . && ../../tools/pm3_tests.sh --clientbin $(pwd)/proxmark3 client ) || exit 1 ( cd client; rm -rf build; mkdir build;cd build;cmake .. && make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS=BTADDON && cp -a ../*scripts ../*libs . && ../../tools/pm3_tests.sh --clientbin $(pwd)/proxmark3 client ) || exit 1 -# Hitag2crack, optionally with --long and --gpu ... +# Hitag2crack, optionally with --long and --opencl ... make hitag2crack/clean && make hitag2crack && tools/pm3_tests.sh hitag2crack || exit 1 ``` diff --git a/doc/md/Development/Maintainers.md b/doc/md/Development/Maintainers.md index 0cf7817f6..2055e5bd2 100644 --- a/doc/md/Development/Maintainers.md +++ b/doc/md/Development/Maintainers.md @@ -77,7 +77,7 @@ On some architectures, pthread library is not present: One tool requires a CUDA compilation environment, it can be skipped as well: -* `make hitag2crack SKIPGPU=1` to skip ht2crack5gpu tool when compiling the hitag2crack toolsuite. +* `make hitag2crack SKIPOPENCL=1` to skip ht2crack5opencl tool when compiling the hitag2crack toolsuite. Some unittests are available via `make check`, which is actually triggering individual targets as for `make install`. diff --git a/doc/md/Development/Makefile-vs-CMake.md b/doc/md/Development/Makefile-vs-CMake.md index d77734cfc..79ac43e2c 100644 --- a/doc/md/Development/Makefile-vs-CMake.md +++ b/doc/md/Development/Makefile-vs-CMake.md @@ -95,7 +95,7 @@ At the moment both are maintained because they don't perfectly overlap yet. | Feature | Makefile | Remarks | |-----|---|---| -| Skip GPU-dependent code | `SKIPGPU=1` | to skip ht2crack5gpu tool when compiling the hitag2crack toolsuite | +| Skip OpenCL-dependent code | `SKIPOPENCL=1` | to skip ht2crack5opencl tool when compiling the hitag2crack toolsuite | ## ARM ^[Top](#top) diff --git a/docker/homebrew/README.md b/docker/homebrew/README.md index 77bfc8bb2..07c92e573 100644 --- a/docker/homebrew/README.md +++ b/docker/homebrew/README.md @@ -11,7 +11,7 @@ make -j client USE_BREW=1 SKIPREADLINE=1 make -j mfkey make -j nonce2key make -j mf_nonce_brute -make -j hitag2crack SKIPGPU=1 +make -j hitag2crack SKIPOPENCL=1 make -j fpga_compress ``` diff --git a/tools/hitag2crack/Makefile b/tools/hitag2crack/Makefile index 26f538110..631e5d261 100644 --- a/tools/hitag2crack/Makefile +++ b/tools/hitag2crack/Makefile @@ -1,8 +1,8 @@ include ../../Makefile.defs all clean install uninstall check: %: crack2/% crack3/% crack4/% crack5/% -ifneq ($(SKIPGPU),1) -all clean install uninstall check: %: crack5gpu/% crack5opencl/% +ifneq ($(SKIPOPENCL),1) +all clean install uninstall check: %: crack5opencl/% endif crack2/%: FORCE @@ -21,14 +21,10 @@ crack5/%: FORCE $(info [*] MAKE $@) $(Q)$(MAKE) --no-print-directory -C crack5 $(patsubst crack5/%,%,$@) DESTDIR=$(MYDESTDIR) -crack5gpu/%: FORCE - $(info [*] MAKE $@) - $(Q)$(MAKE) --no-print-directory -C crack5gpu $(patsubst crack5gpu/%,%,$@) DESTDIR=$(MYDESTDIR) - crack5opencl/%: FORCE $(info [*] MAKE $@) $(Q)$(MAKE) --no-print-directory -C crack5opencl $(patsubst crack5opencl/%,%,$@) DESTDIR=$(MYDESTDIR) FORCE: # Dummy target to force remake in the subdirectories, even if files exist (this Makefile doesn't know about the prerequisites) -.phony: crack2 crack3 crack4 crack5 crack5gpu crack5opencl FORCE +.phony: crack2 crack3 crack4 crack5 crack5opencl FORCE diff --git a/tools/hitag2crack/crack5gpu/.gitignore b/tools/hitag2crack/crack5gpu_disabled/.gitignore similarity index 100% rename from tools/hitag2crack/crack5gpu/.gitignore rename to tools/hitag2crack/crack5gpu_disabled/.gitignore diff --git a/tools/hitag2crack/crack5gpu/Makefile b/tools/hitag2crack/crack5gpu_disabled/Makefile similarity index 100% rename from tools/hitag2crack/crack5gpu/Makefile rename to tools/hitag2crack/crack5gpu_disabled/Makefile diff --git a/tools/hitag2crack/crack5gpu/README.md b/tools/hitag2crack/crack5gpu_disabled/README.md similarity index 100% rename from tools/hitag2crack/crack5gpu/README.md rename to tools/hitag2crack/crack5gpu_disabled/README.md diff --git a/tools/hitag2crack/crack5gpu/ht2crack5gpu.c b/tools/hitag2crack/crack5gpu_disabled/ht2crack5gpu.c similarity index 100% rename from tools/hitag2crack/crack5gpu/ht2crack5gpu.c rename to tools/hitag2crack/crack5gpu_disabled/ht2crack5gpu.c diff --git a/tools/hitag2crack/crack5gpu/ht2crack5kernel.cl b/tools/hitag2crack/crack5gpu_disabled/ht2crack5kernel.cl similarity index 100% rename from tools/hitag2crack/crack5gpu/ht2crack5kernel.cl rename to tools/hitag2crack/crack5gpu_disabled/ht2crack5kernel.cl diff --git a/tools/pm3_tests.sh b/tools/pm3_tests.sh index bf611b743..ed48e200f 100755 --- a/tools/pm3_tests.sh +++ b/tools/pm3_tests.sh @@ -7,7 +7,7 @@ DICPATH="./client/dictionaries" RESOURCEPATH="./client/resources" SLOWTESTS=false -GPUTESTS=false +OPENCLTESTS=false TESTALL=true TESTMFKEY=false TESTNONCE2KEY=false @@ -26,9 +26,9 @@ while (( "$#" )); do case "$1" in -h|--help) echo """ -Usage: $0 [--long] [--gpu] [--clientbin /path/to/proxmark3] [mfkey|nonce2key|mf_nonce_brute|fpga_compress|bootrom|armsrc|client|recovery|common] +Usage: $0 [--long] [--opencl] [--clientbin /path/to/proxmark3] [mfkey|nonce2key|mf_nonce_brute|fpga_compress|bootrom|armsrc|client|recovery|common] --long: Enable slow tests - --gpu: Enable tests requiring GPU + --opencl: Enable tests requiring OpenCL (preferably a Nvidia GPU) --clientbin ...: Specify path to proxmark3 binary to test If no target given, all targets will be tested """ @@ -38,8 +38,8 @@ Usage: $0 [--long] [--gpu] [--clientbin /path/to/proxmark3] [mfkey|nonce2key|mf_ SLOWTESTS=true shift ;; - --gpu) - GPUTESTS=true + --opencl) + OPENCLTESTS=true shift ;; --clientbin) @@ -141,9 +141,9 @@ function CheckFileExist() { return 1 } -# [slow] [gpu] [retry] [ignore] <command_line> <check_result_regex> +# [slow] [opencl] [retry] [ignore] <title> <command_line> <check_result_regex> # slow: test takes more than ~5s -# gpu: test requires GPU presence +# opencl: test requires OpenCL # retry: test repeated up to 3 times in case of failure # ignore: test failure is not fatal function CheckExecute() { @@ -153,11 +153,11 @@ function CheckExecute() { else local SLOWTEST=false fi - if [ "$1" == "gpu" ]; then - local GPUTEST=true + if [ "$1" == "opencl" ]; then + local OPENCLTEST=true shift else - local GPUTEST=false + local OPENCLTEST=false fi if [ "$1" == "retry" ]; then local RETRY="1 2 3 e" @@ -179,8 +179,8 @@ function CheckExecute() { echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( slow )" return $RESULT fi - if $GPUTEST && ! $GPUTESTS; then - echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( gpu )" + if $OPENCLTEST && ! $OPENCLTESTS; then + echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( opencl )" return $RESULT fi @@ -327,15 +327,6 @@ while true; do # Order of magnitude to crack it: ~12s on 1 core, ~3s on 4 cores -> tagged as "slow" if ! CheckExecute slow "ht2crack5 test" "cd $HT2CRACK5PATH; ./ht2crack5 $HT2CRACK5UID $HT2CRACK5NRAR" "Key: $HT2CRACK5KEY"; then break; fi - echo -e "\n${C_BLUE}Testing ht2crack5gpu:${C_NC} ${HT2CRACK5GPUPATH:=./tools/hitag2crack/crack5gpu/}" - if ! CheckFileExist "ht2crack5gpu exists" "$HT2CRACK5GPUPATH/ht2crack5gpu"; then break; fi - HT2CRACK5GPUUID=12345678 - HT2CRACK5GPUKEY=AABBCCDDEEFF - # The speed depends on the nRaR so we'll use two pairs known to work fast - HT2CRACK5GPUNRAR="B438220C 944FFD74 942C59E3 3D450B34" - # Order of magnitude to crack it: ~15s -> tagged as "slow" - if ! CheckExecute slow gpu "ht2crack5gpu test" "cd $HT2CRACK5GPUPATH; ./ht2crack5gpu $HT2CRACK5GPUUID $HT2CRACK5GPUNRAR" "Key: $HT2CRACK5GPUKEY"; then break; fi - echo -e "\n${C_BLUE}Testing ht2crack5opencl:${C_NC} ${HT2CRACK5OPENCLPATH:=./tools/hitag2crack/crack5opencl/}" if ! CheckFileExist "ht2crack5opencl exists" "$HT2CRACK5OPENCLPATH/ht2crack5opencl"; then break; fi HT2CRACK5OPENCLUID=12345678 @@ -343,7 +334,7 @@ while true; do # The speed depends on the nRaR so we'll use two pairs known to work fast HT2CRACK5OPENCLNRAR="B438220C 944FFD74 942C59E3 3D450B34" # Order of magnitude to crack it: ~15s -> tagged as "slow" - if ! CheckExecute slow gpu "ht2crack5opencl test" "cd $HT2CRACK5OPENCLPATH; ./ht2crack5opencl $HT2CRACK5OPENCLUID $HT2CRACK5OPENCLNRAR" "Key found.*: $HT2CRACK5OPENCLKEY"; then break; fi + if ! CheckExecute slow opencl "ht2crack5opencl test" "cd $HT2CRACK5OPENCLPATH; ./ht2crack5opencl $HT2CRACK5OPENCLUID $HT2CRACK5OPENCLNRAR" "Key found.*$HT2CRACK5OPENCLKEY"; then break; fi fi if $TESTALL || $TESTCLIENT; then echo -e "\n${C_BLUE}Testing client:${C_NC} ${CLIENTBIN:=./client/proxmark3}"