Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fedora): add nvidia proprietary driver setup script #319

Closed
wants to merge 9 commits into from

Conversation

harshv5094
Copy link
Contributor

@harshv5094 harshv5094 commented Sep 9, 2024

Pull Request

Type of Change

  • New feature

Description

This script allows fedora user to install and remove proprietary NVIDIA drivers properly, without locking their system to infinity state on startup.

Testing

  • Tested this script on my personal laptop with Fedora 40 running.
  • I've run this script multiple times to check if the driver is working properly.

Additional Information

  • After installing the NVIDIA driver, before rebooting, the user need to keep their system on for up to 5 min to build drivers properly. then you need to run this command to check if your driver is installed properly or not.
modinfo -F version nvidia
  • So I've already implemented a solution for this in my script. I added a sleep timer for up to 4 minutes, so that the drivers can build in that time. Then it run above command to check if the driver number is showing or not.
  • I've also added instruction in my script for what to do if installation doesn't work.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no errors/warnings/merge conflicts.

This script allows us to install/remove nvidia driver in fedora system
safely.
Copy link
Contributor

@jeevithakannan2 jeevithakannan2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've refactored the scripts to remove most of the Bash-specific notations and ensure they are POSIX-compliant (sh). Please review the changes. You can also checkout my https://github.com/jeevithakannan2/linutil/tree/fedora-nvidia for your reference for this PR

with the help of @jeevithakannan2 and his script as reference, I
modified my script to be posix compliant. I've also tested this script
with some modification and it works perfectly.
@harshv5094
Copy link
Contributor Author

harshv5094 commented Sep 10, 2024

@jeevithakannan2 I made changes according to your suggestion, and also I've used your script as reference to modify my own script. I modified some changes from your script and tested on my own system, the script works way better than the previous iteration.

harshv5094

This comment was marked as resolved.

@harshv5094
Copy link
Contributor Author

harshv5094 commented Sep 12, 2024

Should I Add VAAPI drivers, as an option for video acceleration? @nnyyxxxx, @jeevithakannan2

image

@jeevithakannan2
Copy link
Contributor

Yeah you could do that, also check whether the user's graphics card is compatible before proceeding with vaapi drivers installation

@harshv5094
Copy link
Contributor Author

@jeevithakannan2, Do you have any idea how I can check that?

@jeevithakannan2
Copy link
Contributor

It would be something like this

if command_exists nvidia-smi; then
  gpu_info=$(nvidia-smi --query-gpu=name --format=csv,noheader)
  printf "%b\n" "${GREEN}NVIDIA GPU detected: $gpu_info${RC}"
else
  printf "%b\n" "${RED}nvidia-smi not found or drivers not installed.{RC}"
  exit 1
fi

if echo "$gpu_info" | grep -Eq "GeForce (8|9|[1-9][0-9])|GTX|RTX"; then
  printf "%b\n" "${GREEN}Your GPU ($gpu_model) is GeForce 8 series or above.${RC}"
else
  printf "%b\n" "${RED}Your GPU ($gpu_model) is below GeForce 8 series.${RC}"
fi

Add few more informational message for users and it is a sample script develop your own script based on that

@harshv5094
Copy link
Contributor Author

Yeah! This'll help a lot thanks @jeevithakannan2

@harshv5094 harshv5094 marked this pull request as draft September 12, 2024 16:09
@ChrisTitusTech
Copy link
Owner

Sorry for the inconvenience. We had a massive restructure of the codebase to improve future development. Because of this can you update your PR to the new structure. Thank you for your assistance and contribution.

@harshv5094
Copy link
Contributor Author

Okay @ChrisTitusTech, I'll do it now, and also thanks for checking in.

@harshv5094 harshv5094 marked this pull request as ready for review September 13, 2024 15:47
@harshv5094
Copy link
Contributor Author

harshv5094 commented Sep 13, 2024

image
I'm having this problem now. I'm unable to sync the repo

@nnyyxxxx
Copy link
Contributor

image I'm having this problem now. I'm unable to sync the repo

The file structure has changed, you'll have to rebase.

}

echo "1. Install Nvidia Drivers"
echo "2. Remove Nvidia Drivers"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the uninstalling feature, see #362 for more information.

Copy link
Contributor Author

@harshv5094 harshv5094 Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To resolve conflicts, Should I delete this pull request and create a fresh one?

@harshv5094
Copy link
Contributor Author

So, I don't know how I can fix this issue so I'm going to create a new pull request, with proper precaution.

@harshv5094 harshv5094 closed this Sep 13, 2024
ChrisTitusTech added a commit that referenced this pull request Sep 19, 2024
…from PR #319) (#370)

* feat(fedora/nvidia-*.sh): adding nvidia proprietary driver setup

* fix(fedora/nvidia-*.sh): removing update line

That update line crashed my system while testing, since it also
installed new kernal where I didn't build my driver. So new user can
also get confused.

* refactor(fedora/nvidia-*.sh): adding a new warning while starting the script

I faced this issue yesterday, So It's better to warn user before
installing this driver

* refactor(fedora/nvidia-*.sh): removing uninstalation option

For now, as suggested by @nnyyxxxx and @adamperkowski, I'm removing the
uninstall option until #362 gets resolved.

* Fix bashism

---------

Co-authored-by: Chris Titus <contact@christitus.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants