You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/profile.jl
+86-16Lines changed: 86 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -169,7 +169,7 @@ function find_nsys()
169
169
returnENV["_"]
170
170
else
171
171
# look at a couple of environment variables that may point to NSight
172
-
nsight=nothing
172
+
nsys=nothing
173
173
for var in ("LD_PRELOAD", "CUDA_INJECTION64_PATH", "NVTX_INJECTION64_PATH")
174
174
haskey(ENV, var) ||continue
175
175
for val insplit(ENV[var], Sys.iswindows() ?';':':')
@@ -186,22 +186,57 @@ function find_nsys()
186
186
error("Running under Nsight Systems, but could not find the `nsys` binary to start the profiler. Please specify using JULIA_CUDA_NSYS=path/to/nsys, and file an issue with the contents of ENV.")
@error"Failed to find the active profiling session ($(nsys_session())) in the session list:\n"*read(`$(nsys()) sessions list`, String) *"\n\nPlease file an issue." exception=(err,catch_backtrace())
286
+
end
287
+
288
+
# it takes a while for the profiler to attach to our process
217
289
sleep(0.01)
218
290
end
291
+
292
+
# actually start the capture
219
293
CUDA.cuProfilerStart()
220
294
end
221
295
@@ -227,10 +301,6 @@ profiling is already disabled, then this call has no effect.
227
301
"""
228
302
functionstop()
229
303
CUDA.cuProfilerStop()
230
-
ifnsight() !==nothing
231
-
@info"""Profiling has finished, open the report listed above with `nsys-ui`
232
-
If no report was generated, try launching `nsys` with `--trace=cuda`"""
0 commit comments