Skip to content

Commit

Permalink
Update accelerator/cuda_accelerator.py
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Wyatt <[email protected]>
  • Loading branch information
jeffra and mrwyattii authored Oct 12, 2023
1 parent 26c2bcd commit d7b0764
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions accelerator/cuda_accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ def __init__(self):
def _init_pynvml(self):
global pynvml
try:
import pynvml
import pynvml as tmp_pynvml
except ImportError:
return
try:
pynvml.nvmlInit()
except pynvml.NVMLError:
tmp_pynvml.nvmlInit()
pynvml = tmp_pynvml
except tmp_pynvml.NVMLError:
return

def is_synchronized_device(self):
Expand Down

0 comments on commit d7b0764

Please sign in to comment.