forked from samtools/samtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_configure_behavior.sh
More file actions
executable file
·97 lines (89 loc) · 3.29 KB
/
Copy pathtest_configure_behavior.sh
File metadata and controls
executable file
·97 lines (89 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# Test script to simulate the enhanced CUDA auto-detection logic
echo "=== Simulating Enhanced Configure Script Behavior ==="
echo ""
# Step 1: Check for GPU hardware
echo "Checking for NVIDIA GPU hardware..."
gpu_detected=0
# Method 1: nvidia-smi
if command -v nvidia-smi >/dev/null 2>&1; then
gpu_count=$(nvidia-smi -L 2>/dev/null | wc -l)
if [ "$gpu_count" -gt 0 ]; then
gpu_detected=1
echo "✓ Found $gpu_count NVIDIA GPU(s) via nvidia-smi"
fi
fi
# Method 2: /proc/driver/nvidia
if [ "$gpu_detected" -eq 0 ] && [ -d "/proc/driver/nvidia" ]; then
if [ -r "/proc/driver/nvidia/version" ]; then
gpu_detected=1
echo "✓ NVIDIA driver detected in /proc/driver/nvidia"
fi
fi
# Method 3: lspci
if [ "$gpu_detected" -eq 0 ] && command -v lspci >/dev/null 2>&1; then
nvidia_devices=$(lspci 2>/dev/null | grep -i "nvidia.*\(vga\|3d\|display\)" | wc -l)
if [ "$nvidia_devices" -gt 0 ]; then
gpu_detected=1
echo "✓ Found $nvidia_devices NVIDIA device(s) via lspci"
fi
fi
if [ "$gpu_detected" -eq 0 ]; then
echo ""
echo "=========================================="
echo "Configure would output:"
echo "=========================================="
echo "checking for NVIDIA GPU hardware... no"
echo ""
echo "================================================================="
echo "No NVIDIA GPU hardware detected on this system."
echo "CUDA GPU acceleration will be disabled."
echo ""
echo "If you have an NVIDIA GPU:"
echo " 1. Install NVIDIA drivers: https://www.nvidia.com/drivers"
echo " 2. Install CUDA toolkit: https://developer.nvidia.com/cuda-downloads"
echo " 3. Reconfigure with: ./configure --enable-cuda"
echo ""
echo "If you want to use CPU-only mode, this is normal."
echo "================================================================="
echo ""
echo "Result: enable_cuda=no"
echo ""
echo "Final configuration:"
echo " CUDA support: disabled"
echo " Build type: CPU-only"
echo " GPU acceleration: no"
echo ""
echo "You can now run 'make' to build samtools with CPU-only acceleration."
exit 0
fi
# If GPU detected, check CUDA software
echo "✓ NVIDIA GPU detected"
echo ""
echo "Checking for CUDA software stack..."
if command -v nvcc >/dev/null 2>&1; then
echo "✓ CUDA compiler (nvcc) found"
# Would continue with CUDA functionality test...
echo "✓ CUDA test would be performed here"
echo ""
echo "Result: enable_cuda=yes"
else
echo "✗ CUDA compiler (nvcc) not found"
echo ""
echo "=========================================="
echo "Configure would output:"
echo "=========================================="
echo ""
echo "================================================================="
echo "NVIDIA GPU detected but CUDA toolkit not installed."
echo ""
echo "To enable GPU acceleration:"
echo " 1. Install CUDA toolkit: https://developer.nvidia.com/cuda-downloads"
echo " 2. Make sure 'nvcc' is in your PATH"
echo " 3. Reconfigure with: ./configure --enable-cuda"
echo ""
echo "Building without GPU acceleration for now."
echo "================================================================="
echo ""
echo "Result: enable_cuda=no"
fi