You are Here:
Linux Lite 4.4 Final has been released. See the Release Announcements section for more information.



How to maintain custom tweaks after reboot/sleep

Author (Read 374 times)

0 Members and 1 Guest are viewing this topic.

How to maintain custom tweaks after reboot/sleep
« on: February 06, 2019, 05:19:23 PM »
 

MS

  • Occasional Poster
  • **
  • 81
    Posts
  • Country: 00
  • Reputation: 0

  • Linux Lite: 4.4 64bit

  • CPU: Intel i7-7500U Dual-Core @ 2.7~3.5GHz

  • MEMORY: 8Gb

  • VIDEO CARD: Intel HD Graphics 620 / AMD Radeon R7 M445
Hello,

I have applied certain custom settings, regarding the swappiness value, as well as the overclock of an amdgpu associated device. The swappiness value stays after system waking from the sleep mode, but resets after each reboot. When it comes to the amdgpu overclock parameters, they reset already after system waking from the sleep mode. I would like to have these maintained. I believe a script could do. Where do I put respective scripts, what extra instructions should they include to be maintained by the system?

These are the regular commands that I use to introduce changes - inserted values are theoretical:

Code: [Select]
sudo echo "10" > /proc/sys/vm/swappiness
Code: [Select]
sudo bash -c 'echo "20" > /sys/class/drm/card1/device/pp_sclk_od && echo "20" > /sys/class/drm/card1/device/pp_mclk_od'
 


Re: How to maintain custom tweaks after reboot/sleep
« Reply #1 on: February 06, 2019, 06:12:51 PM »
 

firenice03

  • Rockin' the FREE World
  • Platinum Level Poster
  • **********
  • 1064
    Posts
  • Country: us
  • Reputation: 206
  • Linux Lite Member

  • Linux Lite: 4.2 64bit

  • CPU: Atom X5/AMD Phenom II X2

  • MEMORY: 8Gb

  • VIDEO CARD: Intel//AMD/ATI RS880
@MS
 To keep swappiness..


you can vi/nano as root
Code: [Select]
/etc/sysctl.conf
Then change/add the line -
Code: [Select]
vm.swappiness = 10You'll need to reboot to take effect..



Can do while running with
Code: [Select]
sysctl vm.swappiness=10


As for the Overclocking, I would suggest similarly editing the files (vi/nano - most likely as root) directly vs. echoing the desired input..
*Added - on a second thought - you could go to 'session and startup' the 'application autostart' tab to add the script... Remember to make the script executable.



Also instead of vi/nano, one can open the folder(s) as administrator(rt click) and edit the files with leadpad...
Last Edit: February 06, 2019, 06:34:46 PM by firenice03
LL 3.8 32 bit Dell Inspiron Mini - Atom N270 1.6Ghz - 1GB - Intel Mobile 945GSE Express
LL 4.2 64 bit HP 6005- AMD Phenom II X2 - 8GB - AMD/ATI RS880 (HD4200)
LL 4.2 64 bit Test UEFI Kangaroo (Mobile Desktop) - Atom X5-Z8500 1.44Ghz - 2GB - Intel HD Graphics
RETIRED LL 2.8 64 bit Dell Optiplex 160 (Thin) - Atom 230 1.6Ghz - 4GB-SiS 771/671 PCIE VGA
Running Linux Lite since LL2.2
 

Re: How to maintain custom tweaks after reboot/sleep
« Reply #2 on: February 06, 2019, 06:43:04 PM »
 

MS

  • Occasional Poster
  • **
  • 81
    Posts
  • Country: 00
  • Reputation: 0

  • Linux Lite: 4.4 64bit

  • CPU: Intel i7-7500U Dual-Core @ 2.7~3.5GHz

  • MEMORY: 8Gb

  • VIDEO CARD: Intel HD Graphics 620 / AMD Radeon R7 M445
As for the Overclocking, I would suggest similarly editing the files (vi/nano - most likely as root) directly vs. echoing the desired input..
*Added - on a second thought - you could go to 'session and startup' the 'application autostart' tab to add the script... Remember to make the script executable.

Also instead of vi/nano, one can open the folder(s) as administrator(rt click) and edit the files with leadpad...
I did edit the amdgpu target files couple of times but similarly as with echoing, the values get nullified on every occasion. For adding the scripts to autostart, I imagine it will apply only per boot, but what about waking from the sleep mode? Will need to test it out.
 

Re: How to maintain custom tweaks after reboot/sleep
« Reply #3 on: February 06, 2019, 07:07:26 PM »
 

MS

  • Occasional Poster
  • **
  • 81
    Posts
  • Country: 00
  • Reputation: 0

  • Linux Lite: 4.4 64bit

  • CPU: Intel i7-7500U Dual-Core @ 2.7~3.5GHz

  • MEMORY: 8Gb

  • VIDEO CARD: Intel HD Graphics 620 / AMD Radeon R7 M445
I have read something somewhere about putting the scripts to /etc/init.d/ location, is that any way to go?

Attempted to issue the commands without prior root prefixes at the "session and startup", but understandably, it did not go. I am uncertain how this "session and startup" works, I mean, are these programs initiated after the first logging in - which would mean, too late - or does the first logging in already unlock the root access needed to start the applications requiring it? If so, it would make sense to issue the commands with root prefixes.
Last Edit: February 06, 2019, 07:11:17 PM by MS
 

Re: How to maintain custom tweaks after reboot/sleep
« Reply #4 on: February 07, 2019, 10:22:38 AM »
 

trinidad

  • Gold Level Poster
  • *******
  • 912
    Posts
  • Country: us
  • Reputation: 164
  • Linux Lite Member
    • dbts-analytics.com

  • Linux Lite: 4.2 64bit

  • CPU: AMD A8 5500 4 cores

  • MEMORY: 8Gb

  • VIDEO CARD: AMD/ATI Radeon HD 7560D
"You can't depend on your eyes when your imagination is out of focus."
 

Re: How to maintain custom tweaks after reboot/sleep
« Reply #5 on: February 08, 2019, 03:26:24 AM »
 

MS

  • Occasional Poster
  • **
  • 81
    Posts
  • Country: 00
  • Reputation: 0

  • Linux Lite: 4.4 64bit

  • CPU: Intel i7-7500U Dual-Core @ 2.7~3.5GHz

  • MEMORY: 8Gb

  • VIDEO CARD: Intel HD Graphics 620 / AMD Radeon R7 M445
Perhaps this explains.

https://unix.stackexchange.com/questions/404780/cant-overclock-gpu-using-amdgpu-driver-on-archlinux

TC
I am uncertain whether we are on the same frequency here, as I was asking for how to imprint these changes as to make them system default, per each boot and per each session, awakening from suspend or other. But maybe I have missed out on something. If so, please quote.
 

Re: How to maintain custom tweaks after reboot/sleep
« Reply #6 on: February 08, 2019, 08:25:22 AM »
 

firenice03

  • Rockin' the FREE World
  • Platinum Level Poster
  • **********
  • 1064
    Posts
  • Country: us
  • Reputation: 206
  • Linux Lite Member

  • Linux Lite: 4.2 64bit

  • CPU: Atom X5/AMD Phenom II X2

  • MEMORY: 8Gb

  • VIDEO CARD: Intel//AMD/ATI RS880
This may give some insight to running a script at resume.... Not sure about the overclocking... But for a script...
https://askubuntu.com/questions/92218/how-to-execute-a-command-after-resume-from-suspend


Script should be executable and not just an .sh extension (if globally needed) - same as a startup
Code: [Select]
chmod uga +x NameOfFile


LL 3.8 32 bit Dell Inspiron Mini - Atom N270 1.6Ghz - 1GB - Intel Mobile 945GSE Express
LL 4.2 64 bit HP 6005- AMD Phenom II X2 - 8GB - AMD/ATI RS880 (HD4200)
LL 4.2 64 bit Test UEFI Kangaroo (Mobile Desktop) - Atom X5-Z8500 1.44Ghz - 2GB - Intel HD Graphics
RETIRED LL 2.8 64 bit Dell Optiplex 160 (Thin) - Atom 230 1.6Ghz - 4GB-SiS 771/671 PCIE VGA
Running Linux Lite since LL2.2
 

Re: How to maintain custom tweaks after reboot/sleep
« Reply #7 on: February 09, 2019, 12:29:45 AM »
 

MS

  • Occasional Poster
  • **
  • 81
    Posts
  • Country: 00
  • Reputation: 0

  • Linux Lite: 4.4 64bit

  • CPU: Intel i7-7500U Dual-Core @ 2.7~3.5GHz

  • MEMORY: 8Gb

  • VIDEO CARD: Intel HD Graphics 620 / AMD Radeon R7 M445
Thanks @firenice03, but having looked up the answers you have linked and the proposed conditions required to make a competent looking script for the system resume from suspend, I thought that I would not know what am I doing with it, so I guess that I will just pass on this.
Last Edit: February 09, 2019, 12:32:50 AM by MS
 


Tags:
 


Linux Lite 4.4 Final has been released. See the Release Announcements section for more information.