Code Monkey home page Code Monkey logo

Comments (9)

flightlessmango avatar flightlessmango commented on June 14, 2024

Can you please verify that it is 0.7.1 with the version option in mangohud

from mangohud.

alioguzhan avatar alioguzhan commented on June 14, 2024

I can confirm that the version is 0.7.1. Here is the error log:

[🡕] Process 1885954 (mangohud) of user 1000 dumped 
Module /nix/store/7ihbjzic97238sq8bnpyyvbdygc6qdls-libxcb-1.16/lib/libxcb.so.1.1.0 without build-id.
Module /nix/store/1bapla8zwlx128i42wi08zbiibwk6gm3-libglvnd-1.7.0/lib/libGLdispatch.so.0.0.0 without build-id.
Module /nix/store/ihnkqhgq5qqgdjldq0mqg15gx134lzyb-libXext-1.3.5/lib/libXext.so.6.4.0 without build-id.
Module /nix/store/m81vwjvzw0js60ca2g1j02z30pfr68fw-libX11-1.8.7/lib/libX11.so.6.4.0 without build-id.
Module /nix/store/1bapla8zwlx128i42wi08zbiibwk6gm3-libglvnd-1.7.0/lib/libGLX.so.0.0.0 without build-id.
Module /nix/store/1bapla8zwlx128i42wi08zbiibwk6gm3-libglvnd-1.7.0/lib/libGL.so.1.7.0 without build-id.
Module libgamemodeauto.so.0 without build-id.
Stack trace of thread :
#0  0x0000000000841f0f n/a (n/a + 0x0)
ELF object binary architecture: AMD x86-64

OS: NixOS 23.11
Kernel: 6.6.23
DE: KDE Plasma 5.27.10
GPU: AMD Radeon RX 6600

from mangohud.

ecabott avatar ecabott commented on June 14, 2024

Can you please verify that it is 0.7.1 with the version option in mangohud

mangohud --version outputs v0.7.1

from mangohud.

flightlessmango avatar flightlessmango commented on June 14, 2024

Can't reproduce this on 0.7.1 or latest.
Do you have more information like using a different vulkan driver than radv or using flatpak?

from mangohud.

ecabott avatar ecabott commented on June 14, 2024

Can't reproduce this on 0.7.1 or latest. Do you have more information like using a different vulkan driver than radv or using flatpak?

Its just default Fedora 39.

from mangohud.

alioguzhan avatar alioguzhan commented on June 14, 2024

Same here. Default NixOS 23.11 with Mesa 23.1.9.

If that helps you, I found this patch:

diff --git a/bin/mangohud.in b/bin/mangohud.in
index 53c72ef..3cc4f19 100755
--- a/bin/mangohud.in
+++ b/bin/mangohud.in
@@ -13,13 +13,13 @@ fi
 DISABLE_LD_PRELOAD="cs2.sh
 some_other_exe"

-MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_opengl.so"
+MANGOHUD_LIB_NAME="libMangoHud_opengl.so"

 if [ "$1" = "--dlsym" ]; then
-    MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
+    MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
     shift  # shift will only be executed if $1 is "--dlsym"
 elif [ "$MANGOHUD_DLSYM" = "1" ]; then
-    MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
+    MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
 fi

 if [ "$1" = "--version" ]; then
@@ -40,8 +40,10 @@ for exe in $DISABLE_LD_PRELOAD; do
     fi
 done

+XDG_DATA_DIRS="@dataDir@${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
+
 if [ "$disable_preload" = true ]; then
-    exec env MANGOHUD=1 "$@"
+    exec env MANGOHUD=1 XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
 else
     # Make sure we don't append mangohud lib multiple times
     # otherwise, this could cause issues with the steam runtime
@@ -54,5 +56,7 @@ else
             LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
     esac

-    exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"
+    LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+
+    exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
 fi

This patch fixes the error on my side for MangoHUD 0.7.0

from mangohud.

gort818 avatar gort818 commented on June 14, 2024

Same here. Default NixOS 23.11 with Mesa 23.1.9.

If that helps you, I found this patch:

diff --git a/bin/mangohud.in b/bin/mangohud.in
index 53c72ef..3cc4f19 100755
--- a/bin/mangohud.in
+++ b/bin/mangohud.in
@@ -13,13 +13,13 @@ fi
 DISABLE_LD_PRELOAD="cs2.sh
 some_other_exe"

-MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_opengl.so"
+MANGOHUD_LIB_NAME="libMangoHud_opengl.so"

 if [ "$1" = "--dlsym" ]; then
-    MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
+    MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
     shift  # shift will only be executed if $1 is "--dlsym"
 elif [ "$MANGOHUD_DLSYM" = "1" ]; then
-    MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
+    MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
 fi

 if [ "$1" = "--version" ]; then
@@ -40,8 +40,10 @@ for exe in $DISABLE_LD_PRELOAD; do
     fi
 done

+XDG_DATA_DIRS="@dataDir@${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
+
 if [ "$disable_preload" = true ]; then
-    exec env MANGOHUD=1 "$@"
+    exec env MANGOHUD=1 XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
 else
     # Make sure we don't append mangohud lib multiple times
     # otherwise, this could cause issues with the steam runtime
@@ -54,5 +56,7 @@ else
             LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
     esac

-    exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"
+    LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+
+    exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
 fi

This patch fixes the error on my side for MangoHUD 0.7.0

Hmm on the latest build we shouldn't be using preload at all with CS2.

from mangohud.

alioguzhan avatar alioguzhan commented on June 14, 2024

Nice. In addition to that, I forgot to add another patch file. Not sure if this is related to this problem though:

diff --git a/src/dbus.cpp b/src/dbus.cpp
index 7379af1..4eef3fe 100644
--- a/src/dbus.cpp
+++ b/src/dbus.cpp
@@ -152,7 +152,7 @@ bool dbus_manager::get_media_player_metadata(metadata& meta, std::string name) {
 }

 bool dbus_manager::init_internal() {
-    if (!m_dbus_ldr.IsLoaded() && !m_dbus_ldr.Load("libdbus-1.so.3")) {
+    if (!m_dbus_ldr.IsLoaded() && !m_dbus_ldr.Load("@libdbus@/lib/libdbus-1.so.3")) {
         SPDLOG_ERROR("Could not load libdbus-1.so.3");
         return false;
     }
diff --git a/src/logging.cpp b/src/logging.cpp
index 046c847..42782be 100644
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -26,7 +26,11 @@ string exec(string command) {
 #endif
     std::array<char, 128> buffer;
     std::string result;
+
+    char* originalPath = getenv("PATH");
+    setenv("PATH", "@path@", 1);
     std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(command.c_str(), "r"), pclose);
+    setenv("PATH", originalPath, 1);
     if (!pipe) {
       return "popen failed!";
     }
diff --git a/src/pci_ids.cpp b/src/pci_ids.cpp
index 002a843..5a6262b 100644
--- a/src/pci_ids.cpp
+++ b/src/pci_ids.cpp
@@ -24,11 +24,9 @@ static std::istream& get_uncommented_line(std::istream& is, std::string &line)
 void parse_pciids()
 {
     std::ifstream file;
-    file.open("/usr/share/hwdata/pci.ids");
+    file.open("@hwdata@/share/hwdata/pci.ids");
     if (file.fail()){
-        file.open("/usr/share/misc/pci.ids");
-        if (file.fail())
-            SPDLOG_ERROR("can't find file pci.ids");
+        SPDLOG_ERROR("can't find file pci.ids");
     }

     std::string line;

I just found this approach from another repository and this was the only one that makes MangoHUD works for me.

from mangohud.

flightlessmango avatar flightlessmango commented on June 14, 2024

I don't think it's useful to muddle this by patching an old version of mangohud

from mangohud.

Related Issues (20)

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.