Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Intel / AMD compilers
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
e8root
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2024
Posts: 94

PostPosted: Sat Mar 16, 2024 10:53 pm    Post subject: Intel / AMD compilers Reply with quote

Recently I played with Intel compiler. Managed to install "Intel® oneAPI DPC++/C++ Compiler" version 2024.0.2 from https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#dpcpp-cpp

My supposedly fastest intel config from /etc/portage/env
Code:
COMMON_FLAGS="-O${OPT_LEVEL} -pipe -mtune=native -fomit-frame-pointer -DNDEBUG -flto -fiopenmp -qopenmp -ipo -xhost -axhost"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-O2 -Wl,--as-needed -ipo"

CC="/opt/intel/oneapi/compiler/2024.0/bin/icx"
CXX="/opt/intel/oneapi/compiler/2024.0/bin/icpx"
CPP="clang-cpp"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"

OPT_LEVEL is separate env config where I can specify O level alongside which compiler to use in package list in /etc/portage/package.env.
So far I built xorg-server and its drivers, pulse audio and all X11 libs and didn't observe any issues for two days.
Only with LTO I had to make few symlinks of intel's libraries to /usr/lib64. The libraries I had to add were all listed when trying to run program. To build I had at first to source setvars.sh script from compiler installation but after adding symlinks to libraries it was not necessary anymore.

Anyways, any suggestions what could be improved for getting absolutely the best performance possible?

------
I also installed (unpacked tar) AMD Optimizing C/C++ and Fortran Compilers (AOCC) from https://www.amd.com/en/developer/aocc.html
I didn't play as much because I am proud user of Intel Raptor Lake but it seems to work fine compiling xterm. In this case I guess performance won't be any better. I do have Carrizo (latest Bulldozer version) CPU in HP-T630 which I plan upgrading to Gentoo from some Debian that runs on it now but I don't think AOCC is optimized for pre-Zen processors and I might just as well use normal GCC/Clang.

It might however make sense to use this compiler for for Zen3 or 4 so anyone has any tweaks for this compiler?
Code:
COMMON_FLAGS="-O${OPT_LEVEL} -march=native -pipe -mtune=native -fomit-frame-pointer -DNDEBUG -flto"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-O2 -Wl,--as-needed"

CC="/opt/amd/compiler/bin/clang"
CPP="/opt/amd/compiler/bin/clang-cpp"
CXX="//opt/amd/compiler/bin/clang++"
AR="/opt/amd/compiler/bin/llvm-ar"
NM="/opt/amd/compiler/bin/llvm-nm"
RANLIB="/opt/amd/compiler/bin/llvm-ranlib"


Also, any recommendations where it comes to benchmarks?
_________________
Unix Wars - Episode V: AT&T Strikes Back
Back to top
View user's profile Send private message
e8root
Tux's lil' helper
Tux's lil' helper


Joined: 09 Feb 2024
Posts: 94

PostPosted: Sun Mar 17, 2024 11:34 am    Post subject: Reply with quote

Checking directories with Intel compiler I found there is whole "compiler" directory with clang executables - presumably better matched with Intel compiler than system's own Clang 18.
After setting paths to executables in env I figured better way to ensure that any clang tool called will be from from Intel's compiler - by setting PATH inside env file. Something like:
Code:
PATH="/opt/intel/oneapi/compiler/2024.0/bin:/opt/intel/oneapi/compiler/2024.0/bin/compiler:${PATH}"

CC="icx"
CPP="clang-cpp"
CXX="icpx"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"


Otherwise I recompiled most X11/Wayland packages which compiled with oneAPI with it at -O2 except few video codec related packages and pulseaudio which got -O3 treatment as if anything those cases can be CPU intensive, won't affect much and and fairly easy to identify and debug. I didn't touch anything serious like system and terminal based tools and these I compile GCC for boring safety.

As far as opeAPI optimizations go there is also -Ofast but all my tests I did in the past with Intel compilers indicate it should not really be used without extensive testing as it can create non-working or glitching out binaries. I even tried building base X11 system with -Ofast but afterwards X11 would not even start.
_________________
Unix Wars - Episode V: AT&T Strikes Back
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum