Jump to content
funtoo forums
  • 0
erikr

Support fort Skylake architecture/how to bootstrap funtoo

Question

Hi,

 

Currently there are no support for the Intel Skylake architecture under subarchs. In Gentoo I once changed the CFLAGS and bootstrapped the system. This was a long time ago and things have changed (about the time when stage 1 and 2 was no longer published)

 

Is there a procedure for bootstraping Funtoo and how?

 

I recall there was a bootstrap-sh script taking care of the thing. I ran it on a running system while using the computer with KDE :) Worked like any other emerge out there.

 

// Erik

 

Share this post


Link to post
Share on other sites

17 answers to this question

Recommended Posts

  • 0

Or is possible to use

"-march=native"

 

take a look with 2 terminals the differencies between

echo 'int main(){return 0;}' > test.c && gcc -v -Q -march=native -O2 test.c -o test && rm test.c test

and

echo 'int main(){return 0;}' > test.c && gcc -v -Q -march=skylake -O2 test.c -o test && rm test.c test

Now there are also the ultimates processors (Broadwell-E with turbo boost technology 3.0 and other new features)  :wacko:

Then same "family" may have differencies with new "steppings". 

 

So I use "native".

 

And if You want to use gentoo-sources with experimental local use flag enabled You can compile also the kernel optimized for various architectures and also with "native".

Share this post


Link to post
Share on other sites
  • 0

native skylake builds scheduled. Matter of hardware (it's already bought but not assembled yet). For cflags, need small changes in (use as example):

http://git.funtoo.org/funtoo-overlay/tree/profiles/funtoo/1.0/linux-gnu/arch/x86-64bit/subarch/intel64-ivybridge/make.defaults

CFLAGS="-march=skylake -O2 -pipe"

CPU_FLAGS_X86="avx512 avx2 avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

i'm not sure whether av512 and avx2 USE present in ebuilds but, if not, the setting will not take effect.

Share this post


Link to post
Share on other sites
  • 0

Thanks for the help.

 

Now I finally have the device at my desktop and am on my way to install. Just booted with windows 7 pro to make the recovery DVD and then  the thrill of making a clean disk partition with fdisk. Windows Wiped :)  I actually hesitated a bit and started to evaluate Calculate Linux and Linux Mint. Calculate did not manage to boot properly, I assume old kernel. Linux Mint just don't feel right. This is a powerful bastard and there are no reason not to go for Funtoo. Beside, systemd is kind of a deal breaker. I am also a fan of btrfs and using sub volumes rather than paritions for / and /home and that is kind of quirky with the automated installs I have learned to know.

 

So I went for Funtoo and started off with the  haswell current stage 3  as base.

 

Regarding av512 and avx2 I checked in /proc/cpuinfo and found avx2 but not av512. I will leave that out from CPU_FLAGS_X86 for now.

 

I did a visual comparison as suggested by Sandro but the list of flags printed was impressive and took the major part of a screen height with more than one flag per line. I will compare them later in detail but the native-option gave the most flags and I will go with that. Seems to be the most narrow one. Just hope I won't need to compile using DistCC because native does not work with that easily.

 

If anyone is interested in the output from Sandros suggestion, let me know and I can post it her. 

 

Regarding kernel I will use gentoo-sources as I have done for, well many years. This time I will test out the experimental USE flag as well. But that is a later step still :)

 

BR
Erik

Share this post


Link to post
Share on other sites
  • 0

Regarding CPU-flags. I get the following info from cpuinfo2cpuflags-x86

 

© sysresccd / # cpuinfo2cpuflags-x86
CPU_FLAGS_X86: aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3

Share this post


Link to post
Share on other sites
  • 0
$ tail -30 /proc/cpuinfo

*too use flags

 

Then I think that at this time there aren't ebuilds that uses SIMD newer than avx2

 

But with "-march=native", gcc will compile binary code using also > avx2 instructions if supported by your Skylake.

 

___________________________________________________________________

 

These are the mine (i7 "Haswell 4771 @3,5 GHz not overclocked)

options passed:  -v test.c -march=haswell -mmmx -mno-3dnow -msse -msse2
 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul
 -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm
 -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c
 -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt
 -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1
 --param l1-cache-size=32 --param l1-cache-line-size=64
 --param l2-cache-size=8192 -mtune=haswell -O2
options enabled:  -faggressive-loop-optimizations -falign-labels
 -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
 -fcaller-saves -fcombine-stack-adjustments -fcommon -fcompare-elim
 -fcprop-registers -fcrossjumping -fcse-follow-jumps -fdefer-pop
 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively
 -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
 -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
 -fgcse-lm -fgnu-runtime -fgnu-unique -fguess-branch-probability
 -fhoist-adjacent-loads -fident -fif-conversion -fif-conversion2
 -findirect-inlining -finline -finline-atomics
 -finline-functions-called-once -finline-small-functions -fipa-cp
 -fipa-profile -fipa-pure-const -fipa-reference -fipa-sra
 -fira-hoist-pressure -fira-share-save-slots -fira-share-spill-slots
 -fisolate-erroneous-paths-dereference -fivopts -fkeep-static-consts
 -fleading-underscore -flifetime-dse -fmath-errno -fmerge-constants
 -fmerge-debug-strings -fmove-loop-invariants -fomit-frame-pointer
 -foptimize-sibling-calls -foptimize-strlen -fpartial-inlining -fpeephole
 -fpeephole2 -fprefetch-loop-arrays -free -freg-struct-return
 -freorder-blocks -freorder-blocks-and-partition -freorder-functions
 -frerun-cse-after-loop -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-insns2
 -fshow-column -fshrink-wrap -fsigned-zeros -fsplit-ivs-in-unroller
 -fsplit-wide-types -fstrict-aliasing -fstrict-overflow
 -fstrict-volatile-bitfields -fsync-libcalls -fthread-jumps
 -ftoplevel-reorder -ftrapping-math -ftree-bit-ccp -ftree-builtin-call-dce
 -ftree-ccp -ftree-ch -ftree-coalesce-vars -ftree-copy-prop
 -ftree-copyrename -ftree-cselim -ftree-dce -ftree-dominator-opts
 -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-if-convert
 -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
 -ftree-parallelize-loops= -ftree-phiprop -ftree-pre -ftree-pta
 -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slsr -ftree-sra
 -ftree-switch-conversion -ftree-tail-merge -ftree-ter -ftree-vrp
 -funit-at-a-time -funwind-tables -fvar-tracking -fvar-tracking-assignments
 -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387 -mabm -maes
 -malign-stringops -mavx -mavx2 -mbmi -mbmi2 -mcx16 -mf16c -mfancy-math-387
 -mfma -mfp-ret-in-387 -mfsgsbase -mfxsr -mglibc -mhle -mieee-fp
 -mlong-double-80 -mlzcnt -mmmx -mmovbe -mpclmul -mpopcnt -mpush-args
 -mrdrnd -mred-zone -mrtm -msahf -msse -msse2 -msse3 -msse4 -msse4.1
 -msse4.2 -mssse3 -mtls-direct-seg-refs -mvzeroupper -mxsave -mxsaveopt

Share this post


Link to post
Share on other sites
  • 0

Hi Dear Oleg .... i've trouble with mouse wheel :| I wanna change it (but it is a good mouse: http://www.techspot.com/images/products/mice/org/1706423119_701250880_o.jpg

 

However,

sandro@ci74771ht ~ $ eix -I sys-devel/gcc
[I] sys-devel/gcc
     Available versions:  
     (4.8)  4.8.5^s
     (4.8.5) 4.8.5-r1^s
     (4.9)  4.9.2^s 4.9.2-r1^s 4.9.2-r2^s 4.9.3^s 4.9.3-r1^s 4.9.3-r2^s
     (4.9.3) 4.9.3-r3^s
     (5.3)  [M]5.3.0^s
     (5.3.0) [M]5.3.0-r1^s
       {ada altivec cxx doc +fortran go graphite hardened libssp multilib multislot nls objc objc++ openmp sanitize vanilla}
     Installed versions:  4.9.3-r3(4.9.3)^s(16:08:08 04/05/2016)(ada cxx fortran go graphite multilib nls objc objc++ openmp -altivec -doc -hardened -libssp -multislot -sanitize -vanilla)
     Description:         The GNU Compiler Collection

The 4.9.3 doesn't recognize "-march=skylake" .... i think then that there are 2 solutions: use the native_64 or update (unmasking) the GCC-5.X

 

Hello :)

Share this post


Link to post
Share on other sites
  • 0

Agree with Sandro. I started out with march=skylake and crashed and burned with the first ebuild; "Cannot compile C code" it said. I changed to native for later trouble fining and things went well.

I use CC 4.9.3-r3. I can repeate the problem by setting march=skylake

>>> Emerging (1 of 1) app-portage/ufed-0.92::gentoo
 * ufed-0.92.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                         [ ok ]
>>> Unpacking source...
>>> Unpacking ufed-0.92.tar.bz2 to /var/tmp/portage/app-portage/ufed-0.92/work
>>> Source unpacked in /var/tmp/portage/app-portage/ufed-0.92/work
>>> Preparing source in /var/tmp/portage/app-portage/ufed-0.92/work/ufed-0.92 ...
 * Running eautoreconf in '/var/tmp/portage/app-portage/ufed-0.92/work/ufed-0.92' ...
 * Running aclocal ...                                                                            [ ok ]
 * Running autoconf --force ...                                                                   [ ok ]
 * Running autoheader ...                                                                         [ ok ]
 * Running automake --add-missing --copy --foreign --force-missing ...                            [ ok ]
 * Running elibtoolize in: ufed-0.92/
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-portage/ufed-0.92/work/ufed-0.92 ...
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --libdir=/usr/lib64 --libexecdir=/usr/lib64/ufed
checking for a BSD-compatible install... /usr/lib/portage/python2.7/ebuild-helpers/xattr/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/app-portage/ufed-0.92/work/ufed-0.92':
configure: error: C compiler cannot create executables
See `config.log' for more details

So I will stick with march=native. 

 

I tried native in kernel-settings as well and it seemed to work. How shall I notice?  :)

 

Regarding avx512 I thought there might been a typo and I search with and without x and only for 512 in /proc/cpuinfo. None found:

~ # cat /proc/cpuinfo | grep 512
~ # 

Initially I had some trouble with booting but using SystemRescueCD with alternative kernel worked well. Alt-kernel is the more recent one, standard kernel is the old stable one. I downloaded the latest CD instead of an older one I already have. Don't know what version of kernel is needed to recognize Skylake and related hardware like graphics. I actually think this is where Calculate immensely failed (3.18 or so) but also Linux Mint have a quite old kernel and I had to go with standard VGA device settings.  

 

All-in-all I am quite satisfied with the result. I spent Friday evening and parts of Saturday to install Funtoo from scratch. With the help above I started out quite rapid and there where never any difficult obstacles. During most of the Saturday I had XFCE up and running and I finalized base installation with fire off installation of libreoffice, firefox and chromium late Saturday and it was ready by 5 in the morning. Those are the bastards and confirms the expected capacity I guessed from CPU Passmark; this computer is about half the compilation speed as a my desktop computer (AMD FX8350@4GHz-ish) but I am out in the garden writing this post. 

 

Worth mention is that you have to enable WIFI modules in kernel. The one Genkernel selects does not suffice. For this version I had to enable  iwlmvm and install linux-firmware to get it running but that was about it.

 

And also worth mention is that I use grub-legacy and have my root partition on a btrfs subvolume. I never got this working with the Funtoo-boot-scripts and have not yet brought this up in the forum. I am very accustomed  with grub-legacy and don't really have the need to switch. I will take the dialog elsewhere and the message is that if there are some troubles with the boot-scripts I wouldn't notice. 

 

Regarding bootstrap I never did that. I think that the extensions in Skylake compared to Haswell is mainly used in end user applications for video etc and there are no need to bootstrap. Eventually things will be recompiled and after two-three upgrades of binutils and GCC I will be there.

 

So, for now I think my problem is solved; I have Funtoo and XFCE working on my Skylake laptop and the Sun is shining and everything is great :D 

 

Thanks for the help!

// Erik

Share this post


Link to post
Share on other sites
  • 0

What is the status of using gcc-5.3? Will I run into a ton of problem if I unmask? 

 

I recall gcc-3.3. to was it 3.4 or 4.0 was really troublesome some years back. 

 

 

Share this post


Link to post
Share on other sites
  • 0

By the way, although I failed to emerge ebuilds, I was still able to run Sandros two tests with both native and skylake-flaggs. And I only have one version of gcc installed. 

Share this post


Link to post
Share on other sites
  • 0

If you wanna try with latest gcc version in portage tree:

# echo "=sys-devel/gcc-5.3.0-r1">>/etc/portage/package.unmask
# emerge =sys-devel/gcc-5.3.0-r1
# gcc-config -l (will list available versions)
# gcc-config -f N (where N will be the number relative to the newer gcc (2 i think))

Take a look here https://www.phoronix.com/scan.php?page=news_item&px=GCC-5.3-New-Opt-Tests

 

Here https://gcc.gnu.org/gcc-5/changes.html

 

 


IA-32/x86-64
  • New ISA extensions support AVX-512{BW,DQ,VL,IFMA,VBMI} of Intel's CPU codenamed Skylake Server was added to GCC. That includes inline assembly support, new intrinsics, and basic autovectorization. These new AVX-512 extensions are available via the following GCC switches: AVX-512 Vector Length EVEX feature: -mavx512vl, AVX-512 Byte and Word instructions: -mavx512bw, AVX-512 Dword and Qword instructions: -mavx512dq, AVX-512 FMA-52 instructions: -mavx512ifma and for AVX-512 Vector Bit Manipulation Instructions: -mavx512vbmi.
  • New ISA extensions support Intel MPX was added to GCC. This new extension is available via the -mmpx compiler switch. Intel MPX is a set of processor features which, with compiler, run-time library and OS support, brings increased robustness to software by run-time checking pointer references against their bounds. In GCC Intel MPX is supported by Pointer Bounds Checker and libmpx run-time libraries.
  • The new -mrecord-mcount option for -pg generates a Linux kernel style table of pointers to mcount or __fentry__ calls at the beginning of functions. The new -mnop-mcount option in addition also generates nops in place of the __fentry__ or mcount call, so that a call per function can be later patched in. This can be used for low overhead tracing or hot code patching.
  • The new -malign-data option controls how GCC aligns variables. -malign-data=compat uses increased alignment compatible with GCC 4.8 and earlier, -malign-data=abi uses alignment as specified by the psABI, and -malign-data=cacheline uses increased alignment to match the cache line size. -malign-data=compat is the default.
  • The new -mskip-rax-setup option skips setting up the RAX register when SSE is disabled and there are no variable arguments passed in vector registers. This can be used to optimize the Linux kernel.

------------------------------------

Hello :)

Share this post


Link to post
Share on other sites
  • 0

Sadly it failed on xorg-server:

sdksyms.c:316:15: error: expected expression before ?,? token
     (void *) &,                                                  /* /var/tmp/portage/x11-base/xorg-server-1.16.4-r5/work/xorg-server-1.16.4/incl

I will add to the tracker. 

Share this post


Link to post
Share on other sites
  • 0

I think that may be better to open a new discussion in the forum :)

 

If You want, there's also the irc (Freenode, #funtoo).

 

Good for All :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×