Oblivion
Oblivion on Vulkan with HUD enabled

Image information

Added on

Uploaded by

Wiepman

About this image

This is an example of Oblivion running on Vulkan through the "d3d9.dll" from the D9VK by Joshua Ashton.

Since version 0.4, it brings to the table:
"...32-bit applications to be able to utilize more than 4GB of video RAM,
which should help Skyrim, Oblivion, and other games."

Running through Vulkan may drastically improve enhanced performance and stability for both Linux (through wine)
and should also work for Windows users. If it's counterpart for MacOS (MoltenVK) get's up to par also Mac users should be able to profit.

Since I enabled Vulkan all out-of-memory crashes when for instance fast traveling
or racing trough the landscape on your horse seem to have disappeared.

--> (according to @1Mac this is called (malloc = “memory allocation,” i.e. running out of memory.)

Visible top left on this screenshot is the DXVK_HUD=full,
because I wanted to demonstrate the two Heaps Vulkan enables:

Heap 0 is your full GPU memory it can utilize
and 
Heap1 is your available system memory. 

Using Vulkan seems to make the Heap replacement-part of OSR (Oblivion Stutter Removed) redundant
on a GPU with plenty of video memory. (in my example it uses the full 4096 Mb of my GPU,

which is of course leaps and bounds beyond the Heapsizes of 768 Mb or 1024 Mb one can typically achieve with OSR. 
(but you would still want the "Fast Exit"-part of OSR and perhaps the fps-manager)

The D9VK-archive contains one X64 and one X32 folder.

Be sure to use the "d3d9.dll"  --> from the 32-bit (X32) folder, 
--> even on 64-bit Windows!  (because Oblivion is a 32-bit game) 

If you place "d3d9.dll" from D9VK in Oblivion's root folder 
the following files are created after first game launch with the Vulkan "d3d9.dll" 

"Oblivion_d3d9.log"
"Oblivion.dxvk-cache"

If such is the case it is working correctly.

The DXVK_HUD environment variable controls a HUD which can display the framerate and some stat counters.
You can disable it with: DXVK_HUD=0

It accepts a comma-separated list of the following options:

devinfo: Displays the name of the GPU and the driver version.
fps: Shows the current frame rate.
frametimes: Shows a frame time graph.
submissions: Shows the number of command buffers submitted per frame.
drawcalls: Shows the number of draw calls and render passes per frame.
pipelines: Shows the total number of graphics and compute pipelines.
memory: Shows the amount of device memory allocated and used.
gpuload: Shows estimated GPU load. May be inaccurate.
version: Shows DXVK version.
api: Shows the D3D feature level used by the application. Does not work correctly for D3D10 at the moment.
compiler: Shows shader compiler activity
Additionally, DXVK_HUD=1 has the same effect as DXVK_HUD=devinfo,fps, and DXVK_HUD=full enables all available HUD elements.

Source:
https://github.com/Joshua-Ashton/d9vk

19 comments

  1. MinishMan
    MinishMan
    • supporter
    • 0 kudos
    Huge thanks for this mini guide.

    I got a dramatic stability improvement even though I'm on a 5800H and RTX 3070. My framerate is now super consistent and I can add AI upscaled texture packs and never run out of VRAM.

    I only wanted two extra things; clamping the fps to 60 and displaying an fps counter.

    I achieved this by creating a file dxvk.conf in the Oblivion root directory with the following lines:
    d3d9.maxFrameRate = 60
    dxvk.hud = fps

    This is detailed here:
    https://github.com/doitsujin/dxvk/wiki/Configuration
    https://github.com/doitsujin/dxvk/blob/master/dxvk.conf
  2. NLynch77
    NLynch77
    • member
    • 27 kudos
    I get dramatically better performance with Windows 7, about 5 extra FPS and absolutely slashed microstutter
  3. BoredErica
    BoredErica
    • premium
    • 69 kudos
    Tried it and got ~4.7% FPS increase in my test saves. I tried to make sure it's not just placebo or something in the background and I tried to load the saves over and over and consistently got a small increase in FPS. My word isn't gospel though, best try it for yourself to see if it helps at all or if I did something wrong. (Using Win10.)
  4. GBRPluss
    GBRPluss
    • premium
    • 145 kudos
    Tested... Useless thing for me (-30fps)

    OSR with custom heap works much better.
    1. Wiepman
      Wiepman
      • member
      • 44 kudos
      @GBRPluss:
      Thank you very much for testing!
      I was kinda hoping such a knowledgeable user/developer would look into it.
      (I had thought of pitching this to @Alenet, but you sure also fit the job as well!)

      Can I assume that was on Windows?
      Because I was very curious how d9vk would fare for Windows-users.

      As a Linux-user I can very much vouch for d9vk over default wine.

      On Linux wine of course always translates dx9-api calls to OpenGL.

      Now with d9vk it now translates into Vulkan.
      And the difference in performance and (very much) stability is noticeable!

      By the way:
      Since my original posting d9vk has been merged back into dxvk
      and since then had even more dx9-related updates with dxvk 1.5.1 released this week:

      Verbose D3D9 changelog (according to author Joshua Ashton):

      - Improved performance of games that use stateblocks dramatically
      - Improved performance of games using DF24 and D24X8 on NVIDIA
      - Improved performance by enabling bounds testing for D3DPOOL_SYSTEMMEM buffers
      - Improved depth bias implementation
      - Fixes shadows/decals/misc. clipping in a lot of titles
      - Fixed a bug where some games would crash with a divide by zero error on launch on some systems
      - Fixed Trackmania Forever crashing on startup (incorrect error code for invalid backbuffer on device creation)
      - Fixed inventory in Risen 2 not rendering (still set implicit viewports if rebinding the same RT)
      - Fixed a potential race condition in memory tracking
      - Fixed incorrect specular rendering in many PS 1.x games
      - Normalized eye/normal, and negated the reflection vector
      - Fixed shield and glass in Halo and Halo CE
      - Halo CE has shaders that make no sense and try to read and write to the same thing at the same time...
      - Co-issued CNDs always come first, unless their parent is a CND
      - Worked around the game binding cube textures to volume samplers in the shader and expecting that to work.
      - Fixed a crash when changing to/from fullscreen in The Sims 4
      - Removed error conditions from SetDialogBoxMode
      - Fixed the wrong display mode being returned for current display mode
      - Fixes fullscreen being a tiny box when resolution is < native in Vampire The Masquerade: Bloodlines
      - Fixed mip size not being respected for implicit viewport bounds and Clear fastpath
      - Fixes blur effect in NFS: Carbon and possibly other titles.
      - Improved depth bias implementation
      - Fixes shadows/decals/misc. clipping in a lot of titles

      Source:
      https://www.reddit.com/r/linux_gaming/comments/emf40x/dxvk_151_released/
    2. GBRPluss
      GBRPluss
      • premium
      • 145 kudos
      I will look to new version & writeback.
    3. GBRPluss
      GBRPluss
      • premium
      • 145 kudos
      Still FPS drain...
    4. Wiepman
      Wiepman
      • member
      • 44 kudos
      @GBRPluss:
      That is most unfortunate.

      Here Oblivion flies with Vulkan (compared to wine/OpenGL) on Linux.

      I am sorry to hear that is apparently not the case on (your particular?) Windows-setup.

      Quite puzzling, since the programmer (Joshua Ashton) has stated:
      "DXVK's D3D9 layer is (sometimes significantly) faster than native [meaning Windows] in pretty much every instance."

      (it was in a reddit thread about d9vk performance on Windows here:)
      "D9VK/DXVK's dll performance on native Windows"
      https://www.reddit.com/r/linux_gaming/comments/ebu7b9/d9vkdxvks_dll_performance_on_native_windows/)

      And he also does his programming on Windows, not on Linux
      (to keep out other possible Linux negative performance influences out of his workflow)

      And googling for "d9vk/dxvk + Windows" you can see many examples of Windows-users adopting it for several older Directx9-games (example: the Sims 2/3),
      Other example: Hat in Time:
      https://steamcommunity.com/sharedfiles/filedetails/?id=1765030676
      Also other examples to find on YouTube.

      PS:
      a few changes you could try in "dxvk.conf"
      (there are many more settings, each setting has it's own description above them)

      "dxgi.numBackBuffers = 3" <- (triple buffering, helped others who also copied "dxgi.dll")

      "d3d9.samplerAnisotropy = 8" <-(overrides Anisotropic Filtering in Oblivion Reloaded)

      First I had problems setting higher then default "4" with Vulkan on in:
      "OblivionReloaded.ini -> [Main] -> AnisotropicFilter=4",
      but this setting completely solved it.
      ("16" also works, but I never see difference between "8" and "16" in most games).

      d3d9.shaderModel = 3 <- (seemed to have "forced SM3?
      Possibly Vulkan can use forced SM3 because it replaces directx9?)).

      # d3d9.customDeviceId = 0000 <- changing these two seem to help to make engine recognize GPU better?
      # d3d9.customVendorId = 0000 <-
    5. FiftyTifty
      FiftyTifty
      • premium
      • 158 kudos
      @GBRPluss Are you using an NVidia GPU? Their driver support for the explicit APIs (DX12, Vulkan) is sketch at the best of times. I get around 20% higher minimum framerates using DXVK on my Vega 56.

      Edit: Damn, didn't see that this was back from 2020.
  5. wellden
    wellden
    • premium
    • 185 kudos
    Got mine working well @Wiepman...but like GBR fps went down too. Must be a linux thing!! I could see where it was reading all heap and such in the log but no go on the framerate for now. Will check later builds. Thanks again for all your detailed info!
  6. Wiepman
    Wiepman
    • member
    • 44 kudos
    PS:
    @Kartoffels made a video on how to install in Windows too:
    https://www.youtube.com/watch?v=_bkGgT3qJhQ
  7. TriniXjin
    TriniXjin
    • member
    • 15 kudos
    Amazing would this essentially allow us to use detrimental mods such as Really AEVWD? That mod always causes lag and crashes sooner due to more models being rendered. I have a 970ftw, 10gb ram and an i7 4790k
    1. Wiepman
      Wiepman
      • member
      • 44 kudos
      @TriniXjin:
      I currently have a Ryzen 2700x, 32Gb RAM and a 970 GTX myself.

      With Oblivion-modding one of the main problems is that it's an old 32-bit directx9-era Windows game not optimized at all for modern systems. Thus it doesn't give a damn about and doesn't utilize modern multi-core system specs.

      This "d3d9.dll" improves both memory usage (since it can now utilize your full GPU memory) and better CPU usage.

      Your mileage may very. but since Oblivion is just a single-core game, both Linux and Windows user *should* benefit from this.

      Currently I have "bReplaceHeap" in OSR disabled and it runs great.

      I do use Really AEVWD with no problems,
      BUT I always have the following parts DISABLED:

      01 City Plugins,
      02 City Architecture,
      03 Imperial City Architecture,
      10 Higher Detail Castles
      and 11 Higher Detail IC Bridges disabled.

      Remember: with this Vulkan-enabled "d3d9.dll" you *should* have better performance,
      BUT it is not the be all end all magical solution!

      Don't forget Oblivion's engine was never made with so many distant viewable objects (aka VWD) in mind and what Arthmoor accomplished with his Really AEVWD is nothing less that incredible.
  8. CmdCuddles
    CmdCuddles
    • supporter
    • 1 kudos
    Would this also make the 4gb ram patcher redundant or is that still needed?
    1. Wiepman
      Wiepman
      • member
      • 44 kudos
      @CmdCuddles:
      These are two different things.
      This "d3d9.dll" enables Vulkan, which is a modern API giving low-level access to the GPU and CPU, thus improving performance in games.

      As far as I know the 4Gb memory patcher is always needed,
      Since that is what makes the executable aware of more memory.

      Though you seem to benefit much with with 64-bit OS's,
      (then again who uses a 32-bit OS in 2019?)

      If you buy the GOG-version it is already LAA.
      Steam or CD-rom version use the LAA-patch, it's a dead-simple procedure.

      For details on LAA, see:
      https://wiki.nexusmods.com/index.php/4GB_memory_patcher
      and
      http://wiki.theassimilationlab.com/tescosi/Large_Address_Aware_Patch


  9. chchch3
    chchch3
    • member
    • 0 kudos
    Nice, but how's the FPS and image quality compared to your windows install? I hear sometimes linux runs things faster.
    1. Wiepman
      Wiepman
      • member
      • 44 kudos
      I believe my fps is clearly visible in the HUD. It's 45 fps (and I've capped to 45 fps in OSR).

      I would assume my performance is on par with Windows since I'm running a fairly heavily modded install (with Arthmoor's Really AEVWD and such), but anyways I haven't seriously touched Windows since my Windows XP crashed back in 2006 and I took the plunge and switched to Linux and never looked back.

      But in all fairness, I don't believe that was my point of this article was it?

      I took the time to share this info, since I thought it to be very relevant news that it is now possible for BOTH Windows and Linux users to run a 32-bit directx9 game on bare metal (with Vulkan), offering much more available memory bandwidth and significant performance yield.

      But I might as well best quote the programmer himself on this matter:
      "DXVK's D3D9 layer is (sometimes significantly) faster than native in pretty much every instance." -JoshuaAshton

      https://www.reddit.com/r/linux_gaming/comments/ebu7b9/d9vkdxvks_dll_performance_on_native_windows/

    2. chchch3
      chchch3
      • member
      • 0 kudos
      This is extremely good news. I knew that playing TES4 was possible with the gallium9 state tracker but only for AMD cards but the state of DXVK D3D9 is not mentioned much on sites like phoronix.

      Anyway, thanks for bringing this to our attention. Win7 support is about to end and I wasn't going to switch to the spyware known as windows 10.

      Could you answer some more questions if you don't mind. Does running TES4 with wine support auxillary programs such as OBSE, Oblivion Reloaded, Stutter Remover, and ENB?
    3. Wiepman
      Wiepman
      • member
      • 44 kudos
      @chchch3:

      Haha,
      hell no, TESIV has been perfectly playable on Linux since the pre 1.x versions of wine, which has had give or take a bi-weekly update iterations ever since (currently wine is nearing version 5).

      Only thing is those earlier versions of wine had certainly some serious tweaking to do getting Oblivion running decently.

      Nowadays it is a pretty much smooth sailing clicking "install" as with Windows.

      For reference on the current state of affairs have a look here:

      https://appdb.winehq.org/objectManager.php?sClass=version&iId=35784&iTestingId=105748

      And yes, I pretty much run the whole Bevilx's mod-list with all the bells and whistles (and then some) and keeping on par as an active and quite vocal participator since about two years (I think?) all runs perfectly fine on Linux.

      Currently I ditched ENB for solely Oblivion Reloaded, but that is a matter of personal preference, not because of limitations with Linux.

      Heck, have a look at @1Macs excellent guide for Oblivion on MacOS
      (pretty much the golden go-to standard on that matter IMO) managing to even run ENB with OR and SweetFX combined!

      And he for sure had to go trough A LOT more hoops circumventing Apple's tight restrictions than your friendly neighborhood Linux-user ever had to deal with.:

      https://www.nexusmods.com/oblivion/articles/44376

      If only I had his command of eloquent English I would be glad to make a equivalent how-to guide for Linux for those interested, but that would be overreaching my capacities (since I am not a Native English speaker).

      But let me be clear: I have certainly no intention whatsoever to play the zealot Linux advocate on here.

      (although I tend to agree with the point you make on the spyware gift that seemingly keeps on giving in the particular case of Windows 10, LOL).

      But to each his own, let's not go into all the OS-war politics.
      This site is all about the joy of modding, right?

      And again D9VK is perfectly usable for Windows users too (it's just a matter of copying the "d3d9.dll" to Oblivion's root folder and basically Bob's your uncle.

      I don't understand your remark on Phoronix though, because he reports almost all the time about DXVK/DXVK, as he should since that would be pretty much the future of Linux gaming:

      See:
      https://phoronix.com/scan.php?page=news_item&px=D9VK-0.40-Released

      And for instance:
      https://www.phoronix.com/scan.php?page=news_item&px=D9VK-Merges-Into-DXVK

      Ps:
      The Gallium9-business was/is a very specific use-case (and only for AMD cards at that) beginners should not even need to meddle with IMO.