Skip to content

Commit 942f8eb

Browse files
committed
adjusting structure some
1 parent d766a6e commit 942f8eb

File tree

5 files changed

+68
-0
lines changed

5 files changed

+68
-0
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

cuda_checker.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import subprocess
2+
import sys
3+
4+
5+
def run_command(command):
6+
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
7+
return result.stdout, result.stderr
8+
9+
10+
print("Checking CUDA installation:")
11+
stdout, stderr = run_command("nvcc --version")
12+
if stdout:
13+
print(stdout)
14+
else:
15+
print("nvcc not found in PATH. CUDA might not be installed or not in PATH.")
16+
print("Error:", stderr)
17+
18+
print("\nChecking cuDNN:")
19+
stdout, stderr = run_command("where cudnn64_8.dll")
20+
if stdout:
21+
print("cuDNN found:", stdout)
22+
else:
23+
print("cuDNN not found in PATH.")
24+
print("Error:", stderr)
25+
26+
print("\nPython executable:")
27+
print(sys.executable)
28+
29+
print("\nPython version:")
30+
print(sys.version)

torch_checker.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import os
2+
3+
import torch
4+
5+
print(f"PyTorch version: {torch.__version__}")
6+
print(f"CUDA available: {torch.cuda.is_available()}")
7+
print(f"CUDA version: {torch.version.cuda}")
8+
if torch.cuda.is_available():
9+
print(f"CUDNN version: {torch.backends.cudnn.version()}")
10+
print(f"Number of GPUs: {torch.cuda.device_count()}")
11+
print(f"Current GPU: {torch.cuda.get_device_name(torch.cuda.current_device())}")
12+
13+
print("\nEnvironment variables:")
14+
for key, value in os.environ.items():
15+
if "cuda" in key.lower() or "gpu" in key.lower() or "nvidia" in key.lower():
16+
print(f"{key}: {value}")
17+
18+
print("\nCUDA library path:")
19+
try:
20+
print(torch.utils.cpp_extension.CUDA_HOME)
21+
except:
22+
print("CUDA_HOME not found")
23+
24+
if not torch.cuda.is_available():
25+
print("\nChecking CUDA libraries:")
26+
try:
27+
import ctypes
28+
29+
ctypes.CDLL("nvcuda.dll")
30+
print("nvcuda.dll loaded successfully")
31+
except:
32+
print("Failed to load nvcuda.dll")
33+
34+
try:
35+
ctypes.CDLL("cudart64_110.dll")
36+
print("cudart64_110.dll loaded successfully")
37+
except:
38+
print("Failed to load cudart64_110.dll")

0 commit comments

Comments
 (0)