Skip to content

Commit 6e89b2d

Browse files
author
Colin Davidson
committed
debug remote hal
1 parent 9deca2d commit 6e89b2d

5 files changed

Lines changed: 33 additions & 15 deletions

File tree

.github/actions/do_build_run_remote_hal/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,32 @@ runs:
1414
- name : build client
1515
shell: bash
1616
run: |
17-
cmake -Bbuild_client -GNinja -DCA_MUX_TARGETS_TO_ENABLE="riscv" -DCA_RISCV_ENABLED=ON -DCA_LLVM_INSTALL_DIR=$GITHUB_WORKSPACE/llvm_install -DCA_CL_ENABLE_ICD_LOADER=ON -DCA_HAL_NAME=cpu_client
17+
cmake -Bbuild_client -GNinja -DCA_MUX_TARGETS_TO_ENABLE="riscv" -DCA_RISCV_ENABLED=ON -DCA_LLVM_INSTALL_DIR=$GITHUB_WORKSPACE/llvm_install -DCA_CL_ENABLE_ICD_LOADER=ON -DCA_HAL_NAME=cpu_client -DCA_CL_ENABLE_OFFLINE_KERNEL_TESTS=OFF
1818
ninja -Cbuild_client UnitCL
1919
- name : run remote_hal
2020
shell: bash
2121
run: |
2222
export HAL_REMOTE_PORT=9999
23+
export HAL_DEBUG_SERVER=1
2324
# Limit number of threads to 1 due to hal cpu use of temporary threads causing excessive qemu memory usage.
2425
export CA_CPU_HAL_NUM_THREADS=1
2526
export START_STRING="Listening on port $HAL_REMOTE_PORT"
2627
export TRIES=10
2728
# Start server
2829
cd build_server
29-
( /usr/bin/qemu-riscv64 -L /usr/riscv64-linux-gnu ./hal_cpu_server_bin $HAL_REMOTE_PORT > /tmp/hal.op 2>&1 ) &
30+
( /usr/bin/qemu-riscv64 -L /usr/riscv64-linux-gnu ./hal_cpu_server_bin $HAL_REMOTE_PORT | tee /tmp/hal.op 2>&1 ) &
3031
# Check that server is running.
3132
while [ "$TRIES" -gt 0 ] && ! grep "$START_STRING" /tmp/hal.op ; do
3233
sleep 1
3334
TRIES=$(( TRIES - 1 ))
3435
done
35-
rm /tmp/hal.op
36+
# rm /tmp/hal.op
3637
if [ "$TRIES" -ne 0 ]; then
3738
jobs
3839
# Run client
3940
cd $GITHUB_WORKSPACE/build_client
4041
exitcode=0
42+
sleep 2
4143
OCL_ICD_FILENAMES=$PWD/lib/libCL.so.4.0 ./bin/UnitCL || exitcode=$?
4244
kill %1
4345
exit $exitcode

.github/workflows/planned_testing_caller.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ permissions:
8383
jobs:
8484
build_llvm_artefacts:
8585
name: Call PR testing on schedule
86-
if: inputs.build_llvm && inputs.ock
86+
if: inputs.build_llvm
87+
# && inputs.ock
8788
uses: ./.github/workflows/create_llvm_artefacts.yml
8889
secrets: inherit
8990
with:

.github/workflows/planned_testing_caller_20.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ jobs:
4141
# We can set ock, test_sycl_cts etc here optionally if this is used as a
4242
# pull request. Any parameters below this is intended for local testing
4343
# and should not be merged nor reviewed (other than checking it should not be merged).
44+
ock: false
45+
test_tornado: false
46+
test_sanitizers: false
47+
test_remote_hal: true
48+
test_sycl_cts: false
49+
test_sycl_e2e: false
50+
test_opencl_cts: false
51+
run_internal: false
52+
run_external: true
53+
target_list: '[ "host_x86_64_linux"]'
4454

4555
# This cleans up any caches which may have been created when running external tests
4656
clean_caches:

.github/workflows/run_pr_tests_caller.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ name: Run ock tests for PR style testing
33
on:
44
pull_request:
55
paths:
6-
- 'source/**'
7-
- 'clik/**'
8-
- 'modules/**'
9-
- 'examples/**'
10-
- 'cmake/**'
11-
- 'hal/**'
12-
- '.github/actions/do_build_ock/**'
13-
- '.github/actions/do_build_pr/**'
14-
- '.github/actions/setup_build/**'
6+
# - 'source/**'
7+
# - 'clik/**'
8+
# - 'modules/**'
9+
# - 'examples/**'
10+
# - 'cmake/**'
11+
# - 'hal/**'
12+
# - '.github/actions/do_build_ock/**'
13+
# - '.github/actions/do_build_pr/**'
14+
# - '.github/actions/setup_build/**'
1515
- '.github/workflows/run_ock_internal_tests.yml'
16-
- '.github/workflows/run_pr_tests_caller.yml'
17-
- 'CMakeLists.txt'
16+
# - '.github/workflows/run_pr_tests_caller.yml'
17+
# - 'CMakeLists.txt'
1818

1919
permissions:
2020
packages: read

modules/compiler/loader/source/loader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ cargo::expected<std::unique_ptr<Library>, std::string> loadLibrary() {
9191
// See
9292
// https://stackoverflow.com/questions/51209268/using-stdthread-in-a-library-loaded-with-dlopen-leads-to-a-sigsev
9393
handle->library = dlopen(library_name, RTLD_NOW | RTLD_GLOBAL);
94+
if (! handle->library) {
95+
(void)fprintf(stderr, "error: could not load '%s' : '%s'\n", library_name,
96+
dlerror());
97+
return nullptr;
98+
}
9499
#endif
95100

96101
if (!handle->library) {

0 commit comments

Comments
 (0)