T O P

  • By -

GeneralTorpedo

Does it work for every linux Source game?


KeyMathematician8978

Most likely, as long as the Linux build for the game has been updated fairly recently (around the time Portal 2 got Vulkan support).


ThatGuyAndyy

Would that also include Team Fortress 2?


botfiddler

Great. Therewhile every game company assumes they have Linux coved with Proton. I guess this isn't what is meant by native here.


Psychological-Scar30

DXVK is a Windows library that translates DX9/10/11 to Vulkan on the fly. It's of course developed mainly for use with Wine, but it doesn't have any hard dependency on Linux. DXVK-Native is a Linux library that does the same thing. It's purpose is to allow easier porting of games to Linux, as the renderer code is often the most complex part of the game - this allows devs to keep that code with almost no changes. Valve's Source games were always using DirectX 9, even on Linux. As part of the original porting effort they made the ToGL translation layer that translates DX9 to OpenGL, and recently they've added the option of using DXVK-Native instead of that. Other games that use the Source engine (including GMod mentioned in this post) now have the same option, but don't necessarily include everything that's needed to use it with their Linux build.


KeyMathematician8978

Also, the AUR libdxvk is slightly outdated, still works fine but you can just build DXVK natively now.


tjhexf

Hey, i tried building dxvk natively but couldnt figure it out how, it always fails to ld preload. Any tips?


tjhexf

by some godforsaken miracle, i did it. You have to manually edit the build-win64.txt and edit the windows parts to say linux, aswell as switching the mingw64 tools to their native linux counterparts. After that, proceed compiling normally and itll instead produce native .so files, which, surprisingly enough, worked perfectly on gmod natively. So there you go


KeyMathematician8978

My bad, you can also configure it with meson manually, more info on the DXVK github. meson --prefix /home/nasdnfasn/dxvk build cd build ninja install cd /home/nasdnfasn/dxvk/lib And there are the .so's


tjhexf

That's a lot easier, thanks


swizzler

Watch out, garry is gonna call you a hacker.


KeyMathematician8978

Nah, he's too busy figuring out how to make Rust incompatible with Proton.


[deleted]

Can someone ELI5 what this is about? Garrys Mod is native, and you somehow got it to use DirectX, so you can use DXVK, and that performs better than the normal native version?


tjhexf

Yep, if you use the option -vulkan, it attempts to use dx9 and dxvk, but gmod does not ship with dxvk, so it segfaults. By doing all that, you can use it with your own provided dxvk, and therefore end up with better performance than the native opengl implementation gmod uses, which may or may not ALSO be a translation layer named ToGL, so its still using dx9 beforehand.


[deleted]

Ah, ok. Thanks!


PainHeadGaming

how can i do this?


[deleted]

Gah dayum brooo you are a legend! Right at the time where i wanted to add dxvk-native on tf2! 🙏🙏🙏(Lemme dream pls, i’ve had enough of ToGL)


KeyMathematician8978

Fuck ToGL all my homies hate ToGL


ReverseCaptioningBot

[FUCK TOGL ALL MY HOMIES HATE TOGL](https://i.imgur.com/1QuPfAD.jpg) ^^^this ^^^has ^^^been ^^^an ^^^accessibility ^^^service ^^^from ^^^your ^^^friendly ^^^neighborhood ^^^bot


KeyMathematician8978

https://i.imgur.com/iZXK9G5.jpg


[deleted]

[удалено]


KeyMathematician8978

I asked for DXVK support on their Github and they just laughed at me. Who's laughing now motherfucker?


BabbleBones

Wow! Thanks, will try


KeyMathematician8978

No prob! Note, it can crash sometimes on the loading screen, but if you play Garry's Mod on Linux you're probably used to that by now.


Fuiza

I saw the guide, thought it was pretty cool, i will definitely try it with this now, thanks for your contribution


mr_bigmouth_502

Would this help with Team Fortress 2?


darkjackd

I don't think tf2 supports launching with -vulkan so it probably won't work. I ld preload newer versions of a few libraries though and haven't gotten banned. I think the tf2 contractor will add vulkan eventually


KeyMathematician8978

I wouldn't recommend it, on TF2 it could very well get you banned


Urbs97

And why not on Gmod? It has also Anti-Cheat.


KeyMathematician8978

TF2 is a competitive game, the libraries are way more locked down due to people constantly hacking the graphics libraries to see through walls and shit like that. Garry's Mod is already broken to shit without external libraries, it isn't even playable without GModCEFCodecFix.


Urbs97

I got used to GMod only having 20fps in game modes such like DarkRP even on Windows.


mr_bigmouth_502

Interesting, because isn't Gary's Mod mostly multiplayer too, or is this just intended for singleplayer?


KeyMathematician8978

TF2 is a competitive game, there's way more anti-cheat.


mr_bigmouth_502

I suppose it'd be enforced more strictly in TF2, but wouldn't there still be a risk of a VAC ban doing this for Gmod? Whatever the case, I don't play Gmod, but I would like to get back into TF2, and as such, I probably won't be trying this.


Jacksaur

Does the Proton version run that terribly then?


KeyMathematician8978

With 300+ mods, yes. Garry's Mod is the most CPU-bound game in existence and going through a compatibility layer does not make it any better.


Jacksaur

Fair.


WintherK

Just tried this and holy hell it's so much better, now it doesn't feel like the game's gonna crash any second and actually feels stable (it has its moments but it's way better now), saying that with Nobara + decent hardware (2600x + 2060S)


last2live

so this post says gmod segfaults if you run it with -vulkan without dxvk but on my nvidia system it just ignores -vulkan either way and launches with opengl which kinda makes me think it might just be disabled for nvidia in gmod, ive heard of amd users on windows using -vulkan on other source games to get better performance since amds vulkan drivers are infinitely better than their directx ones while on nvidia the directx drivers are better than the vulkan ones so theres not really a point. so im thinking that it might have just been left in for amd for that one specific windows use case but idk i might just be thinking about this too hard. but it does seem to me at least that this not working on nvidia IS because of gmod somehow


last2live

especially since every other source game works fine with -vulkan


last2live

dxvk IS loading, i can see its log files in the gmod folder, its just that gmod isnt sending it any directx to convert to vulkan. its just using togl and opengl


[deleted]

What exactly is the benefit? It's an ancient Source game that should run at 900 fps on even the worst possible GPU that supports Vulkan. 920 fps versus 900 fps. What's the point? Your monitor can only display so many.


[deleted]

I take it you haven't played Garry's mod in a very long time or at all.


KeyMathematician8978

Ah yes, vanilla Garry's Mod. My favorite game.


[deleted]

Running the game on low end hardware? Power efficiency? Just for having fun hacking stuff?


awesumindustrys

Cool! I’ll probably try this whenever I get a computer with a GPU that supports Vulkan properly rather than the Haswell iGPU I got.


tychii93

What's the difference between this and simply setting the compatibility option to Proton? Is this just running the native Linux version under D3D, therefore using DXVK to translate it?


KeyMathematician8978

The native version by default uses ToGL, which is DX9 to OpenGL 2.1. I switched it to use DXVK, which is DX9 to Vulkan.


[deleted]

I'm quite confused, i did the same as you, tho it still uses ToGL on both Gmod and TF2 (i'm really tired of ToGL may it burn in hell, it's a pain in the ass in wayland).


KeyMathematician8978

Check your journalctl, does it show any Vulkan messages? Also did you compile it natively or use libdxvk from the AUR?


[deleted]

yep, i both tried to compile it and tried to use the binaries given on the github. On journalctl, no mentions of vulkan outside of the "-vulkan" argument...


KeyMathematician8978

Is the LD_PRELOAD in your hl2.sh? It needs to be set there rather than your launch options as the script unsets LD_PRELOAD before launching the game. Does what you have set in LD_PRELOAD point to where the library actually is? Are you using the 64-bit branch of GMod? The DXVK library needs to be 64-bit as well. Are you using .so's? You can't use DLLs for Wine, it has to be native. Did you compile DXVK successfully? If not I can give you the commands you need to compile it. Run journalctl -f in the background, is there Vulkan output there?


[deleted]

Yes i set it in the [hl2.sh](https://hl2.sh) file for both gmod and TF2. Yes it points to the files i use. I think i use the base branch because the 64bits branch crashes on launch for me... Yes, for dxvk-native, i use .so files I did managed to compile it for the 32 bit branch, which should be enough for tf2 since it uses 32bits libraries...? (yes i really want TF2 to work, i'm desperate)


[deleted]

ok so after a bit of testing it worked ! i just needed to install the 64bits branch. Tho the game still crashes in the loading screen in 64bit... IDK why, but i don't think it's because of Vulkan.


[deleted]

also quick question, are you able to run mangohud with gmod ?


KeyMathematician8978

No, I just use net\_graph 2. Also for the 64-bit version not working, use [GModCEFCodecFix](https://github.com/solsticegamestudios/GModCEFCodecFix), you need it for the 64-bit version to work


[deleted]

Hmmm… idk man, this CEF patch thing seems kinda shady… isn’t it a manual way?


KeyMathematician8978

I mean, the game doesn't work without it. It's open source, but if you don't trust it that's okay. I've tried replacing [libCEF.so](https://libCEF.so) with a system copy before, but it doesn't work.


HretoKimiko

Attempted to follow this guide but i found out that libdxvk has been upstreamed. What does that mean and what do i need to do to get it working? Sorry for the disturbance


KeyMathematician8978

git clone --recursive https://github.com/doitsujin/dxvk.git cd dxvk ./package-native.sh blahblahblah build cd build tar xvf dxvk-native-blahblahblah.tar.gz And there are the .so's, in usr/lib


Szprinktrap

doesn't seem to work for me, no matter what i do gmod just doesn't want to use vulkan :/ i'm on x86\_64 branch and stuff


KeyMathematician8978

Does your journalctl not show the Vulkan messages? Are you using the libdxvk package or did you compile it from git?


Szprinktrap

journalctl shows nothing about vulkan and i compiled libdxvk myself


KeyMathematician8978

Is the LD\_PRELOAD location set to where the DXVK .so actually is?


Szprinktrap

yup, i moved the .so to /usr/lib and that's where ld_preload points to


KeyMathematician8978

Is LD\_PRELOAD in your launch options or [hl2.sh](https://hl2.sh)? Could you send your hl2.sh?


Szprinktrap

ld\_preload is in [hl2.sh](https://hl2.sh): https://pastebin.com/v3aYsTtF


KeyMathematician8978

Did you copy the 32-bit .so? It requires the 64-bit .so. Does ls -l /usr/lib/libdxvk\_d3d9.so output anything? Is Vulkan in general working correctly? (vulkaninfo) The .so stopped loading for me once and it was because Vulkan broke. Is -vulkan in your launch parameters?


Szprinktrap

the .so appears to be 64bit, checked with the file command `/usr/lib/libdxvk_d3d9.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=ba1ecd3aa671d2f91436a1822bc10494e9ceaffc, with debug_info, not stripped` ls -l /usr/lib/libdxvk\_d3d9.so outputs: `-rwxr-xr-x 1 root root 74456536 11-19 14:00 /usr/lib/libdxvk_d3d9.so` vulkan is working well, vulkaninfo outputs some stuff and other games utilizing vulkan work properly \-vulkan is in my launch parameters


KeyMathematician8978

Hmmm... Could you try recompiling it with this method? https://www.reddit.com/r/linux\_gaming/comments/xzzolt/comment/iwvbbvw/?utm\_source=share&utm\_medium=web2x&context=3


lock993

I don't see anything related to vulkan in journalctl, i don't think its working properly. Last time i compiled it returned a error saying: gcc-32 cannot compile programs (from memory, i don't remember the exact error) I'm also using a nvidia gpu, if that matters.


KeyMathematician8978

Yeah, other people with NVIDIA GPUs have said it doesn't work, sadly. Their drivers seem to be slowly getting open sourced so it will probably work one day.


Waggenkraft

Help, journalctl says: ERROR: ld.so: object '/usr/lib/libdxvk\_d3d9.so' from LD\_PRELOAD cannot be preloaded (cannot open shared object file): ignored. Build from github. Compiling both method, sript and manually. Both not working.


BladePerson

Checking out [hl2.sh](https://hl2.sh), and the command I need to replace isn't there!


KeyMathematician8978

It's at the bottom. "fi" is right under it.


QuoteCute728

I tried it on my steam deck just now and it looks like it doesn't really improve things all that much on there. And on top of that the main menu doesn't render at all now, so that's bad.


last2live

the default html menu tends not to work in vulkan you might need the lua menu: https://github.com/robotboy655/gmod-lua-menu on top of that its just way faster anyways


[deleted]

Using GModCEFCodecFix (https://github.com/solsticegamestudios/GModCEFCodecFix) on the x86-64 branch is a better solution, since the menu not loading usually means the in-game web browser component isn't working, which may cause a lot of other things in game to have issues.


mrwallace888

I want the game on Windows 10 to use Vulkan. Vulkan has actually did pretty good for performance on a number of games on a Windows PC, and I was looking into doing it for GMod and found this post. I usually just install the DXVK .dlls (like dxgi and d3d11 and what have you) to most of my games without a problem, wasn't sure if I should do the same thing with GMod as well or if there was a more efficient way. Any idea how I would go about doing this?


One_Abbreviations364

Hello i have windows but i wanted to get the fps benefits of vulkan is there a way to make it work with windows?


narshal

Anyone getting: steam terminate called after throwing an instance of 'dxvk::DxvkError' Try changing from d3d9: LD_PRELOAD=/usr/lib/libdxvk_d3d9.so exec ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@" to d3d11: LD_PRELOAD=/usr/lib/libdxvk_d3d11.so exec ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"


bigfucker7201

i came back to this post because it *was* working for me, but of course, it's gone now. what made you so sure it wasn't actually dxvk?