update_cuda.sh 916 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. foxy=$(systemctl show -p ActiveState foxypool.service | sed 's/ActiveState=//g')
  3. if [ $foxy = "active" ]
  4. then
  5. echo "FoxyPool is enabled and running"
  6. echo "Disable FoxyPool (needed for update cuda)"
  7. sudo systemctl stop foxypool.service
  8. sudo systemctl disable foxypool.service
  9. touch .foxy
  10. fi
  11. if [ ! -f /home/wareck/.cuda_install ]
  12. then
  13. if [ ! -f cuda_12.4.0_550.54.14_linux.run ]
  14. then
  15. wget wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.14_linux.run
  16. fi
  17. chmod +x cuda_12.4.0_550.54.14_linux.run
  18. sudo service lightdm stop
  19. touch /home/wareck/.cuda_install
  20. sudo init 3
  21. fi
  22. echo "Updating ..."
  23. sudo rm /tmp/.X1-lock
  24. sudo ./cuda_12.4.0_550.54.14_linux.run --silent --driver
  25. sudo rm /home/wareck/.cuda_install
  26. if [ -f .foxy ]
  27. then
  28. echo "Re-enable FoxyPool:"
  29. sudo systemctl start foxypool.service
  30. sudo systemctl enable foxypool.service
  31. rm .foxy
  32. fi
  33. echo "Done."