A repository exploring the challenges and solutions for installing NVIDIA GPU-accelerated TensorFlow on Ubuntu systems.
Installing NVIDIA driver + dependencies for GPU-compiled TensorFlow (NDGPUTF) on Ubuntu is really challenging. Is this difficulty itself a kind of intelligence test?
This repository explores the question: Can TensorFlow CPU be used to bootstrap a fault-tolerant GPU-supported TensorFlow installation?
- Architecture
- Installation Workflow
- Bootstrap Concept
- System Requirements
- Repository Contents
- Getting Started
- Neural Network Approach
graph TB
subgraph "Application Layer"
TF[TensorFlow GPU]
end
subgraph "Deep Learning Libraries"
CUDNN[cuDNN Library]
end
subgraph "CUDA Toolkit"
CUDA[CUDA Runtime<br/>libcudart.so]
CUDALIB[CUDA Libraries]
end
subgraph "Driver Layer"
NVDRIVER[NVIDIA Driver<br/>nvidia-smi]
end
subgraph "Hardware"
GPU[GPU Hardware<br/>GeForce GTX 1050]
end
TF -->|depends on| CUDNN
TF -->|depends on| CUDA
CUDNN -->|depends on| CUDA
CUDA -->|depends on| NVDRIVER
NVDRIVER -->|controls| GPU
style TF fill:#4CAF50
style CUDNN fill:#2196F3
style CUDA fill:#FF9800
style NVDRIVER fill:#F44336
style GPU fill:#9C27B0
graph LR
subgraph "Installation Components"
A[Ubuntu 18.04+]
B[Python 3.x]
C[pip/virtualenv]
end
subgraph "NVIDIA Stack"
D[NVIDIA Driver]
E[CUDA Toolkit 10.0+]
F[cuDNN 7.4+]
end
subgraph "TensorFlow Options"
G[TensorFlow CPU]
H[TensorFlow GPU]
end
A --> B
B --> C
C --> G
A --> D
D --> E
E --> F
F --> H
G -.->|Bootstrap Helper?| H
style G fill:#81C784
style H fill:#4CAF50
flowchart TD
Start([Start Installation]) --> CheckOS{Ubuntu 18.04+<br/>Compatible?}
CheckOS -->|No| UpgradeOS[Upgrade OS]
CheckOS -->|Yes| CheckGPU{NVIDIA GPU<br/>Present?}
UpgradeOS --> CheckGPU
CheckGPU -->|No| CPUOnly[Install TensorFlow CPU Only]
CheckGPU -->|Yes| InstallDriver[Install NVIDIA Driver]
InstallDriver --> VerifyDriver{nvidia-smi<br/>Working?}
VerifyDriver -->|No| TroubleshootDriver[Troubleshoot Driver<br/>- Secure Boot<br/>- Kernel Modules<br/>- Conflicts]
VerifyDriver -->|Yes| InstallCUDA[Install CUDA Toolkit]
TroubleshootDriver --> VerifyDriver
InstallCUDA --> VerifyCUDA{CUDA Libraries<br/>Found?}
VerifyCUDA -->|No| FixCUDAPath[Fix LD_LIBRARY_PATH]
VerifyCUDA -->|Yes| GetCUDNN{cuDNN Available?}
FixCUDAPath --> VerifyCUDA
GetCUDNN -->|No| RegisterNVIDIA[Register NVIDIA Developer<br/>Download cuDNN]
GetCUDNN -->|Yes| InstallCUDNN[Install cuDNN]
RegisterNVIDIA --> InstallCUDNN
InstallCUDNN --> SetupPython[Setup Python virtualenv]
SetupPython --> InstallTFGPU[pip install tensorflow-gpu]
InstallTFGPU --> TestImport{TensorFlow<br/>Imports?}
TestImport -->|No| DebugTF[Debug:<br/>- Version conflicts<br/>- Missing libraries<br/>- Path issues]
TestImport -->|Yes| TestGPU{GPU Detected<br/>by TF?}
DebugTF --> InstallTFGPU
TestGPU -->|No| CheckCompatibility[Check Version Compatibility:<br/>TF - CUDA - cuDNN]
TestGPU -->|Yes| Success([✓ Success!<br/>GPU TensorFlow Ready])
CheckCompatibility --> InstallTFGPU
CPUOnly --> End([TensorFlow CPU Installation])
style Start fill:#4CAF50
style Success fill:#4CAF50
style End fill:#81C784
style TroubleshootDriver fill:#FF9800
style DebugTF fill:#FF9800
style CheckCompatibility fill:#FF9800
flowchart LR
subgraph "Phase 1: CPU Bootstrap"
A[Install TensorFlow CPU] --> B[Create Diagnostic Script]
B --> C[Analyze System State]
C --> D[Generate Installation Plan]
end
subgraph "Phase 2: Intelligence Layer"
D --> E[Neural Network Analysis]
E --> F{Predict Success<br/>Probability}
end
subgraph "Phase 3: GPU Installation"
F -->|High Confidence| G[Automated GPU Setup]
F -->|Low Confidence| H[Guided Manual Setup]
G --> I[Verify Installation]
H --> I
I --> J{Validation<br/>Passed?}
end
subgraph "Phase 4: Fault Tolerance"
J -->|No| K[ML-Based Debugging]
J -->|Yes| L[Production Ready]
K --> M[Suggest Fixes]
M --> I
end
style A fill:#81C784
style E fill:#2196F3
style G fill:#4CAF50
style L fill:#4CAF50
style K fill:#FF9800
graph TD
Start{What's Your Goal?}
Start -->|Just Learning TF| CPU[Use TensorFlow CPU<br/>✓ Quick Setup<br/>✓ No GPU Required]
Start -->|Production/Training| GPU{Have NVIDIA GPU?}
GPU -->|No| CPU
GPU -->|Yes| Experience{Installation<br/>Experience?}
Experience -->|Beginner| Bootstrap[Use Bootstrap Approach<br/>1. Install TF-CPU<br/>2. Run diagnostics<br/>3. Follow guided setup]
Experience -->|Advanced| Manual[Manual Installation<br/>1. NVIDIA Driver<br/>2. CUDA Toolkit<br/>3. cuDNN<br/>4. TensorFlow-GPU]
Bootstrap --> Validate{Installation<br/>Successful?}
Manual --> Validate
Validate -->|Yes| Success[✓ GPU-Accelerated<br/>TensorFlow Ready]
Validate -->|No| Debug[Use tf_env.txt<br/>for Debugging]
Debug --> Retry{Try Again?}
Retry -->|Yes| Bootstrap
Retry -->|No| CPU
style CPU fill:#81C784
style Success fill:#4CAF50
style Bootstrap fill:#2196F3
style Debug fill:#FF9800
The repository was tested on the following system:
OS: Ubuntu 18.10 cosmic
Kernel: x86_64 Linux 4.18.0-15-generic
CPU: AMD Ryzen 5 1600X Six-Core @ 12x 4GHz
GPU: GeForce GTX 1050
RAM: 16 GB (8732MiB available)
Resolution: 2560x1080
DE: LXDE
WM: OpenBox
| Component | Version | Notes |
|---|---|---|
| NVIDIA Driver | Latest | Use nvidia-smi to verify |
| CUDA Toolkit | 10.0+ | Multiple versions can coexist |
| cuDNN | 7.4.2+ | Requires NVIDIA Developer Account |
| TensorFlow-GPU | 1.12.0+ | Must match CUDA/cuDNN versions |
README.md- This filetf_env.txt- Environment diagnostic output showing:- System configuration
- CUDA library locations
- TensorFlow installation status
- Virtual environment setup
- nvidia-smi output
cp_pbashscript.sh- Copy utility with progress bar- Useful for copying large CUDA/cuDNN files
- Shows real-time progress using
straceandawk
LICENSE- Repository license
The tf_env.txt file demonstrates two states:
-
Before Installation:
- TensorFlow not found
- nvidia-smi failing
- No virtualenv
-
After Installation:
- TensorFlow 1.12.0 working
- Virtualenv active
- Still some driver issues (common on VMs)
# Install TensorFlow CPU
pip install tensorflow
# Verify installation
python -c "import tensorflow as tf; print(tf.__version__)"Reference: TensorFlow Installation Guide
-
Install NVIDIA Driver
# Check current driver nvidia-smi # If needed, install driver sudo apt install nvidia-driver-XXX
-
Install CUDA Toolkit
# Download from NVIDIA website # Install CUDA 10.0+
-
Install cuDNN
- Register at NVIDIA Developer Program
- Download
libcudnn7-dev_7.4.2.24-1+cuda10.0_amd64.deb - Install the package
-
Install TensorFlow GPU
pip install tensorflow-gpu
-
Verify GPU Detection
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
- Start with CPU TensorFlow to validate Python environment
- Use diagnostic scripts to check system compatibility
- Install GPU components incrementally
- Use TensorFlow CPU to test each step
Question: Can a neural network guide the TensorFlow GPU installation process?
Proposed Architecture: Convolutional Neural Network (CNN)
- OS version and kernel
- System uptime and packages
- Shell and desktop environment
- CPU specifications
- GPU model and capabilities
- RAM availability
- Current driver status
- CUDA library presence
- Installation commands sequence
- Probability of success
- Potential failure points
- Recommended troubleshooting steps
- Successful installation logs
- Failed installation attempts
- System configurations
- Version compatibility matrices
"The neural network that would need to be generated for the Ubuntu Linux system would be a Convolutional Neural Network (CNN). The input to the CNN would be information about the OS, kernel, uptime, packages, shell, resolution, DE, WM, CPU, GPU and RAM of the system. The output of the network would be installation commands for setting up a bare metal GPU supported TensorFlow instance."
This repository explores several interesting questions:
-
Is installation difficulty a feature?
- Does the complexity serve as a barrier to entry?
- Could AI assistance democratize GPU computing?
-
Can TensorFlow CPU bootstrap TensorFlow GPU?
- Use CPU version for diagnostics
- Generate installation scripts
- Predict compatibility issues
- Automated troubleshooting
-
Cross-platform bootstrapping
- Can same approach work for AMD GPU (ROCm)?
- Generalize to other accelerators (TPU, Intel GPU)?
-
What are Neural Networks good for?
- Can they solve their own installation problems?
- Meta-learning: AI helping install AI frameworks
Contributions welcome! Areas of interest:
- Automated diagnostic scripts
- Neural network training data collection
- Installation success predictor model
- AMD ROCm bootstrap approach
- Docker containerization strategy
- Version compatibility database
See LICENSE file for details.
- TensorFlow Official Installation Guide
- NVIDIA CUDA Toolkit Documentation
- cuDNN Installation Guide
- Review
tf_env.txtfor detailed environment diagnostics
Note: NVIDIA Developer Account required for downloading cuDNN libraries.