SoyVitou commited on
Commit
24ef614
·
verified ·
1 Parent(s): 5d3851a

Add comprehensive installation guide with troubleshooting

Browse files
Files changed (1) hide show
  1. INSTALLATION_GUIDE.md +128 -0
INSTALLATION_GUIDE.md ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PyTorch Python 3.10 Installation Guide
2
+
3
+ ## 🚀 Quick Start
4
+
5
+ ### Option 1: Automated Setup (Recommended)
6
+
7
+ ```bash
8
+ # 1. Create conda environment
9
+ conda create -n pytorch_env python=3.10
10
+ conda activate pytorch_env
11
+
12
+ # 2. Download repository
13
+ git clone https://huggingface.co/RDHub/pytorch_python_310
14
+ cd pytorch_python_310
15
+
16
+ # 3. Install all packages
17
+ pip install -r lib_wheel/requirements.txt --find-links lib_wheel --no-index
18
+
19
+ # 4. Set up CUDA libraries
20
+ bash setup_cuda_libs.sh
21
+
22
+ # 5. Test installation
23
+ python -c "import torch; print(f'PyTorch {torch.__version__} - CUDA: {torch.cuda.is_available()}')"
24
+ ```
25
+
26
+ ### Option 2: Manual Setup
27
+
28
+ ```bash
29
+ # 1. Install packages
30
+ pip install -r lib_wheel/requirements.txt --find-links lib_wheel --no-index
31
+
32
+ # 2. Create CUDA library activation script
33
+ mkdir -p $CONDA_PREFIX/etc/conda/activate.d
34
+ cat > $CONDA_PREFIX/etc/conda/activate.d/pytorch_cuda_libs.sh << 'EOF'
35
+ #!/bin/bash
36
+ NVIDIA_LIB_PATH=$(find $CONDA_PREFIX -path "*/nvidia/*/lib" -type d 2>/dev/null | tr '\n' ':')
37
+ CUSPARSELT_LIB_PATH=$(find $CONDA_PREFIX -path "*/cusparselt/lib" -type d 2>/dev/null | tr '\n' ':')
38
+ export LD_LIBRARY_PATH="${NVIDIA_LIB_PATH}${CUSPARSELT_LIB_PATH}${LD_LIBRARY_PATH}"
39
+ EOF
40
+ chmod +x $CONDA_PREFIX/etc/conda/activate.d/pytorch_cuda_libs.sh
41
+
42
+ # 3. Reactivate environment
43
+ conda deactivate && conda activate your_env_name
44
+ ```
45
+
46
+ ## ✅ What's Included
47
+
48
+ - **PyTorch 2.7.1** with CUDA 12.6 support
49
+ - **Transformers 4.52.3** for HuggingFace models
50
+ - **NumPy 2.0.2** (compatible with OpenCV)
51
+ - **OpenCV 4.10.0** for computer vision
52
+ - **80+ compatible packages** tested together
53
+ - **NVIDIA CUDA libraries** (12.6.x series)
54
+
55
+ ## 🧪 Testing Your Installation
56
+
57
+ ```python
58
+ import torch
59
+ import transformers
60
+ import numpy as np
61
+ import cv2
62
+
63
+ # Test PyTorch CUDA
64
+ print(f"PyTorch: {torch.__version__}")
65
+ print(f"CUDA Available: {torch.cuda.is_available()}")
66
+ if torch.cuda.is_available():
67
+ print(f"GPU: {torch.cuda.get_device_name(0)}")
68
+
69
+ # Test basic operations
70
+ x = torch.randn(100, 100).cuda()
71
+ y = torch.matmul(x, x.T)
72
+ print("✅ GPU tensor operations working!")
73
+
74
+ # Test transformers
75
+ from transformers import AutoTokenizer
76
+ tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
77
+ print("✅ Transformers working!")
78
+
79
+ print(f"NumPy: {np.__version__}")
80
+ print(f"OpenCV: {cv2.__version__}")
81
+ ```
82
+
83
+ ## 🔧 Troubleshooting
84
+
85
+ ### Issue: "libcufile.so.0: cannot open shared object file"
86
+
87
+ **Solution:** Run the CUDA setup script:
88
+ ```bash
89
+ bash setup_cuda_libs.sh
90
+ conda deactivate && conda activate your_env_name
91
+ ```
92
+
93
+ ### Issue: "libcusparseLt.so.0: cannot open shared object file"
94
+
95
+ **Solution:** Ensure all NVIDIA packages are installed:
96
+ ```bash
97
+ pip install --force-reinstall lib_wheel/nvidia_cusparselt_cu12-*.whl
98
+ pip install --force-reinstall lib_wheel/nvidia_cufile_cu12-*.whl
99
+ ```
100
+
101
+ ### Issue: OpenCV + NumPy compatibility errors
102
+
103
+ **Solution:** Use the exact versions provided:
104
+ ```bash
105
+ pip install --force-reinstall lib_wheel/numpy-2.0.2-*.whl
106
+ pip install --force-reinstall lib_wheel/opencv_python-4.10.0.84-*.whl
107
+ ```
108
+
109
+ ## 📋 System Requirements
110
+
111
+ - **OS:** Linux x86_64 (Ubuntu 22.04+ recommended)
112
+ - **Python:** 3.10
113
+ - **CUDA:** Compatible with 12.2+ (12.6 optimal)
114
+ - **Conda:** Required for library path management
115
+ - **Storage:** ~2GB for all wheels
116
+
117
+ ## 🎯 Verified Configurations
118
+
119
+ ✅ **Ubuntu 22.04** + Python 3.10 + CUDA 12.2
120
+ ✅ **Ubuntu 22.04** + Python 3.10 + CUDA 12.6
121
+ ✅ **RTX 4090** + CUDA 12.6
122
+ ✅ **Conda environments**
123
+
124
+ ## 🔗 Resources
125
+
126
+ - **Repository:** https://huggingface.co/RDHub/pytorch_python_310
127
+ - **PyTorch Docs:** https://pytorch.org/docs/
128
+ - **CUDA Toolkit:** https://developer.nvidia.com/cuda-toolkit