-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck_gpu.py
More file actions
21 lines (18 loc) · 827 Bytes
/
check_gpu.py
File metadata and controls
21 lines (18 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# --- File: check_gpu.py ---
import spacy
print("--- GPU Check for spaCy ---")
try:
# The spacy.require_gpu() function is the key.
# It will try to initialize the GPU and will raise an error if it can't.
spacy.require_gpu()
print("\nSUCCESS: GPU is available and spaCy can use it!")
print("Your Redleaf application is correctly configured for GPU acceleration.")
except Exception as e:
print("\nFAILURE: spaCy could not access the GPU.")
print("This is why you are not seeing GPU engagement.")
print("\n--- Error Details ---")
print(e)
print("\n--- Next Steps ---")
print("This usually means there's an issue with the CUDA or CuPy installation.")
print("Please ensure your NVIDIA drivers are up to date and re-check the installation steps.")
print("-------------------------")