Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load library "liblikwid" #25

Closed
Arpit-Babbar opened this issue Jan 4, 2022 · 2 comments
Closed

Could not load library "liblikwid" #25

Arpit-Babbar opened this issue Jan 4, 2022 · 2 comments

Comments

@Arpit-Babbar
Copy link

Arpit-Babbar commented Jan 4, 2022

EDIT - The particular test cases work fine if I started Julia as

likwid-perfctr -C 0 -g FLOPS_SP -G 0 -W FLOPS_SP -m julia

However, the tests still fail (log given as a post below)


I am getting the following issues when trying to use LIKWID. Starting the julia REPL as usual with $ julia (which might be wrong for LIKWID.jl?), executing ] test LIKWID, I get

     Testing Running tests...
[ Info: No CUDA/GPU found.
Libdl.find_library("libcuda") = ""
filter(contains("cuda"), lowercase.(Libdl.dllist())) = String[]
[ Info: CUDA.versioninfo():
┌ Warning: Unsuccessful!
└ @ Main ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:27
ErrorException("could not load symbol \"cuDriverGetVersion\":\n/opt/julia-1.7.1/bin/julia: undefined symbol: cuDriverGetVersion")

┌ Error: Exception while generating log record in module Main at /home/arpit/.julia/packages/LIKWID/pbxmY/test/runtests.jl:34
│   exception =
│    could not load library "liblikwid"
│    liblikwid.so: cannot open shared object file: No such file or directory
│    Stacktrace:
│      [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
│        @ Base.Libc.Libdl ./libdl.jl:117
│      [2] dlopen (repeats 2 times)
│        @ ./libdl.jl:117 [inlined]
│      [3] dlopen(f::LIKWID.var"#8#9", args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│        @ Base.Libc.Libdl ./libdl.jl:144
│      [4] dlopen
│        @ ./libdl.jl:142 [inlined]
│      [5] _check_likwid_gpusupport
│        @ ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:51 [inlined]
│      [6] gpusupport()
│        @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:45
│      [7] top-level scope
│        @ logging.jl:361
│      [8] include(fname::String)
│        @ Base.MainInclude ./client.jl:451
│      [9] top-level scope
│        @ none:6
│     [10] eval
│        @ ./boot.jl:373 [inlined]
│     [11] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:268
│     [12] _start()
│        @ Base ./client.jl:495
└ @ Main ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:34
ERROR: LoadError: could not load library "liblikwid"
liblikwid.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:117
 [2] dlopen (repeats 2 times)
   @ ./libdl.jl:117 [inlined]
 [3] dlopen(f::LIKWID.var"#8#9", args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Base.Libc.Libdl ./libdl.jl:144
 [4] dlopen
   @ ./libdl.jl:142 [inlined]
 [5] _check_likwid_gpusupport
   @ ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:51 [inlined]
 [6] gpusupport()
   @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:45
 [7] top-level scope
   @ ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:37
 [8] include(fname::String)
   @ Base.MainInclude ./client.jl:451
 [9] top-level scope
   @ none:6
in expression starting at /home/arpit/.julia/packages/LIKWID/pbxmY/test/runtests.jl:37
ERROR: Package LIKWID errored during testing

I am able to run perfctr.jl and saxpy.jl (removing GPU part atm) correctly, i.e., with commands like

likwid-perfctr -C 0 -g FLOPS_SP -G 0 -W FLOPS_SP -m julia --project=. saxpy.jl

, and also able to run everything I tried on https://github.com/RRZE-HPC/likwid. Another place I get the same error is when I try, within REPL,

julia> topo = LIKWID.get_cpu_topology()
ERROR: could not load library "liblikwid"
liblikwid.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] topology_init
   @ ~/.julia/packages/LIKWID/pbxmY/src/LibLikwid.jl:712 [inlined]
 [2] init_topology()
   @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/topology.jl:3
 [3] get_cpu_topology()
   @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/topology.jl:111
 [4] top-level scope
   @ REPL[3]:1

while running $ likwid-topology on shell gives the correct output. Here's my versioninfo() output

Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, ivybridge)
@Arpit-Babbar
Copy link
Author

Starting Julia as

likwid-perfctr -C 0 -g FLOPS_SP -G 0 -W FLOPS_SP -m julia

gives the errors

ERROR - [./src/timer.c:timer_finalize:613] Timer module not properly initialized
[ Info: Command: `likwid-perfctr -C 0 -g FLOPS_SP -m /opt/julia-1.7.1/bin/julia -Cnative -J/opt/julia-1.7.1/lib/julia/sys.so --depwarn=yes --check-bounds=yes -g1 --color=yes --startup-file=no --project=/home/arpit/.julia/packages/LIKWID/pbxmY/test/.. /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_marker.jl`
┌ Info: stdout:
│ --------------------------------------------------------------------------------
│ CPU name:     Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
│ CPU type:     Intel Core IvyBridge processor
│ CPU clock:    3.39 GHz
│ --------------------------------------------------------------------------------
│ --------------------------------------------------------------------------------
│ Region saxpy!, Group 1: FLOPS_SP
│ +-------------------+------------+
│ |    Region Info    | HWThread 0 |
│ +-------------------+------------+
│ | RDTSC Runtime [s] |   0.143695 |
│ |     call count    |          1 |
│ +-------------------+------------+
│
│ +--------------------------------------+---------+------------+
│ |                 Event                | Counter | HWThread 0 |
│ +--------------------------------------+---------+------------+
│ |           INSTR_RETIRED_ANY          |  FIXC0  | 1516481000 |
│ |         CPU_CLK_UNHALTED_CORE        |  FIXC1  |  551096000 |
│ |         CPU_CLK_UNHALTED_REF         |  FIXC2  |  482681100 |
│ | FP_COMP_OPS_EXE_SSE_FP_PACKED_SINGLE |   PMC0  |          0 |
│ | FP_COMP_OPS_EXE_SSE_FP_SCALAR_SINGLE |   PMC1  |  200117800 |
│ |       SIMD_FP_256_PACKED_SINGLE      |   PMC2  |          0 |
│ +--------------------------------------+---------+------------+
│
│ +----------------------+------------+
│ |        Metric        | HWThread 0 |
│ +----------------------+------------+
│ |  Runtime (RDTSC) [s] |     0.1437 |
│ | Runtime unhalted [s] |     0.1625 |
│ |      Clock [MHz]     |  3873.0988 |
│ |          CPI         |     0.3634 |
│ |     SP [MFLOP/s]     |  1392.6557 |
│ |   AVX SP [MFLOP/s]   |          0 |
│ |   Packed [MUOPS/s]   |          0 |
│ |   Scalar [MUOPS/s]   |  1392.6557 |
│ |  Vectorization ratio |          0 |
│ +----------------------+------------+
└
┌ Warning: stderr:
│ WARN: Skipping region mul-0 for evaluation.
│ WARN: Regions are skipped because:
│       - The region was only registered
│       - The region was started but never stopped
│       - The region was never started but stopped
└ @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:85
[ Info: Command: `/opt/julia-1.7.1/bin/julia -Cnative -J/opt/julia-1.7.1/lib/julia/sys.so --depwarn=yes --check-bounds=yes -g1 --color=yes --startup-file=no --project=/home/arpit/.julia/packages/LIKWID/pbxmY/test/.. /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_marker_noapi.jl`
[ Info: stdout:
┌ Warning: stderr:
│ ERROR: LoadError: AssertionError: !(Marker.isactive())
│ Stacktrace:
│  [1] top-level scope
│    @ ~/.julia/packages/LIKWID/pbxmY/test/test_marker_noapi.jl:6
│ in expression starting at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_marker_noapi.jl:6
└ @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:85
test_marker_noapi.jl: Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/runtests.jl:321
  Expression: exec(`$julia --project=$(pkgdir) $(joinpath(testdir, f))`)
Stacktrace:
 [1] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:445 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:321 [inlined]
 [3] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:1359 [inlined]
 [4] macro expansion
   @ ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:320 [inlined]
 [5] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
 [6] macro expansion
   @ ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:316 [inlined]
 [7] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
 [8] top-level scope
   @ ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:63
[ Info: Command: `likwid-perfctr -C 0 -g FLOPS_SP -m /opt/julia-1.7.1/bin/julia -Cnative -J/opt/julia-1.7.1/lib/julia/sys.so --depwarn=yes --check-bounds=yes -g1 --color=yes --startup-file=no --project=/home/arpit/.julia/packages/LIKWID/pbxmY/test/.. /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_markerfile.jl`
┌ Info: stdout:
│ --------------------------------------------------------------------------------
│ CPU name:     Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
│ CPU type:     Intel Core IvyBridge processor
│ CPU clock:    3.39 GHz
│ --------------------------------------------------------------------------------
│ Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_markerfile.jl:13
│   Expression: LIKWID.MarkerFile.regionmetrics(0) == 10
│    Evaluated: 9 == 10
└ --------------------------------------------------------------------------------
┌ Warning: stderr:
│ ERROR: LoadError: There was an error during testing
│ in expression starting at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_markerfile.jl:13
│ Marker API result file does not exist. This may happen if the application has not called LIKWID_MARKER_CLOSE.
└ @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:85
Marker File Reader: Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/runtests.jl:327
  Expression: exec(`$likwidperfctr -C 0 -g $(perfgrp) -m $julia --project=$(pkgdir) $(joinpath(testdir, f))`)
Stacktrace:
 [1] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:445 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:327 [inlined]
 [3] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
 [4] macro expansion
   @ ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:326 [inlined]
 [5] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
 [6] top-level scope
   @ ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:63
[ Info: Command: `likwid-pin -s 0xffffffffffffffe1 -C 0-3 -m /opt/julia-1.7.1/bin/julia -Cnative -J/opt/julia-1.7.1/lib/julia/sys.so --depwarn=yes --check-bounds=yes -g1 --color=yes --startup-file=no --project=/home/arpit/.julia/packages/LIKWID/pbxmY/test/.. -t4 /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl 0-3`
┌ Info: stdout:
│ No need to set mem_policy to membind, only one NUMA node available
│ Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl:31
│   Expression: procids == procids_glibc == cores
│    Evaluated: [0, 0, 0, 0] == [0, 0, 0, 0] == 0:3
└ [likwid-pin] Main PID -> hwthread 0 - OK
┌ Warning: stderr:
│ ERROR: LoadError: There was an error during testing
│ in expression starting at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl:31
└ @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:85
test_pin.jl: Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/runtests.jl:350
  Expression: exec(`$likwidpin -s $(maskstr) -C $(cores_firstN) -m $julia --project=$(pkgdir) -t$(N) $(joinpath(testdir, f)) $(cores_firstN)`)
Stacktrace:
 [1] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:445 [inlined]
 [2] (::var"#5#10"{Int64, String, String, String, String, String})()
   @ Main ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:350
[ Info: Command: `likwid-pin -s 0xffffffffffffffe1 -C 1,2,3,0 -m /opt/julia-1.7.1/bin/julia -Cnative -J/opt/julia-1.7.1/lib/julia/sys.so --depwarn=yes --check-bounds=yes -g1 --color=yes --startup-file=no --project=/home/arpit/.julia/packages/LIKWID/pbxmY/test/.. -t4 /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl 1,2,3,0`
┌ Info: stdout:
│ No need to set mem_policy to membind, only one NUMA node available
│ Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl:31
│   Expression: procids == procids_glibc == cores
│    Evaluated: [0, 0, 0, 0] == [0, 0, 0, 0] == [1, 2, 3, 0]
└ [likwid-pin] Main PID -> hwthread 0 - OK
┌ Warning: stderr:
│ ERROR: LoadError: There was an error during testing
│ in expression starting at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl:31
└ @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:85
test_pin.jl: Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/runtests.jl:351
  Expression: exec(`$likwidpin -s $(maskstr) -C $(cores_firstN_shuffled) -m $julia --project=$(pkgdir) -t$(N) $(joinpath(testdir, f)) $(cores_firstN_shuffled)`)
Stacktrace:
 [1] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:445 [inlined]
 [2] (::var"#5#10"{Int64, String, String, String, String, String})()
   @ Main ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:351
[ Info: Command: `likwid-pin -s 0xffffffffffffffe1 -C 2,0,1,3 -m /opt/julia-1.7.1/bin/julia -Cnative -J/opt/julia-1.7.1/lib/julia/sys.so --depwarn=yes --check-bounds=yes -g1 --color=yes --startup-file=no --project=/home/arpit/.julia/packages/LIKWID/pbxmY/test/.. -t4 /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl 2,0,1,3`
┌ Info: stdout:
│ No need to set mem_policy to membind, only one NUMA node available
│ Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl:31
│   Expression: procids == procids_glibc == cores
│    Evaluated: [0, 0, 0, 0] == [0, 0, 0, 0] == [2, 0, 1, 3]
└ [likwid-pin] Main PID -> hwthread 0 - OK
┌ Warning: stderr:
│ ERROR: LoadError: There was an error during testing
│ in expression starting at /home/arpit/.julia/packages/LIKWID/pbxmY/test/test_pin.jl:31
└ @ LIKWID ~/.julia/packages/LIKWID/pbxmY/src/misc.jl:85
test_pin.jl: Test Failed at /home/arpit/.julia/packages/LIKWID/pbxmY/test/runtests.jl:352
  Expression: exec(`$likwidpin -s $(maskstr) -C $(cores_rand) -m $julia --project=$(pkgdir) -t$(N) $(joinpath(testdir, f)) $(cores_rand)`)
Stacktrace:
 [1] macro expansion
   @ /opt/julia-1.7.1/share/julia/stdlib/v1.7/Test/src/Test.jl:445 [inlined]
 [2] (::var"#5#10"{Int64, String, String, String, String, String})()
   @ Main ~/.julia/packages/LIKWID/pbxmY/test/runtests.jl:352
Test Summary:                  | Pass  Fail  Total
LIKWID.jl                      |  170     5    175
  Topology                     |    5            5
  NUMA                         |    9            9
  Affinity                     |   13           13
  Timer                        |   14           14
  Thermal                      |    3            3
  Power / Energy               |   22           22
  Configuration                |    5            5
  Access / HPM                 |    5            5
  PerfMon                      |   53           53
  Misc                         |   37           37
  Marker API (CPU)             |    2     1      3
    test_marker.jl             |    1            1
    test_marker_convenience.jl |    1            1
    test_marker_noapi.jl       |          1      1
  Marker File Reader           |          1      1
  Pylikwid Example             |    1            1
  likwid-pin                   |          3      3
    test_pin.jl                |          3      3
  dynamic pinning              |    1            1
ERROR: LoadError: Some tests did not pass: 170 passed, 5 failed, 0 errored, 0 broken.
in expression starting at /home/arpit/.julia/packages/LIKWID/pbxmY/test/runtests.jl:61
ERROR: Package LIKWID errored during testing

@carstenbauer
Copy link
Member

Hey there,

not sure what's going on (and not much time currently to help you debugging this). But a few comments:

  • While it would be great to figure out why the test suite doesn't pass for you, let me note that I didn't spend much time on making sure it is "relocatable". I've only developed and tested it on the CI cluster in Erlangen and one other cluster in Paderborn. So, I'm not shocked to see it fail partially on a random user machine. As long as actual use cases work for you, I wouldn't worry too much. If you see failures for them, please file specific issues.
  • If you want to run ] test LIKWID you shouldn't need to start Julia in any special way (i.e. no need for likwid-perfctr ... etc.). We just use (almost) plain julia in CI as well, see https://github.com/JuliaPerf/LIKWID.jl/blob/main/.gitlab-ci.yml#L121

could not load library "liblikwid"
liblikwid.so: cannot open shared object file: No such file or directory

This shouldn't happen and is likely a problem with your setup / dl library path. LIKWID.jl doesn't do anything special here. It just assumes that the library liblikwid is available (you can check whether that's the case from within Julia by using Libdl's dllist and find_library). Apparently, in your case it is not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants