Announcement

Collapse
No announcement yet.

XanMod-ing Ubuntu To Perform Closer To Intel's Clear Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Based on the ClearLinux flags in Michael's post, I added the vars below on my Ubuntu setup:

    Code:
     export CFFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize -Wl,-sort-common -Wl,--enable-new-dtags"
     
     export FFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize -Wl,--enable-new-dtags"
     
     export CXXFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -march=native -fvisibility-inlines-hidden -Wl,--enable-new-dtags"
     
     export CFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -march=native"
    So far so good after compiling a few projects. I had to remove the following however:
    Code:
    -Wa,-mbranches-within-32B-boundaries
    as cmake would complain about that one. Other than that, I changed -mtune=skywell to -march=native (I actually have -march=haswell on mine but used native for the above snippet).

    tl;dr C FLAGS MATTER!

    Comment


    • #12
      Originally posted by perpetually high View Post
      For an alternative to cpupower, you can use cpufreq-set instead (available in the cpufrequtils package).
      Unfortunately cpufreq-set cannot set the performance bias, which is what I used cpupower for.

      --perf-bias, -b

      Sets a register on supported Intel processore which allows software to convey its policy for the relative importance of performance versus energy savings to the processor.

      The range of valid numbers is 0-15, where 0 is maximum performance and 15 is maximum energy efficiency.

      The processor uses this information in model-specific ways when it must select trade-offs between performance and energy efficiency.

      This policy hint does not supersede Processor Performance states (P-states) or CPU Idle power states (C-states), but allows software to have influence where it would otherwise be unable to express a preference.

      For example, this setting may tell the hardware how aggressively or conservatively to control frequency in the "turbo range" above the explicitly OS-controlled P-state frequency range. It may also tell the hardware how aggressively it should enter the OS requested C-states.


      If set to 0 on my system in combination with the Performance governor it usually squeezes out an extra fps when encoding HD video, when set to 15, in combination with the Powersave governor the working time on battery power is about 30 minutes more. Both compared to the standard 6 setting.
      Of course the following will also do as an example for setting perf-bias to 0 on cpu0 but has to be done per core (could write a script for that...)
      Code:
       echo 0 | sudo tee /sys/devices/system/cpu/cpu0/power/energy_perf_bias
      Last edited by FPScholten; 20 January 2020, 07:17 PM.

      Comment


      • #13
        petition to move Xanmods into mainline.

        Comment


        • #14
          Originally posted by atomsymbol

          /etc/portage/make.conf contains:

          Code:
          # improved debugging
          COMMON_CFLAGS="${COMMON_CFLAGS} -fno-optimize-sibling-calls -g1"
          
          # optimization options from -O3
          COMMON_CFLAGS="${COMMON_CFLAGS} -fgcse-after-reload -floop-interchange
          -fipa-cp-clone -fpredictive-commoning -ftree-partial-pre"
          
          # optimization options from -fprofile-use
          COMMON_CFLAGS="${COMMON_CFLAGS} -fsplit-loops"
          
          COMMON_CFLAGS="${COMMON_CFLAGS} -fexcess-precision=fast
          -fno-stack-protector -funsafe-math-optimizations"
          
          COMMON_CFLAGS="${COMMON_CFLAGS} function and jump alignment options"
          
          CFLAGS="-mavx2 -mf16c -mfma -mtune=native -msha -O2 ${COMMON_CFLAGS}"
          CXXFLAGS="-mavx2 -mf16c -mfma -mtune=native -msha -O3 ${COMMON_CFLAGS}"
          Some packages on the machine might not be compiled with these options yet because I slowly keep updating the option list over time.

          So far, I encountered "just" one gcc miscompilation related to this combination of options which resulted in a gcc bug report.
          That really does look like a mess

          Comment


          • #15
            Nice to know. I have been thinking to switch to ClearLinux for some time now. I am on a xanmodded Ubuntu Budgie 18.04 for two years now and everything is working great. Great gaming rig with a 3900X and a Vega 64, so I was too lazy to make that port for the extra 1 or 2 %, I prolly barely notice on that fast cpu anyways.

            But I am still thinking about it. Maybe if the update to 20.04 breaks .

            Comment


            • #16
              Originally posted by perpetually high View Post
              Based on the ClearLinux flags in Michael's post, I added the vars below on my Ubuntu setup:

              Code:
              export CFFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize -Wl,-sort-common -Wl,--enable-new-dtags"
              
              export FFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize -Wl,--enable-new-dtags"
              
              export CXXFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -march=native -fvisibility-inlines-hidden -Wl,--enable-new-dtags"
              
              export CFLAGS="-g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -march=native"
              So far so good after compiling a few projects. I had to remove the following however:
              Code:
              -Wa,-mbranches-within-32B-boundaries
              as cmake would complain about that one. Other than that, I changed -mtune=skywell to -march=native (I actually have -march=haswell on mine but used native for the above snippet).

              tl;dr C FLAGS MATTER!
              In what file did you add those vars?

              Comment


              • #17
                Originally posted by Vistaus View Post

                In what file did you add those vars?
                I have a file called env.sh in /etc/profile.d. Scripts in this directory will run at startup.

                Comment


                • #18
                  Originally posted by FPScholten View Post
                  Of course the following will also do as an example for setting perf-bias to 0 on cpu0 but has to be done per core (could write a script for that...)
                  Code:
                   echo 0 | sudo tee /sys/devices/system/cpu/cpu0/power/energy_perf_bias
                  Just replace "cpu0" with "cpu*", and with tee, it will set it for all cores.

                  This can also be used to set performance mode on all cores, without installing any utility:

                  Code:
                  sudo echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

                  Comment


                  • #19
                    Originally posted by FPScholten View Post
                    Since I have installed the Xanmod kernel in my ubuntu laptop, it is running much smoother. Notably faster are encoding video and Firefox. Application startup time also improved. Other than not being able to use cpupower with it because it is not available (in the repository) for this kernel, there is nothing to keep me from using it by default.
                    Which drive do you use?

                    Comment


                    • #20
                      Buntolo : This is a fairly old (5years) Haswell based laptop so it has an Crucial_CT512MX100SSD1 SATA drive formatted with ext4 filesystem. The laptop does not support NVME drives.

                      Comment

                      Working...
                      X