support nvgpu event - #210
Conversation
34863d6 to
52d6d4d
Compare
Use nvml library to report nvgpu event. New environment NVGPU_DISABLE_EVENT indicate registered events. Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
| @@ -0,0 +1,77 @@ | |||
| import re | |||
There was a problem hiding this comment.
Explicitly add Python env:
#!/usr/bin/env python
There was a problem hiding this comment.
Please use:
#!/usr/bin/env python3
As some distributions don't provide a python -> python3 alias.
| flags=re.MULTILINE | ||
| ) | ||
|
|
||
| with open(PATH, 'r') as file: |
There was a problem hiding this comment.
add exception handling, e.g:
try:
with open(PATH, 'r') as file:
content = file.read()
except FileNotFoundError:
print(f"Error: File {PATH} not found.")
exit(1)
except IOError as e:
print(f"Error reading file {PATH}: {e}")
exit(1)
|
|
||
| #ifdef HAVE_NVGPU | ||
| if (nvgpu_enable) | ||
| pthread_cancel(nvgpu_thread); |
There was a problem hiding this comment.
Ensure thread cancellation is handled safely, Join with thread to see what its exit status was.
pthread_cancel(nvgpu_thread);
pthread_join(nvgpu_thread, NULL); // Wait for thread to terminate
|
Patch breaks when cuda is not loaded: File "rasdaemon/contrib/nvml.py", line 25, in Also:
|
Use nvml library to report nvgpu event. New environment NVGPU_EVENT_TYPES indicate registered events.
rasdaemon print like follow: