-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation; add CUDA check script (#99)
- Loading branch information
Robert Muchsel
authored
Aug 9, 2021
1 parent
0c15f35
commit 7a3b099
Showing
4 changed files
with
177 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
################################################################################################### | ||
# Copyright (C) Maxim Integrated Products, Inc. All Rights Reserved. | ||
# | ||
# Maxim Integrated Products, Inc. Default Copyright Notice: | ||
# https://www.maximintegrated.com/en/aboutus/legal/copyrights.html | ||
################################################################################################### | ||
""" | ||
Check whether PyTorch supports CUDA hardware acceleration. | ||
""" | ||
import signal | ||
import sys | ||
|
||
import torch | ||
|
||
|
||
def signal_handler( | ||
_signal, | ||
_frame, | ||
): | ||
""" | ||
Ctrl+C handler | ||
""" | ||
sys.exit(0) | ||
|
||
|
||
if __name__ == '__main__': | ||
signal.signal(signal.SIGINT, signal_handler) | ||
|
||
print("System: ", sys.platform) | ||
print("Python version: ", sys.version.replace('\n', '')) | ||
print("PyTorch version: ", torch.__version__) | ||
print("CUDA acceleration: ", end='') | ||
|
||
if not torch.cuda.is_available(): | ||
print("NOT available in PyTorch") | ||
else: | ||
print("available in PyTorch") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters