Code Monkey home page Code Monkey logo

Comments (10)

pablode avatar pablode commented on July 24, 2024 1

I have identified and fixed the clang issues; they were caused by LTO (link time optimization).

from gatling.

pablode avatar pablode commented on July 24, 2024

Hello! Sorry for these issues; I've been meaning to set up a CI but it's not trivial (yet) how to automatically get MDL SDK binaries.

I'll have a look at the GCC issue when I have time. As for Clang - it seems to be fine with AppleClang. Can you verify that the error message has nothing to do with the previous GCC attempt (e.g. clear the build directory)?

from gatling.

adro79 avatar adro79 commented on July 24, 2024

Hi, I can confirm that I deleted the build folder on each try.

from gatling.

pablode avatar pablode commented on July 24, 2024

Hi, I've fixed the GCC issues on the dev branch (tested with GCC 12.3.0 on Ubuntu 23.04).

from gatling.

adro79 avatar adro79 commented on July 24, 2024

That fixed the GCC issue, thanks!

Now I'm facing this issue when linking hdGatling.so with submodules. I tried both in Arch and Ubuntu 22.04 LTS

Arch:

/usr/bin/ld: bin/libturbojpeg.a(turbojpeg.c.o): relocation R_X86_64_TPOFF32 against `errStr' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value

Ubuntu:

[ 99%] Linking CXX shared library ../../bin/hdGatling.so
/usr/bin/ld: ../../bin/libturbojpeg.a(turbojpeg.c.o): relocation R_X86_64_TPOFF32 against `errStr' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status

However, if I edit the files to use system dependencies I can build Gatling but doesn't start.

gatling /mnt/proj/dev/usd-assets/cornell-box/mtlx-ref/cornell-box.usda test.png

USD scene loaded (0.221s)
rebuilding shader cache
material count: 5
creating shader cache..
error in /mnt/data/Applications/AUR/usd-gatling/src/gatling/src/cgpu/src/cgpu.cpp:982: failed to reflect shader
error in /mnt/data/Applications/AUR/usd-gatling/src/gatling/src/cgpu/src/cgpu.cpp:998: invalid resource handle
Coding Error: in _Execute at line 750 of /mnt/data/Applications/AUR/usd-gatling/src/gatling/src/hdGatling/RenderPass.cpp -- Failed verification: ' m_shaderCache ' -- Unable to create shader cache
rebuilding geom cache
instance count: 16
creating geom cache..
[1]    145434 segmentation fault (core dumped)  gatling /mnt/proj/dev/usd-assets/cornell-box/mtlx-ref/cornell-box.usda test.png

usdview /mnt/proj/dev/usd-assets/cornell-box/mtlx-ref/cornell-box.usda

Generation failed: surface shader not found

from gatling.

adro79 avatar adro79 commented on July 24, 2024

These are the changes I applied to be able to build:
gatling.patch.txt

from gatling.

pablode avatar pablode commented on July 24, 2024

Thanks for the patch. I don't/can't really support all versions of external dependencies, so incompatibilities are expected. I strongly advise to use the submodules instead.

I should have fixed the -fPIC error from above; perhaps run git fetch --all && git reset --hard origin/dev?

error in /mnt/data/Applications/AUR/usd-gatling/src/gatling/src/cgpu/src/cgpu.cpp:982: failed to reflect shader

means that something with SPIRV-Reflect went wrong. Perhaps this patch is missing: KhronosGroup/SPIRV-Reflect#191

Could you delete the extern folder and run git checkout dev extern && git submodule update --init --recursive again?
Alternatively, a fresh clone or commenting out cgpu.cpp:559 could work?

from gatling.

adro79 avatar adro79 commented on July 24, 2024

Hi, thanks for the suggestion but seems that I still have problems building with submodules:

[100%] Linking CXX shared library ../../bin/hdGatling.so
/usr/bin/ld: ../../bin/libOpenEXR-3_1.a(ImfIDManifest.cpp.o): in function `Imf_3_1::(anonymous namespace)::catString(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) [clone .constprop.0]':
ImfIDManifest.cpp:(.text+0x506b): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ../../bin/libOpenEXR-3_1.a(ImfIDManifest.cpp.o): in function `Imf_3_1::IDManifest::ChannelGroupManifest::setComponents(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)':
ImfIDManifest.cpp:(.text+0x569f): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ../../bin/libOpenEXR-3_1.a(ImfIDManifest.cpp.o): in function `Imf_3_1::IDManifest::ChannelGroupManifest::insert(unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
ImfIDManifest.cpp:(.text+0x71ab): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ../../bin/libOpenEXR-3_1.a(ImfIDManifest.cpp.o): in function `Imf_3_1::IDManifest::serialize(std::vector<char, std::allocator<char> >&) const':
ImfIDManifest.cpp:(.text+0x80aa): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /opt/materialx/lib/libMaterialXGenMdl.a(MdlShaderGenerator.cpp.o): in function `MaterialX_v1_38_7::MdlShaderGenerator::emitShaderInputs(MaterialX_v1_38_7::VariableBlock const&, MaterialX_v1_38_7::ShaderStage&) const':
(.text+0x2d1d): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /opt/materialx/lib/libMaterialXGenMdl.a(MdlShaderGenerator.cpp.o):(.text+0x2d58): more undefined references to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' follow
collect2: error: ld returned 1 exit status
make[2]: *** [src/hdGatling/CMakeFiles/hdGatling.dir/build.make:3
![test](https://github.com/pablode/gatling/assets/57686179/c17cf31a-3595-4ef0-a42c-f0fab989862e)
98: bin/hdGatling.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:4914: src/hdGatling/CMakeFiles/hdGatling.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

On the other hand, the version without submodules is able to render using the command line 🎉
test

However when I raise the samples this happens:

USD scene loaded (0.002s)
rebuilding shader cache
material count: 10
creating shader cache..
creating RT pipeline..
rebuilding geom cache
instance count: 26
creating geom cache..
total geom buffer size: 23.65MiB
> 2.63MiB faces
> 21.02MiB vertices
recreating output buffer with size 4096x4096 (256.00MiB)
error in /mnt/data/Applications/AUR/usd-gatling/src/gatling/src/cgpu/src/cgpu.cpp:3339: failed to wait for fence
Coding Error: in _Execute at line 805 of /mnt/data/Applications/AUR/usd-gatling/src/gatling/src/hdGatling/RenderPass.cpp -- Failed verification: ' result == GI_OK ' -- Unable to render scene.
Rendering finished (7.013s)
Wrote image (0.951s)
error in /mnt/data/Applications/AUR/usd-gatling/src/gatling/src/cgpu/src/cgpu.cpp:3339: failed to wait for fence

usdview still fails to load gatling:
Generation failed: surface shader not found

from gatling.

pablode avatar pablode commented on July 24, 2024

That's great to hear!

The failed to wait for fence error with high sample counts is probably due to a watchdog timeout. Perhaps disable it?

Generation failed: surface shader not found - it sounds to me that the MaterialX libraries were not loaded. Since the standalone also uses Hydra, I suspect that this is a USD problem. Perhaps set PXR_MTLX_STDLIB_SEARCH_PATHS to <USD_INSTALL>/libraries?

from gatling.

pablode avatar pablode commented on July 24, 2024

Hi, I've added Linux builds to the CI, so compilation should work in general. Regarding the surface shader not found issue - USD doesn't like being moved around, perhaps that happened here. PXR_MTLX_STDLIB_SEARCH_PATHS from above should help with the discovery of MaterialX's libraries folder here.

Going to close this issue, let me know if there's trouble!

from gatling.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.