Skip to content

Commit 3e66a58

Browse files
committed
add the fix to avoid block CUDA device
1 parent 4877579 commit 3e66a58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

accelerator/real_accelerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_accelerator():
144144
# Currently we can run on xpu device only using pytorch,
145145
# also reserve the old path using ipex when the torch version is old.
146146
if hasattr(torch, 'xpu'):
147-
if torch.xpu.device_count() > 0 and torch.xpu.is_available():
147+
if torch.cuda.device_count() == 0 and torch.xpu.device_count() > 0 and torch.xpu.is_available():
148148
accelerator_name = "xpu"
149149
else:
150150
pass

0 commit comments

Comments
 (0)