Skip to content

Commit b77b071

Browse files
committed
try catch block in gpusupport check
1 parent a9aaa4b commit b77b071

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/misc.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ end
4949

5050
function _check_likwid_gpusupport()
5151
# Set `ZES_ENABLE_SYSMAN` to work around https://github.com/open-mpi/ompi/issues/10142
52-
withenv("ZES_ENABLE_SYSMAN" => "1") do
53-
dlopen(liblikwid) do handle
54-
return !isnothing(dlsym(handle, :likwid_gpuMarkerInit; throw_error=false))
52+
try
53+
withenv("ZES_ENABLE_SYSMAN" => "1") do
54+
dlopen(liblikwid) do handle
55+
return !isnothing(dlsym(handle, :likwid_gpuMarkerInit; throw_error=false))
56+
end
5557
end
58+
catch err
59+
return false
5660
end
5761
end
5862

@@ -256,4 +260,4 @@ LIKWID_FILEPATH(path::AbstractString) = ENV["LIKWID_FILEPATH"] = path;
256260
LIKWID_MODE(mode) = ENV["LIKWID_MODE"] = mode;
257261
LIKWID_EVENTS(eventstr::AbstractString) = ENV["LIKWID_EVENTS"] = eventstr;
258262
LIKWID_THREADS(cpustr::AbstractString) = ENV["LIKWID_THREADS"] = cpustr;
259-
LIKWID_MPI_CONNECT(x::AbstractString) = ENV["LIKWID_MPI_CONNECT"] = x;
263+
LIKWID_MPI_CONNECT(x::AbstractString) = ENV["LIKWID_MPI_CONNECT"] = x;

0 commit comments

Comments
 (0)