Skip to content

add nvidia-open driver install option#15

Open
kykrueger wants to merge 2 commits intoHalfwalker:masterfrom
kykrueger:master
Open

add nvidia-open driver install option#15
kykrueger wants to merge 2 commits intoHalfwalker:masterfrom
kykrueger:master

Conversation

@kykrueger
Copy link

I'd like to be able to install the Nvidia drivers from the Nvidia repo.
let me know what you think.

@kykrueger
Copy link
Author

Messed up some of the if statement syntax. I'll fix it later

@Halfwalker
Copy link
Owner

That's a good idea to have the nvidia-open as an option. Though rather than a whole separate control I think it would be cleaner if integrated into the existing query_nvidia setup. So the selection list in
https://github.com/Halfwalker/ZFS-root/blob/master/ZFS-root.sh#L567-L570

${NVIDIA_LATEST} "Latest ${NVIDIA_LATEST}" OFF \
470    "Legacy 470 driver" OFF \
390    "Legacy 390 driver" OFF \
none   "No Nvidia driver" ON \

becomes

${NVIDIA_LATEST} "Latest ${NVIDIA_LATEST}" OFF \
470    "Legacy 470 driver" OFF \
390    "Legacy 390 driver" OFF \
open   "Use Nvidia open driver" OFF \
none   "No Nvidia driver" ON \

Then it's a matter of checking just the one NVIDIA variable and if it's "open" do the cuda-keyring install etc. Kind of like

if [ "${NVIDIA}" == "open" ] ; then
  # fetch cuda-keyring, apt-get update, install nvidia-open
elif [ "${NVIDIA}" != "none" ] ; then
  # apt-add-repository, apt-get update, install nvidia-driver-${NVIDIA}, etc.
fi

If you would like to redo the PR along these lines I would definitely consider it.

@kykrueger
Copy link
Author

Sure, I can do it that way!

@kykrueger
Copy link
Author

I'd also be keen to have the video drivers install without requiring a desktop environment for headless servers that run GPU workloads.
What do you think about me moving the video driver section outside of the check for if a desktop environment is being installed?
Or would you prefer some other configuration variable for forcing install of video drivers in a headless environment?

@kykrueger
Copy link
Author

I've just noticed that some of the open firmware is available in ppa:graphics-drivers/ppa
https://launchpad.net/ubuntu/resolute/+package/nvidia-driver-580-open

The latest drivers (590) are not yet available there, but personally I don't have a need for them.

I would rather just simplify this PR by adding an example of using the 580-open driver by adding it to your list of options.

@Akadean
Copy link

Akadean commented Feb 3, 2026

That's a possibility. I go back and forth on whether to install "other stuff" via the main ZFS-root.sh process. On one hand it's good to have it as "This is a base, then you install and configure it how you like after it's built". On the other hand it's also good to have a one-stop-shop to set it up the way you want.

Personally I use ansible to provision the system after main install. Laptop with encryption, Workstation with multiple boot disks and Gnome etc., NAS server, Media server and so on.

We would have to be sure that installing the video drivers doesn't bring a lot of extra stuff. But maybe that's OK for a GPU headless system ?

For your last comment there about 580/590 - yeah, simple is good. Adding 580-open to the list is fine.

@kykrueger kykrueger force-pushed the master branch 2 times, most recently from fab9576 to 1241366 Compare February 3, 2026 15:44
@kykrueger
Copy link
Author

There are different packages for the headless version. I've added an example to the list.
Supporting the install of the headless variants required reformatting the other values that had been a part of the NVIDIA variable.

To support the install of the headless drivers when not installing a desktop environment, I could check if 'headless' is present in the NVIDIA variable, and then install the drivers when it is.

@kykrueger
Copy link
Author

I'd consider this PR complete though, if adding the logic for a headless install without a desktop environment, I'll make a new PR.

# Installing Nvidia PPA here just so we can search for versions
apt-add-repository --yes --update ppa:graphics-drivers/ppa
NVIDIA_LATEST=$(apt-cache search nvidia-driver- | cut -d ' ' -f1 | grep -e "nvidia-driver-...$" | cut -d'-' -f3 | sort | tail -1)
NVIDIA=$(whiptail --title "Nvidia Hardware detected - install latest driver ?" --radiolist "Gnome/KDE/NEON was selected, and Nvidia graphics HW was detected on this system. The ppa:graphics-drivers/ppa repo could be installed in order to get the binary Nvidia driver\n\nNOTE: Be sure to select the correct driver - the latest (${NVIDIA_LATEST}) may not support older legacy HW. See\n\nhttps://www.nvidia.com/en-us/drivers/unix/legacy-gpu/\n\nfor more information on legacy HW. It is safe to select NONE if you are unsure. You can always install the appropriate driver later via Additional Drivers" 22 70 4 \
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
NVIDIA=$(whiptail --title "Nvidia Hardware detected - install latest driver ?" --radiolist "Gnome/KDE/NEON was selected, and Nvidia graphics HW was detected on this system. The ppa:graphics-drivers/ppa repo could be installed in order to get the binary Nvidia driver\n\nNOTE: Be sure to select the correct driver - the latest (${NVIDIA_LATEST}) may not support older legacy HW. See\n\nhttps://www.nvidia.com/en-us/drivers/unix/legacy-gpu/\n\nfor more information on legacy HW. It is safe to select NONE if you are unsure. You can always install the appropriate driver later via Additional Drivers" 22 70 4 \
NVIDIA=$(whiptail --title "Nvidia Hardware detected - install latest driver ?" --radiolist "Gnome/KDE/NEON was selected, and Nvidia graphics HW was detected on this system. The ppa:graphics-drivers/ppa repo could be installed in order to get the binary Nvidia driver\n\nNOTE: Be sure to select the correct driver - the latest (${NVIDIA_LATEST}) may not support older legacy HW. See\n\nhttps://www.nvidia.com/en-us/drivers/unix/legacy-gpu/\n\nfor more information on legacy HW. It is safe to select NONE if you are unsure. You can always install the appropriate driver later via Additional Drivers" 26 70 8 \

Need to adjust the size of the menu. List height should match the total items in the list

Co-authored-by: Halfwalker <deano-github@areyes.com>
@kykrueger
Copy link
Author

What is your preference on commits, squashed, or maybe just a better commit message on the suggestion commit that I just accepted?

@Halfwalker
Copy link
Owner

Usually just a good commit msg. Squashing sometimes has a tendency to lose details like rationale and how-we-arrived-here etc. I will absolutely squash lots of test-this and test-that type commits though hah

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.

3 participants