i965 (sandy-bridge): mesa-git DRI drivers is not linked against libdrm-git (libdrm_intel.so)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 20, 2013 at 2:39 PM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
> On Sun, Jan 20, 2013 at 2:30 PM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
>> Hi,
>>
>> I am here on Ubuntu/precise AMD64.
>>
>> With the attached scripts I can't use a i965_dri.so for example from
>> gles3 GIT tree.
>>
>> First, I have built libdrm-2.4.41, installed and ldconfig-ed it before
>> building mesa.
>>
>> I have chosen a classic XORG prefix!
>>
>> [ /etc/ld.so.conf.d/xorg.conf ]
>>
>> # Xorg lib configuration
>> /opt/xorg/lib
>>
>> For the build of mesa I have suppressed generating any GALLIUM driver
>> as there exists AFAICS none for the Intel sandy-bridge GPU.
>> But I am building the i965 classic MESA/DRI driver!
>>
>> [ build_mesa.sh ]
>> ...
>> DRI_DRIVERS="i965"
>> GALLIUM_DRIVERS=""
>> ...
>> DRI_CFG_OPTS="--with-dri-drivers=$DRI_DRIVERS"
>> GALLIUM_CFG_OPTS="--with-gallium-drivers=$GALLIUM_DRIVERS"
>> ...
>> [ /build_mesa.sh ]
>>
>> For the build of mesa I have these EXPORTS (Thanks Peter [1]):
>>
>> ### Set prefix for XORG installation
>> PREFIX="/opt/xorg"
>>
>> ### Export some useful XORG settings
>> export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
>> export LD_LIBRARY_PATH="$PREFIX/lib"
>> export LDFLAGS="-L$PREFIX/lib"
>> export PATH="$PREFIX/bin:$PATH"
>>
>> NOTE: I have thrown away any development packages like libdrm-dev
>> which could have caused PKGCONFIG troubles.
>>
>> When I am checking the OPENGL version, I get this:
>>
>> $ LIBGL_DEBUG=verbose LIBGL_DRIVERS_PATH=/opt/xorg/lib/dri glxinfo |
>> grep -i opengl
>> libGL: OpenDriver: trying /opt/xorg/lib/dri/tls/i965_dri.so
>> libGL: OpenDriver: trying /opt/xorg/lib/dri/i965_dri.so
>> libGL error: dlopen /opt/xorg/lib/dri/i965_dri.so failed
>> (/opt/xorg/lib/dri/i965_dri.so: undefined symbol:
>> drm_intel_gem_context_create) <--- THIS IS DEFINED IN NEW LIBDRM!
>> libGL error: unable to load driver: i965_dri.so
>> libGL error: driver pointer missing
>> libGL: OpenDriver: trying /opt/xorg/lib/dri/tls/swrast_dri.so
>> libGL: OpenDriver: trying /opt/xorg/lib/dri/swrast_dri.so
>> libGL error: dlopen /opt/xorg/lib/dri/swrast_dri.so failed
>> (/opt/xorg/lib/dri/swrast_dri.so: cannot open shared object file: No
>> such file or directory)
>> libGL error: unable to load driver: swrast_dri.so
>> libGL error: reverting to indirect rendering
>> OpenGL vendor string: Tungsten Graphics, Inc
>> OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile
>> OpenGL version string: 1.4 (3.0 Mesa 8.0.4) <--- FALLBACK TO UBUNTUS
>> ORIGINAL MESA!
>> OpenGL extensions:
>>
>> Investigating deeper with LDD:
>>
>> $ sudo ldd /opt/xorg/lib/dri/i965_dri.so | egrep 'libdri|libdrm|libkm'
>>         libdricore9.0.1.so.1 => /opt/xorg/lib/libdricore9.0.1.so.1
>> (0x00007fe4a2f37000)
>>         libdrm_intel.so.1 =>
>> /usr/lib/x86_64-linux-gnu/libdrm_intel.so.1 (0x00007fe4a26ce000)
>>         libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2
>> (0x00007fe4a24c2000)
>>
>> Investigating harder with nm:
>>
>> $ nm /opt/xorg/lib/libdrm_intel.so | grep drm_intel_gem_context_create
>> 0000000000009ab0 T drm_intel_gem_context_create
>>
>> OK, so my NEW i965_dri.so was not built against NEW libdrm.
>> But why the hell it is not?
>>
>> Do I need to build a new DDX (xf86-video-intel), too?
>> Or is other software missing?
>>
>> /me -> CONFUSED as building mesa-8.0.5 with cherry-picked LLVM patches
>> from upstream [2] worked here!
>>
>> As a sidenote: I am building here with LLVM/CLANG v3.2 if this matters.
>>
>> Any help appreciated!
>>
>> Regards,
>> - Sedat -
>>
>> P.S.: When I am building swrast (llvmpipe) GALLIUM driver that works.
>>
>> [1] http://who-t.blogspot.de/2009/04/my-workflow.html
>> [2] http://lists.freedesktop.org/archives/dri-devel/2013-January/033614.html
>
> Having a look at config.log:
>
> $ egrep -i 'libdrm|intel|libkms' config.log | egrep
> '^ac_cv_env|^pkg_cv|^INTEL|^LIB'
> ac_cv_env_INTEL_CFLAGS_set=
> ac_cv_env_INTEL_CFLAGS_value=
> ac_cv_env_INTEL_LIBS_set=
> ac_cv_env_INTEL_LIBS_value=
> ac_cv_env_LIBDRM_CFLAGS_set=
> ac_cv_env_LIBDRM_CFLAGS_value=
> ac_cv_env_LIBDRM_LIBS_set=
> ac_cv_env_LIBDRM_LIBS_value=
> ac_cv_env_LIBDRM_XORG_CFLAGS_set=
> ac_cv_env_LIBDRM_XORG_CFLAGS_value=
> ac_cv_env_LIBDRM_XORG_LIBS_set=
> ac_cv_env_LIBDRM_XORG_LIBS_value=
> ac_cv_env_LIBKMS_XORG_CFLAGS_set=
> ac_cv_env_LIBKMS_XORG_CFLAGS_value=
> ac_cv_env_LIBKMS_XORG_LIBS_set=
> ac_cv_env_LIBKMS_XORG_LIBS_value=
> pkg_cv_INTEL_CFLAGS='-I/opt/xorg/include -I/opt/xorg/include/libdrm  '
> pkg_cv_INTEL_LIBS='-L/opt/xorg/lib -ldrm_intel -ldrm  '
> pkg_cv_LIBDRM_CFLAGS='-I/opt/xorg/include -I/opt/xorg/include/libdrm  '
> pkg_cv_LIBDRM_LIBS='-L/opt/xorg/lib -ldrm  '
> INTEL_CFLAGS='-I/opt/xorg/include -I/opt/xorg/include/libdrm  '
> INTEL_LIBS='-L/opt/xorg/lib -ldrm_intel -ldrm  '
> LIBDRM_CFLAGS='-I/opt/xorg/include -I/opt/xorg/include/libdrm  '
> LIBDRM_LIBS='-L/opt/xorg/lib -ldrm  '
> LIBDRM_XORG_CFLAGS=''
> LIBDRM_XORG_LIBS=''
> LIBKMS_XORG_CFLAGS=''
> LIBKMS_XORG_LIBS=''
>
> - Sedat -

So, the problem is caused by the usage of xorg.conf filename in
/etc/ld.so.conf.d/ directory.

The systemwide LIBDRM shared-libs (see
/etc/ld.so.conf.d/x86_64-linux-gnu.conf) have a higher position in the
ldconfig-cache and considered at rank #1 before mine.

Solve this by renaming xorg.conf -> a-local-xorg.conf (YUPP, the
filename matters!).

I have also built the Intel XORG video driver and executing...

     LIBGL_DEBUG=verbose LIBGL_DRIVERS_PATH=/opt/xorg/lib/dri glxgears

...now uses i965_dri.so and intel_drv.so from my /opt/xorg installation.

Unfortunately, the generated libGL.so from gles3 mesa GIT tree is a
bit "buggy" (segfaults in FFX and unity-3d is unusable).
Handling of libGL.so version in Ubuntu is done a bit uncomfortably via
/usr/lib/x86_64-linux-gnu/mesa/ld.so.conf file.
But this is a different story...

Attached are my build-scripts with a lot of comments.
So, I hope I catched all problems with building LIBDRM/MESA with LLVM/CLANG.

A big thank-you to Edwin for the vital help.

- Sedat -

$ cat /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf
/usr/lib/x86_64-linux-gnu/mesa

$ cat /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf_myXORG-1st
/usr/lib/x86_64-linux-gnu/mesa
/opt/xorg/lib
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_libdrm.sh
Type: application/x-sh
Size: 1689 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20130121/9019a665/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_mesa.sh
Type: application/x-sh
Size: 3025 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20130121/9019a665/attachment-0001.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_xf86-video-intel.sh
Type: application/x-sh
Size: 1302 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20130121/9019a665/attachment-0002.sh>


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux