This patch enhances the official NVIDIA Driver Assistant (nvidia-driver-assistant) with advanced GPU detection, architecture-based driver compatibility checking, and improved safety features. The modifications focus on preventing incompatible driver installations while maintaining full backward compatibility.
- Automatic GPU Architecture Identification: Detects GPU architecture (Turing, Pascal, Maxwell, etc.) from device names
- Minimum Driver Requirements: Enforces architecture-specific minimum driver versions
- Compatibility Validation: Checks if requested driver branches are compatible with the GPU's architecture
- Legacy Branch Open Kernel Restriction: All legacy branches (71.86.xx to 580.xx) cannot use open kernel modules (configurable via
ENABLE_LEGACY_OPENKERNEL_RESTRICTION) - Architecture-Based Check Toggle: Enable/disable architecture-based open kernel checking via
ENABLE_ARCHITECTURE_CHECK - Strict Compatibility Mode: Prevents installation of drivers that don't support the GPU architecture
- Auto-fallback Mechanism: Automatically selects safe driver versions when incompatibility is detected
- Multiple Match Warning System: Informs users when multiple GPU models match the same device ID in database
- Mobile vs Desktop Detection: Better differentiation between laptop and desktop GPUs
- Subsystem Matching: Uses subsystem vendor/device IDs for more accurate GPU identification
- Multiple Match Resolution: Intelligently selects the best GPU match from multiple possibilities
- Multiple Match Warnings: Shows informative warnings when multiple models match, without affecting functionality
- Legacy Branch Correction: Fixed bug in supported driver range logic - legacy cards now consistently use JSON legacybranch as maximum version
- JSON Consistency: Fixed contradictory
supported_max_driverandlegacyvalues in JSON output - Backward Compatibility: Maintains compatibility with existing configurations
For better understanding of the code changes and implementation details, I'm sharing the complete modified Python script. This allows developers and maintainers to examine the full implementation beyond just the patch file.
Full script location: MOD-NDA.py (in repository root)
This complete script contains:
- All architecture detection logic
- Safety validation mechanisms
- GPU matching algorithms
- Distribution-specific override implementations
- Enhanced logging and debugging features
While the primary distribution method remains the patch file for packaging purposes, the full script is provided for transparency and to facilitate code review and understanding of the complete implementation.
# Check for recommended driver (dry run)
nvidia-driver-assistant
# Install recommended driver
nvidia-driver-assistant --install
# Show verbose output
nvidia-driver-assistant --verbose
# Simulate with specific GPU for testing
nvidia-driver-assistant --simulate-gpu 4070 --verbose# Specify driver branch
nvidia-driver-assistant --branch 545 --install
# Output JSON for automated tools
nvidia-driver-assistant --json
# MHWD mode (for Manjaro Hardware Detection)
nvidia-driver-assistant --mhwd
# Test with different distribution
nvidia-driver-assistant --distro ubuntu:22.04The script can be configured through these variables at the top of the script:
# 1. Non-legacy cards (no legacybranch in JSON)
# Set to override default driver branch for modern GPUs
DISTRO_NON_LEGACY_DEFAULT_BRANCH = None # e.g., "545", "550"
# 2. 580+ legacy branch cards
# Set to override 580+ legacy cards to older compatible branches
DISTRO_580_LEGACY_OVERRIDE_BRANCH = None # e.g., "470", "390"
# 3. Old variable - backward compatibility (deprecated)
# Overrides ALL legacy cards regardless of architecture
DISTRO_LEGACY_OVERRIDE_BRANCH = None
# Legacy branch open kernel restriction
ENABLE_LEGACY_OPENKERNEL_RESTRICTION = True
# Architecture-based open kernel check toggle
ENABLE_ARCHITECTURE_CHECK = True
# Safety features
ENABLE_STRICT_COMPATIBILITY = True
REQUIRE_CONFIRMATION = False
AUTO_FALLBACK = TrueSince this is a patch file, you should apply it to the original nvidia-driver-assistant script:
- Apply the patch:
patch -p1 < nvidia-driver-assistant-enhanced.patch- Package structure:
/usr/bin/nvidia-driver-assistant
/usr/share/nvidia-driver-assistant/supported-gpus/supported-gpus.json
- Build the Manjaro package using your standard packaging tools.
The enhanced script maintains all original dependencies and adds no new ones.
When new NVIDIA GPU architectures are released (e.g., after Blackwell), follow these steps:
In the ARCHITECTURE_MIN_DRIVER dictionary, add the new architecture:
ARCHITECTURE_MIN_DRIVER = {
"new_architecture": "550", # Minimum driver version
# ... existing architectures
}OPEN_CAPABLE_ARCHS = ("turing", "ampere", "ada", "blackwell", "new_architecture")
OPEN_UNSUPPORTED_ARCHS = (
"maxwell", "pascal", "volta", "fermi", "kepler",
"tesla2", "tesla1", "curie", "pre-curie", "unknown"
)In the _get_architecture_from_device_name method, add patterns for the new architecture:
arch_patterns = {
"new_architecture": ["NEWARCH", "NA", "RTX 60", "6090", "6080"],
# ... existing patterns
}simulated_gpus = {
"6090": {
"modalias": "pci:v000010DEd00003A01sv000010DEsd000018FEbc03sc00i00",
"expected_name": "GeForce RTX 6090",
"expected_devid": "0x3A01",
"expected_arch": "new_architecture",
"expected_legacy": None
},
# ... existing simulations
}The script uses NVIDIA's supported-gpus.json database. When new GPUs are released:
- NVIDIA will update their database
- Update the
supported-gpus.jsonfile in the package - Test with simulated GPUs to ensure proper detection
The script validates that:
- The driver version is ≥ the architecture's minimum requirement
- The driver version is ≤ the maximum supported (for legacy cards)
- Open kernel modules are only recommended for supported architectures
All legacy branches from 71.86.xx to 580.xx cannot use open kernel modules:
- Detects legacybranch value from JSON
- Prevents open kernel usage for legacy branches ≤ 580
- Legacy branches above 580 are not restricted (future-proofing)
When multiple GPU models match the same device ID:
- Shows informative warning to user
- Explains that driver selection is unaffected
- Lists all possible matching models
- Warnings suppressed in MHWD mode and JSON output
When incompatibility is detected:
- Logs the error with detailed information
- Automatically selects a safe driver version
- Continues with installation using the safe version
-
"Unknown architecture" warnings
- The GPU name couldn't be parsed
- Check if the GPU is in
supported-gpus.json - The script will still work with default "unknown" handling
-
Compatibility errors during installation
- The requested driver doesn't support your GPU architecture
- Enable verbose mode (
--verbose) for details - Consider using the auto-fallback feature
-
Multiple match warnings
- Informational only - does not affect functionality
- Can be suppressed with
--jsonor--mhwdflags - Shows the program is working correctly with complex GPU databases
-
Mobile GPU detection issues
- Some desktop GPUs with "M" in the name might be misclassified
- The script has exception lists for common desktop GPUs
- Can be overridden via distribution-specific variables
For detailed debugging:
nvidia-driver-assistant --verbose --simulate-gpu <GPU_TYPE>Replace <GPU_TYPE> with one of: 545, 740A, 750, 800A, 4070, 5070, unknown
When extending this script:
- Maintain backward compatibility - don't break existing functionality
- Add thorough logging - use
logging.debug()for internal logic - Update simulated GPU data for testing new features
- Test with multiple distributions - especially Manjaro and Arch
- Consider safety implications - driver incompatibilities can break systems
This project is based on NVIDIA tooling released under the MIT License.
Original work: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES
Downstream modifications were made by the Manjaro Team. Further maintenance and enhancements by Gábor Gyöngyösi (@megvadulthangya).
See the LICENSE file and the script header for full license details.
- Original Author: Alberto Milone (NVIDIA)
- Manjaro Team: Packaging and distribution adjustments
- Gábor Gyöngyösi (@megvadulthangya): Enhancements and maintenance
For issues with this enhanced version:
- Check the troubleshooting section above
- Enable verbose mode for detailed logs
- Test with simulated GPUs to isolate issues
- Contact the package maintainer for distribution-specific issues
Note: This enhanced version is designed to be a drop-in replacement for the original nvidia-driver-assistant. All original functionality is preserved while adding safety features and improved detection.
Version: 2026.01.05.1-1