Skip to content

Commit

Permalink
evc: fix cuda osx
Browse files Browse the repository at this point in the history
  • Loading branch information
dendenxu committed Apr 6, 2024
1 parent 4049908 commit 95547ce
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions easyvolcap/runners/volumetric_video_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,10 +1240,14 @@ def get_device_and_memory(self):
first_run = 'last_memory_update' not in self.static
curr_time = time.perf_counter()
if first_run or curr_time - self.static.last_memory_update > self.update_mem_time:
self.static.name = torch.cuda.get_device_name()
# self.static.device = next(self.model.parameters()).device
self.static.device = torch.cuda.current_device()
self.static.memory = torch.cuda.max_memory_allocated()
try:
self.static.name = torch.cuda.get_device_name()
self.static.device = torch.cuda.current_device()
self.static.memory = torch.cuda.max_memory_allocated()
except:
self.static.name = 'Unsupported'
self.static.device = 'Unsupported'
self.static.memory = 'Unsupported'
self.static.last_memory_update = curr_time
return self.static.name, self.static.device, self.static.memory

Expand Down

0 comments on commit 95547ce

Please sign in to comment.