LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   care to share? (ati and compiling again) (https://www.linuxquestions.org/questions/slackware-14/care-to-share-ati-and-compiling-again-4175497737/)

TobiSGD 04-23-2014 03:25 PM

Quote:

Originally Posted by hendrickxm (Post 5157954)
Did you build llvm3.4?

I did it like described here: http://www.linuxquestions.org/questi...7/#post5144836

truepatriot76 04-27-2014 03:05 AM

Hi all. Longtime lurker - first post here.

I did manage to get this going largely through PhantomX's slackbuilds. I have an AMD Kaveri system and needed the newer drivers, currently using Kernel 3.14.1.

Few notes that may help:

Compiled latest libdrm - (PhantomX)

Compiled llvm3.4 and added --enable-shared - (Slackware64 current)

Compiled libvdpau, presentproto, xcbproto, libxcb, libxshmfence, latest automake, dri3proto, libclc, ocl-icd - (PhantomX)

Compiled Mesa.10.1.1 with PhantomX's slackbuild with the following changes:
added CPPFLAGS="-I/usr/include/libelf" - above CFLAGS
added --enable-vdpau \
modified --with-clang-libdir=/usr/lib${LIBDIRSUFFIX} \
modified --with-egl-platforms=x11,drm \ - No wayland!
and commented out: find ${PKG} -name '*.la' -delete - which caused mesa-demos to fail to build

Compiled libvdpau (again)

Compiled mesa-demos

Compiled glamor-egl

Compiled xf86-video-ati-7.3.0

Created glamor.conf per freedesktop.org

eliminated xorg.conf

Stuferus 04-28-2014 05:17 AM

PhantomX= https://github.com/PhantomX/slackbuilds/

just so everyone knows :)

truepatriot76 04-30-2014 01:04 AM

Quote:

Originally Posted by Stuferus (Post 5160443)
PhantomX= https://github.com/PhantomX/slackbuilds/

just so everyone knows :)

Thanks Sturferus - couldn't post links in my first LQ post.

Seems my success was a bit premature and I was getting software rendering in openGL. Finally got mesa 10.1.1 dialed in (had to match the CFLAGS and CXXFLAGS with LLVM for it to play nicely)- here's the modified SlackBuild that works with my Kaveri system:

mesa.SlackBuild
Code:

#!/bin/sh
#-- mesa for Slackware --
# Build script by Phantom X <megaphantomx at bol.com.br> **modified**!
# Suggested usage: $ mesa.SlackBuild 2>&1 | tee build.log
#--
# Copyright 2008-2014 Phantom X, Goiania, Brazil.
# Copyright 2006 Martijn Dekker, Groningen, Netherlands.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# http://www.mesa3d.org/

PACKAGER_ID=${PACKAGER_ID:-$USER}
PACKAGER=${PACKAGER:-$USER@$HOSTNAME}

# Set YES for native build with gcc >= 4.2
SB_NATIVE=${SB_NATIVE:-NO}

# Set to YES to replicate slackbuild and patches
SB_REP=${SB_REP:-YES}

CWD=$(pwd)
TMP=${TMP:-/tmp}
if [ ! -d ${TMP} ]; then
  mkdir -p ${TMP}
fi

PNAME=Mesa
NAME=mesa
PKG=${PKG:-${TMP}/package-${NAME}}

VERSION=${VERSION:-10.1.1}
if [ "$( echo ${VERSION} | cut -d . -f 3 )" -eq 0 ] ;then
  SVER=$(echo ${VERSION} | cut -d- -f1 | cut -d . -f 1-2 )
else
  SVER=$(echo ${VERSION} | cut -d- -f1 )
fi
if [ "${SB_NATIVE}" = "YES" ] ;then
  ARCH=${ARCH:-$(uname -m)}
else
  ARCH=${ARCH:-x86_64}
fi
if [ "${ARCH}" = "x86_64" ] ;then
  SLKTARGET=${SLKTARGET:-x86_64}
else
  SLKTARGET=${SLKTARGET:-i486}
fi
SLKDTARGET=${SLKDTARGET:-slackware}
BUILD=${BUILD:-1}
NJOBS=${NJOBS:-$(( $(getconf _NPROCESSORS_ONLN) + 1 ))}
DOCDIR=${PKG}/usr/doc/${NAME}-${VERSION}
SBDIR=${PKG}/usr/src/slackbuilds/${NAME}
PKGDEST=${PKGDEST:-${CWD}}
PKGFORMAT=${PKGFORMAT:-txz}
PKGNAME=${NAME}-$(echo ${VERSION} | tr - . )-${ARCH}-${BUILD}${PACKAGER_ID}

DATE=$(LC_ALL=C date +%d-%b-%Y)

SRCDIR=${PNAME}-${VERSION}
SRCARCHIVE=${PNAME}Lib-${VERSION}.tar.bz2
SRCARCHIVE2=${PNAME}GLUT-${VERSION}.tar.bz2
ESRCARCHIVE=nouveau_class.h.xz

DL_PROG=${DL_PROG:-wget}
DL_TO=${DL_TO:-5}
DL_OPTS=${DL_OPTS:-"--timeout=${DL_TO}"}
MIRROR_SF=${MIRROR_SF:-http://prdownloads.sourceforge.net}
DL_URL="ftp://ftp.freedesktop.org/pub/mesa/${SVER}"
DL_URL2="${MIRROR_SF}/mesa3d"
DL_URLB="http://www.mesa3d.org/beta"
DL_URLB2="ftp://ftp.freedesktop.org/pub/mesa/beta"
EDL_URL="http://cloud.github.com/downloads/PhantomX/slackbuilds/${ESRCARCHIVE}"

# if source is not present, download in source rootdir if possible
test -r ${CWD}/${SRCARCHIVE} || ${DL_PROG} ${DL_OPTS} ${DL_URLB}/${SRCARCHIVE} || ${DL_PROG} ${DL_OPTS} ${DL_URLB2}/${SRCARCHIVE}
test -r ${CWD}/${SRCARCHIVE} || ${DL_PROG} ${DL_OPTS} ${DL_URL}/${SRCARCHIVE} || ${DL_PROG} ${DL_OPTS} ${DL_URL2}/${SRCARCHIVE} || exit 1

if [ "${SB_GLUT}" = "YES" ] ; then
  test -r ${CWD}/${SRCARCHIVE2} || \
    ${DL_PROG} ${DL_OPTS} ${DL_URLB}/${SRCARCHIVE2} || ${DL_PROG} ${DL_OPTS} ${DL_URLB2}/${SRCARCHIVE2}
  test -r ${CWD}/${SRCARCHIVE2} || \
    ${DL_PROG} ${DL_OPTS} ${DL_URL}/${SRCARCHIVE2} || ${DL_PROG} ${DL_OPTS} ${DL_URL2}/${SRCARCHIVE2} || exit 1
fi
#test -r ${CWD}/${ESRCARCHIVE} || ${DL_PROG} ${DL_OPTS} ${HDL_URL}/${ESRCARCHIVE} || exit 1

if [ "${SB_NATIVE}" = "YES" ] ;then
  SLKCFLAGS="-O2 -march=native -mtune=native -pipe"
  [ "${SB_ECFLAGS}" ] && SLKCFLAGS="${SLKCFLAGS} ${SB_ECFLAGS}"
else
  case "${ARCH}" in
    i[3-6]86)    SLKCFLAGS="-O2 -march=${ARCH} -mtune=i686"
                ;;
    x86_64)      SLKCFLAGS="-O2 -fPIC"
                ;;
    s390|*)      SLKCFLAGS="-O2"
                ;;
  esac
fi
if [ "${ARCH}" = "x86_64" ] ;then
  LIBDIRSUFFIX="64"
  SLKCFLAGS="${SLKCFLAGS} -fPIC"
else
  LIBDIRSUFFIX=""
fi

if [ -d ${PKG} ]; then
  # Clean up a previous build
  rm -rf ${PKG}
fi
mkdir -p ${PKG}

cd ${TMP}
rm -rf ${SRCDIR}
tar -xvf ${CWD}/${SRCARCHIVE} || exit 1
if [ "${SB_GLUT}" = "YES" ] ; then
  tar -xvf ${CWD}/${SRCARCHIVE2} || exit 1
fi
cd ${SRCDIR} || exit 1

chmod -R u+w,go+r-w,a-s .

unset SB_AUTOGEN
if [ -r ${CWD}/apply-patches.sh ]; then
  . ${CWD}/apply-patches.sh
fi

# radeonsi - needs llvm 3.2 with R600 target
SB_GALLIUMDRV="r300,r600,nouveau,radeonsi,svga,swrast"

if [ "${SB_AUTOGEN}" = "YES" ] ;then
  autoreconf -ivf || exit $?
fi

CPPFLAGS="-I/usr/include/libelf" \
CFLAGS="${SLKCFLAGS}" \
CXXFLAGS="${SLKCFLAGS}" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var/lib \
  --infodir=/usr/info \
  --mandir=/usr/man \
  --docdir=/usr/doc/${NAME}-${VERSION} \
  --disable-silent-rules \
  --with-dri-driverdir=/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri \
  --enable-glx-tls \
  --enable-texture-float=yes \
  --enable-egl \
  --with-egl-platforms=x11,drm \
  --enable-gles1 \
  --enable-gles2 \
  --enable-shared-glapi \
  --enable-gbm \
  --with-gallium-drivers=${SB_GALLIUMDRV} \
  --enable-gallium-llvm \
  --with-llvm-shared-libs \
  --enable-vdpau \
  --enable-openvg \
  --enable-gallium-egl \
  --enable-opencl \
  --enable-opencl-icd \
  --with-clang-libdir=/usr/lib${LIBDIRSUFFIX} \
  --enable-osmesa \
  --enable-xa \
  --build=${SLKTARGET}-${SLKDTARGET}-linux || exit 1

# Build and install:
make clean
make -j${NJOBS} || make || exit 1
make install DESTDIR=${PKG} DRI_DIRS= || exit $?

# find ${PKG} -name '*.la' -delete

mkdir -p ${PKG}/usr/include/KHR
install -m 0644 include/KHR/*.h ${PKG}/usr/include/KHR/ || exit 1

# just the DRI drivers that are sane
mkdir -p ${PKG}/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri

for f in i810 i915 i965 mach64 mga r128 r300 r600 radeonsi savage sis swrast tdfx unichrome nouveau gallium/vmwgfx ; do
  so=lib${LIBDIRSUFFIX}/${f}_dri.so
  test -e ${so} && echo ${so}
done | xargs install -m 0755 -t ${PKG}/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri/ >& /dev/null

# Hack to not conflicting with nvidia-glx
mkdir -p ${PKG}/usr/lib${LIBDIRSUFFIX}/mesa

for libname in libEGL libGL libGLESv2 ;do
  mv ${PKG}/usr/lib${LIBDIRSUFFIX}/${libname}.so.* \
    ${PKG}/usr/lib${LIBDIRSUFFIX}/mesa/ || exit 1
  reldir=mesa
  oldlink=$(readlink ${PKG}/usr/lib${LIBDIRSUFFIX}/${libname}.so)
  ln -sf ${reldir}/$(basename ${oldlink}) ${PKG}/usr/lib${LIBDIRSUFFIX}/${libname}.so || exit 1
done

# ld.so.conf
mkdir -p ${PKG}/etc/ld.so.conf.d
echo "/usr/lib${LIBDIRSUFFIX}/mesa" \
  > ${PKG}/etc/ld.so.conf.d/98-mesa-${ARCH}.conf || exit 1

rm -f ${PKG}/usr/include/GL/{glew,glxew,wglew,glf*,glut*}.h
rm -f ${PKG}/usr/include/GL/[a-fh-np-wyz]*.h

find ${PKG} | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null

mv ${PKG}/etc/drirc ${PKG}/etc/drirc.new || exit 1

# Add a documentation directory:
mkdir -p ${DOCDIR}
cp -a \
  docs/* ${CWD}/ChangeLog.SB \
  ${DOCDIR}/
rm -f ${DOCDIR}/{RELNOTES,relnotes}*
cp -a docs/{RELNOTES-${VERSION},relnotes-${VERSION}.html,relnotes.html} \
      ${DOCDIR}/
find ${DOCDIR}/ -type d -print0 | xargs -0 chmod 0755
find ${DOCDIR}/ -type f -print0 | xargs -0 chmod 0644

# Compress and link manpages, if any:
if [ -d ${PKG}/usr/share/man ]; then
  mv ${PKG}/usr/share/man ${PKG}/usr/man
  rmdir ${PKG}/usr/share
fi
if [ -d ${PKG}/usr/man ]; then
  ( cd ${PKG}/usr/man
    for manpagedir in $(find . -type d -name "man*") ; do
      ( cd ${manpagedir}
        for eachpage in $( find . -type l -maxdepth 1) ; do
          ln -s $( readlink ${eachpage} ).gz ${eachpage}.gz
          rm ${eachpage}
        done
        gzip -9 *.?
        # Prevent errors
        rm -f *.gz.gz
      )
    done
  )
fi

mkdir -p ${PKG}/install
cat ${CWD}/slack-desc > ${PKG}/install/slack-desc
cat ${CWD}/slack-required > ${PKG}/install/slack-required

cat > ${PKG}/install/doinst.sh <<EOF
#!/bin/sh
config() {
  NEW="\$1"
  OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r \$OLD ]; then
    mv \$NEW \$OLD
  elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then
    # toss the redundant copy
    rm \$NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
## List of conf files to check.  The conf files in your package should end in .new
EOF

( cd ${PKG}
  find etc/ -name '*.new' -exec echo config {} ';' | sort >> ${PKG}/install/doinst.sh
  find etc/ -name '*.new' -a -size 0 -exec echo rm -f {} ';' | sort >> ${PKG}/install/doinst.sh
  echo >> ${PKG}/install/doinst.sh
)

cat >> ${PKG}/install/doinst.sh <<'EOF'
# Add ld.so.conf.d directory to /etc/ld.so.conf:
if fgrep ld.so.conf.d etc/ld.so.conf 1> /dev/null 2> /dev/null ; then
  true
else
  echo 'include /etc/ld.so.conf.d/*.conf' >> etc/ld.so.conf
fi
EOF

sed -i "s|_PACKAGER|${PACKAGER}|g; s|_BUILD_DATE|${DATE}|g" \
      ${PKG}/install/slack-desc

if [ "${SB_REP}" = "YES" ] ;then
  # Replicate slackbuild and patches
  mkdir -p ${SBDIR}/patches
  install -m0644 ${CWD}/slack-desc ${CWD}/slack-required ${CWD}/ChangeLog.SB \
                ${CWD}/apply-patches.sh ${SBDIR}/
  install -m0755 ${CWD}/${NAME}.SlackBuild \
                ${SBDIR}/${NAME}.SlackBuild
  install -m0644 ${CWD}/patches/*.* \
                ${SBDIR}/patches/
  rmdir ${SBDIR}/patches
fi

# Build package:
set +o xtrace        # no longer print commands upon execution

ROOTCOMMANDS="set -o errexit -o xtrace ; cd ${PKG} ;
  /bin/chown --recursive root:root .  ;"

ROOTCOMMANDS="${ROOTCOMMANDS}
  /sbin/makepkg --linkadd y --chown n ${PKGDEST}/${PKGNAME}.${PKGFORMAT} "

if test ${UID} = 0; then
  eval ${ROOTCOMMANDS}
  set +o xtrace
elif test "$(type -t fakeroot)" = 'file'; then
  echo -e "\e[1mEntering fakeroot environment.\e[0m"
  echo ${ROOTCOMMANDS} | fakeroot
else
  echo -e "\e[1mPlease enter your root password.\e[0m (Consider installing fakeroot.)"
  /bin/su -c "${ROOTCOMMANDS}"
fi

# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
  echo "Cleaning..."
  if [ -d ${TMP}/${SRCDIR} ]; then
    rm -rf ${TMP}/${SRCDIR} && echo "${TMP}/${SRCDIR} cleanup completed"
  fi
  if [ -d ${PKG} ]; then
    rm -rf ${PKG} && echo "${PKG} cleanup completed"
  fi
  rmdir ${TMP} && echo "${TMP} cleanup completed"
fi
exit 0

Code:

glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD KAVERI
OpenGL core profile version string: 3.1 (Core Profile) Mesa 10.1.1
OpenGL core profile shading language version string: 1.40
OpenGL core profile context flags: (none)
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.1.1
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:


Stuferus 05-01-2014 05:44 AM

Quote:

Originally Posted by truepatriot76 (Post 5161682)
Code:

glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD KAVERI
OpenGL core profile version string: 3.1 (Core Profile) Mesa 10.1.1
OpenGL core profile shading language version string: 1.40
OpenGL core profile context flags: (none)
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.1.1
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:


What about "glxinfo | grep direct" and fps with glxgears?
thanks

Dr.Thodt 05-01-2014 01:14 PM

thanks truepatriot76, can you please post your mesa-compat32.SlackBuild

truepatriot76 05-01-2014 08:39 PM

Quote:

Originally Posted by Stuferus (Post 5162506)
What about "glxinfo | grep direct" and fps with glxgears?
thanks

Sure - see below:

Code:

glxinfo | grep direct
direct rendering: Yes

Code:

vblank_mode=0 glxgears
ATTENTION: default value of option vblank_mode overridden by environment.
12669 frames in 5.0 seconds = 2533.703 FPS
13071 frames in 5.0 seconds = 2613.991 FPS
13076 frames in 5.0 seconds = 2615.091 FPS
13069 frames in 5.0 seconds = 2613.749 FPS
13037 frames in 5.0 seconds = 2607.241 FPS
13086 frames in 5.0 seconds = 2617.198 FPS

Quote:

Originally Posted by Dr.Thodt (Post 5162784)
thanks truepatriot76, can you please post your mesa-compat32.SlackBuild

Unfortunately Dr T, I'm not running multilib (yet?) just 64bit, but I would imagine the same changes I made in the SlackBuild above would also have to be made to the SlackBuild here

truepatriot76 05-04-2014 08:15 PM

Quote:

Originally Posted by Stuferus (Post 5162506)
What about "glxinfo | grep direct" and fps with glxgears?
thanks

Just an update - with kernel 3.14.2 here are the numbers:

Code:

vblank_mode=0 glxgears
ATTENTION: default value of option vblank_mode overridden by environment.
23898 frames in 5.0 seconds = 4779.568 FPS
24318 frames in 5.0 seconds = 4863.411 FPS
24365 frames in 5.0 seconds = 4872.862 FPS
23923 frames in 5.0 seconds = 4784.448 FPS
24024 frames in 5.0 seconds = 4804.614 FPS
24031 frames in 5.0 seconds = 4806.098 FPS

Looks like some tangible benefits from using the newer kernel.

TobiSGD 05-04-2014 08:17 PM

glxgears is by no means a benchmark of modern GPUs or GPU drivers, it is rather a CPU benchmark, so increases or decreases there don't say much about actual graphics performance.

Dr.Thodt 05-05-2014 09:45 PM

Hey guys, i've got things up and running, the way truepatriot76 explained it. Had to add a few things like opencl-headers, ended up throwing wayland on...
everything seems to be working fine, no more 'opengl driver swrast not found' errors as explained in the first post. I installed and played some games on steam.
The only thing i notice, is i get this: (multilib system)
ldconfig
ldconfig: /usr/lib64/libOpenCL.so.1 is not a symbolic link
ldconfig: /usr/lib/libOpenCL.so.1 is not a symbolic link

i've tried re-installing libclc, still get the warning
does anyone else have this? Any ideas?

Stuferus 05-06-2014 07:08 AM

i dont like wayland.. but good to hear all works for you.

schmatzler 05-06-2014 11:45 AM

I'm not sure why some of you people build so many dependencies. For Mesa 10.1.2 I only had to build 6 packages and I end up with a full Mesa build that supports ATI, NVidia, Intel and the rest.

I just took most of the packages from wlsbuild and modified the mesa slackbuild a bit.

In the right order:

dri3proto
presentproto
libdrm
libvdpau (can be optional)
llvm
mesa

My sources and packages for Slackware64-current are here.

Just played a round of Painkiller: Hell & Damnation with my Radeon 6800 - absolutely awesome.

Edit: -compat32 needs some little tweaks, because llvm-config always chooses one level up as the ldpath which results in 32bit-llvm returning /usr/bin/lib as the ldpath. Nothing a little temporary symlink can't fix. SlackBuilds are up, too! :) Steam + Wine are much more usable now for me.

truepatriot76 05-06-2014 08:28 PM

Quote:

Originally Posted by schmatzler (Post 5165734)
I'm not sure why some of you people build so many dependencies.

I won't speak for everyone, but I have newer hardware - so I wanted to enable as much as I could in mesa and also wanted glamor and vdpau. Since my hardware only shows up in the very latest xf86-video-ati-7.3 drivers, I also needed that too. Everyone has different hardware and different goals. I'm not used to seeing newer hardware being supported so quickly in linux. It's a beautiful thing!

TobiSGD 05-07-2014 10:00 AM

Quote:

Originally Posted by schmatzler (Post 5165734)
I'm not sure why some of you people build so many dependencies.

The other dependencies are needed for xf86-video-ati-7.3 and xorg-server-1.15. By the way, using Glamor for 2D acceleration has made my machine much more smooth, I can recommend that for users of HD6000 series and newer. Have to look how that works on previous hardware when Mesa 10.2 is released, which will support Glamor on older hardware.

moisespedro 05-07-2014 11:57 AM

I also moved to Gentoo (~amd64 branch) and I am glad everything works fine on it.


All times are GMT -5. The time now is 08:31 AM.