[Mesa-dev] [PATCH 8/8] r600/radeonsi: enable glsl/tgsi on-disk cache

Timothy Arceri tarceri at itsqueeze.com
Wed Feb 22 21:27:42 UTC 2017



On 23/02/17 01:57, Marc Dietrich wrote:
> Am Mittwoch, 22. Februar 2017, 15:48:18 CET schrieb Emil Velikov:
>> On 22 February 2017 at 13:31, Marc Dietrich <marvin24 at gmx.de> wrote:
>>> Am Mittwoch, 22. Februar 2017, 04:45:46 CET schrieb Timothy Arceri:
>>>> For gpu generations that use LLVM we create a timestamp string
>>>> containing both the LLVM and Mesa build times, otherwise we just
>>>> use the Mesa build time.
>>>>
>>>> Reviewed-by: Marek Olšák <marek.olsak at amd.com>
>>>> Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
>>>> ---
>>>>
>>>>  src/gallium/drivers/radeon/r600_pipe_common.c | 43
>>>>
>>>> +++++++++++++++++++++++++++ src/gallium/drivers/radeon/r600_pipe_common.h
>>>> |
>>>>
>>>>  3 ++
>>>>  2 files changed, 46 insertions(+)
>>>>
>>>> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c
>>>> b/src/gallium/drivers/radeon/r600_pipe_common.c index 1781584..bae6d6f
>>>> 100644
>>>> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
>>>> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
>>>> @@ -43,6 +43,10 @@
>>>>
>>>>  #define HAVE_LLVM 0
>>>>  #endif
>>>>
>>>> +#if HAVE_LLVM
>>>> +#include <llvm-c/TargetMachine.h>
>>>> +#endif
>>>> +
>>>>
>>>>  #ifndef MESA_LLVM_VERSION_PATCH
>>>>  #define MESA_LLVM_VERSION_PATCH 0
>>>>  #endif
>>>>
>>>> @@ -779,6 +783,41 @@ static const char* r600_get_chip_name(struct
>>>> r600_common_screen *rscreen) }
>>>>
>>>>  }
>>>>
>>>> +static void r600_disk_cache_create(struct r600_common_screen *rscreen)
>>>> +{
>>>> +     uint32_t mesa_timestamp;
>>>> +     if (disk_cache_get_function_timestamp(r600_disk_cache_create,
>>>> +                                           &mesa_timestamp)) {
>>>> +             char *timestamp_str;
>>>> +             int res = -1;
>>>> +             if (rscreen->chip_class < SI) {
>>>> +                     res = asprintf(&timestamp_str,
>>>> "%u",mesa_timestamp);
>>>> +             }
>>>> +#if HAVE_LLVM
>>>> +             else {
>>>> +                     uint32_t llvm_timestamp;
>>>> +                     if
>>>> (disk_cache_get_function_timestamp(LLVMInitializeAMDGPUTargetInfo, +
>>>>                                                       &llvm_timestamp))
>>>> { +                             res = asprintf(&timestamp_str, "%u_%u",
>>>> +                                            mesa_timestamp,
>>>> llvm_timestamp); +                     }
>>>> +             }
>>>> +#endif
>>>
>>> maybe this fails to link later in omx with r600 only compile.
>>>
>>> make[4]: Verzeichnis „/usr/src/dri-project/mesa/src/gallium/targets/omx“
>>> wird betreten
>>>
>>>   CXXLD    libomx_mesa.la
>>>
>>> ../../../../src/gallium/drivers/radeon/.libs/libradeon.a(r600_pipe_common.
>>> o): In function `r600_disk_cache_create':
>>> r600_pipe_common.c:(.text+0x2000): undefined reference to
>>> `LLVMInitializeAMDGPUTargetInfo'
>>> collect2: error: ld returned 1 exit status
>>> make[4]: *** [Makefile:791: libomx_mesa.la] Fehler 1
>>> make[4]: Verzeichnis „/usr/src/dri-project/mesa/src/gallium/targets/omx“
>>> wird verlassen
>>
>> That should not happen since
>>  - Compile guard HAVE_LLVM is defined when --enable-llvm is set
>> (explicitly or not)
>>  - Makefile/link guard HAVE_GALLIUM_LLVM is set when the --enable-llvm is
>>
>> Please make clean/git clean and report the output of make V=1 if the
>> final link still fails.
>
> still same. I added -lLLVMAMDGPUInfo to LLVM_{LDFLAGS|LIBS}. Now it compiles,
> but GL apps crash during context creation. I also tested the initial version
> posted and this worked just fine. I have llvm enabled.


I just built it with omx and only r600 without any issues. Did you do 
'git clean -xfd' of just make clean?

If it's still failing with a git clean then please post the params you 
are using to build mesa.


>
>
> make[4]: Verzeichnis „/usr/src/dri-project/mesa/src/gallium/targets/omx“ wird
> betreten
> /bin/sh ../../../../libtool  --tag=CXX   --mode=link g++  -Wall -fno-math-
> errno -fno-trapping-math  -shared -module -no-undefined -avoid-version -Wl,--
> gc-sections -Wl,--no-undefined -Wl,--version-script=../../../../src/gallium/
> targets/omx/omx.sym -L/usr/lib64   -o libomx_mesa.la -rpath /usr/lib64/
> bellagio libomx_mesa_la-target.lo ../../../../src/gallium/state_trackers/omx/
> libomxtracker.la ../../../../src/gallium/auxiliary/libgalliumvlwinsys.la
> ../../../../src/gallium/auxiliary/libgalliumvl.la ../../../../src/gallium/
> auxiliary/libgallium.la ../../../../src/util/libmesautil.la -lomxil-bellagio -
> lxcb-dri3 -lxcb-present -lxcb-sync -lxshmfence -lxcb-xfixes -lX11-xcb -lX11 -
> lxcb -lxcb-dri2 -ldrm -lm   -lpthread -ldl -ldrm ../../../../src/gallium/
> auxiliary/pipe-loader/libpipe_loader_static.la ../../../../src/gallium/winsys/
> sw/null/libws_null.la ../../../../src/gallium/winsys/sw/wrapper/libwsw.la
> ../../../../src/gallium/winsys/sw/dri/libswdri.la ../../../../src/gallium/
> winsys/sw/kms-dri/libswkmsdri.la -ldrm  ../../../../src/gallium/drivers/r600/
> libr600.la -ldrm -ldrm_radeon -ldrm  ../../../../src/gallium/winsys/radeon/
> drm/libradeonwinsys.la ../../../../src/gallium/drivers/radeon/libradeon.la  -
> lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -
> lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMCodeGen -lLLVMScalarOpts -
> lLLVMInstCombine -lLLVMInstrumentation -lLLVMTransformUtils -lLLVMX86Desc -
> lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -
> lLLVMMCJIT -lLLVMExecutionEngine -lLLVMTarget -lLLVMRuntimeDyld -lLLVMObject -
> lLLVMMCParser -lLLVMBitReader -lLLVMMC -lLLVMBitWriter -lLLVMAnalysis -
> lLLVMProfileData -lLLVMCore -lLLVMSupport
> libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib64/gcc/x86_64-suse-
> linux/6/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/6/
> crtbeginS.o  .libs/libomx_mesa_la-target.o  -Wl,--whole-archive ../../../../
> src/gallium/state_trackers/omx/.libs/libomxtracker.a ../../../../src/gallium/
> auxiliary/.libs/libgalliumvlwinsys.a ../../../../src/gallium/auxiliary/.libs/
> libgalliumvl.a ../../../../src/gallium/auxiliary/.libs/libgallium.a
> ../../../../src/util/.libs/libmesautil.a ../../../../src/gallium/auxiliary/
> pipe-loader/.libs/libpipe_loader_static.a ../../../../src/gallium/winsys/sw/
> null/.libs/libws_null.a ../../../../src/gallium/winsys/sw/wrapper/.libs/
> libwsw.a ../../../../src/gallium/winsys/sw/dri/.libs/libswdri.a ../../../../
> src/gallium/winsys/sw/kms-dri/.libs/libswkmsdri.a ../../../../src/gallium/
> drivers/r600/.libs/libr600.a ../../../../src/gallium/winsys/radeon/drm/.libs/
> libradeonwinsys.a ../../../../src/gallium/drivers/radeon/.libs/libradeon.a -
> Wl,--no-whole-archive  -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/usr/lib64 -L/
> usr/lib64 /usr/lib64/libomxil-bellagio.so -lxcb-dri3 -lxcb-present -lxcb-sync
> -lxshmfence -lxcb-xfixes -lX11-xcb -lX11 -lxcb -lxcb-dri2 -lpthread -ldl -
> lexpat /usr/lib64/libdrm_radeon.so /usr/lib64/libdrm.so -lLLVMX86Disassembler
> -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -
> lLLVMDebugInfoCodeView -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -
> lLLVMInstrumentation -lLLVMTransformUtils -lLLVMX86Desc -lLLVMMCDisassembler -
> lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -
> lLLVMExecutionEngine -lLLVMTarget -lLLVMRuntimeDyld -lLLVMObject -
> lLLVMMCParser -lLLVMBitReader -lLLVMMC -lLLVMBitWriter -lLLVMAnalysis -
> lLLVMProfileData -lLLVMCore -lLLVMSupport -L/usr/lib64/gcc/x86_64-suse-linux/6
> -L/usr/lib64/gcc/x86_64-suse-linux/6/../../../../lib64 -L/lib/../lib64 -L/usr/
> lib/../lib64 -L/opt/intel/compilers_and_libraries_2017.1.132/linux/ipp/lib/
> intel64 -L/opt/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/
> intel64_lin -L/opt/intel/compilers_and_libraries_2017.1.132/linux/mkl/lib/
> intel64_lin -L/opt/intel/compilers_and_libraries_2017.1.132/linux/tbb/lib/
> intel64/gcc4.7 -L/opt/intel/compilers_and_libraries_2017.1.132/linux/daal/lib/
> intel64_lin -L/opt/intel/compilers_and_libraries_2017.1.132/linux/daal/../tbb/
> lib/intel64_lin/gcc4.4 -L/usr/lib64/gcc/x86_64-suse-linux/6/../../../../
> x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/6/../../.. -lstdc++ -
> lm -lc -lgcc_s /usr/lib64/gcc/x86_64-suse-linux/6/crtendS.o /usr/lib64/gcc/
> x86_64-suse-linux/6/../../../../lib64/crtn.o  -Wl,--gc-sections -Wl,--no-
> undefined -Wl,--version-script=../../../../src/gallium/targets/omx/omx.sym   -
> Wl,-soname -Wl,libomx_mesa.so -o .libs/libomx_mesa.so
> ../../../../src/gallium/drivers/radeon/.libs/libradeon.a(r600_pipe_common.o):
> In function `r600_disk_cache_create':
> r600_pipe_common.c:(.text+0x2000): undefined reference to
> `LLVMInitializeAMDGPUTargetInfo'
> collect2: error: ld returned 1 exit status
> make[4]: *** [Makefile:791: libomx_mesa.la] Fehler 1
>
>
>


More information about the mesa-dev mailing list