Solution for NVIDIA sleep/wake issue in Linux

Hi guys. For once, my obsessive behaviour has been fruitful.

It seems that if you ask around, there is a page (https://iam.tj/prototype/enhancements/Windows-acpi_osi.html) where the solution is detailed for all of us. I imagine that there is a minimal chance that it will go down before you get to read this so I will summarize the solution:

  1. Remove whatever you already entered into /etc/default/grub
  2. Create a text file which contains the following script:
#!/bin/sh
VERSION="$(sudo strings /sys/firmware/acpi/tables/DSDT | grep -i 'windows ' | sort | tail -1)"
echo 'Linux kernel command-line options required: acpi_osi=! "acpi_osi='$VERSION'"'
read -p "Do you want to add this setting (y/n) ? " answer
if [ x$answer != xY -a x$answer != xy ]; then
  exit 1
fi
echo "Existing Command Line: ` sed -n '/.*linux[[:space:]].*root=\(.*\)/{s//BOOT_IMAGE=\1/ p;q;}' /boot/grub/grub.cfg `"
if grep -m 1 'acpi_osi=Windows' -q /etc/default/grub; then
  echo "There is already an entry; please remove it from /etc/default/grub and redo 'sudo update-grub' then re-run this script"
  exit 2
fi
sudo sed -i "s/^\(GRUB_CMDLINE_LINUX=.*\)\"$/\1 acpi_osi=! \\\\\"acpi_osi=$VERSION\\\\\"\"/" /etc/default/grub
echo "Modified Command Line: ` sed -n '/.*linux[[:space:]].*root=\(.*\)/{s//BOOT_IMAGE=\1/ p;q;}' /boot/grub/grub.cfg `"
sudo update-grub
  1. Save file as [insert_name_here].sh
  2. In the console/command prompt/terminal, run “sudo chmod +x [insert_name_here].sh” (without the quotes)
  3. Then type in “./[insert_name_here].sh” (without the quotes)
  4. The script will detect what you need to enter into /etc/default/grub and offer to enter it for you. It will also update grub for you.
  5. Restart

Worked for me! In fact, it is the only damned thing that ever worked for me.