Monday, July 13, 2020

How to fix choppiness and stutters in GTA IV

TL;DR - to fix GTA IV stutters if your GPU supports Vulkan try DXVK method, if it doesn't support Vulkan then go to 4-step DxWrapper method (should help in all other cases). Do not combine methods below, use only one of them! If you are still not satisfied with gameplay then you may have to read the rest of the article and/or downgrade to version 1.0.4.0


Contents

The problem.. 1

The solution. 2

DxWrapper method (should help in most cases). 2

dgVoodoo method. 2

WineD3D method. 3

DXVK method. 3

Summary table. 3

Appendix. 4

Why default D3D9 output is slow.. 4

Total VRAM in GTA IV.. 4

-managed GTA IV commandline.txt parameter. 4

GTA IV VRAM management with different methods. 4

Default D3D9 with dxwrapper. 4

Wined3d. 5

dgVoodoo. 5

DXVK. 5

Reference links. 6

 

The problem

If your game starts OK but stutters like crazy when you’re driving in Algonquin near the park or flying in a helicopter near a bridge, read on.

I tried everything apart from 1.0.4.0 downgrade that was claimed to fix the problem:

·         draw distance tweak (far clip)

·         shadow fix (older version shaders for deferred_lighting)

·         increase memory limit in pc\stream.ini

·         different commandline.txt params that remove limits like -nomemrestrict -norestrictions -percentvidmem 100 -availablevidmem {N} -reservedApp 0 -managed

·         disable hyperthreading in BIOS setup (Xeon E5-2689 8c/16t CPU)

·         set high priority for game exe

The methods above helped FPS a little but did not fully address the stutter issue – it still kicked in after driving around a little.

The solution

During my research I found that many people reported enabling steam overlay helped them and – surprise! - DXVK works magic on GTA IV e.g. even translating Direct3D calls to Vulkan is faster and has consistent fps+frametime. So I came to the conclusion that the game itself is not the culprit here and choppiness/stutter is clearly a renderer issue as this crappy legacy D3D/DDraw renderer problem is very common with older games and it’s usually solved by:

1.       Fixing native Windows D3D9 renderer with DDrawCompat – game looks as intended, gameplay is pretty smooth

2.       Avoiding slow native renderer altogether and translating output to superior DX11, OpenGL or Vulkan renderers – game looks nearly as intended, gameplay is silky smooth, 3-5 fps may be lost in translation 8) but DXVK method may even yield fps!

I tried different methods from two groups above with GTA IV and they were the only reliable ones that helped to achieve smooth gameplay and consistent frametime in Algonquin.

DxWrapper method (should help in most cases)

ATTENTION: if you have fairly recent GPU that supports Vulkan you may probably get smoother experience by using DXVK method below! Remove DxWrapper if you later decide to go with DXVK.

·         Install Ultimate ASI Loader (already installed in FitGirl repack, file dsound.dll). You must download 32-bit version Ultimate-ASI-Loader.zip, it contains dinput8.dll, unpack it to GTA IV folder and (optionally) rename it as dsound.dll

·         Download dxwrapper (the guide was tested on v1.0.6334.21 which loads DDrawCompat v0.2.1 by default. Later versions not tested), unpack dxwrapper.asi/.ini into GTA IV folder or plugins subfolder

·         Edit dxwrapper.ini
  [Compatibility]
  DDrawCompat                = 1

·         ATTENTION: DDrawCompat on multi-core CPU will load 1st core at 100% by default. To load cores evenly the following must be enabled in dxwrapper.ini:
[DDrawCompat]
 DDrawCompatNoProcAffinity  = 1

For recent dxwrapper versions in this section also set
DDrawCompat21 = 1


  Optionally may enable antialiasing here if it is not already enabled in nVidia/AMD driver settings:

  [d3d9]
  AntiAliasing               = 1

Optionally may also enable borderless windowed mode here (don’t forget to disable it in FusionFix):

[d3d9]
 EnableWindowMode           = 1
 FullscreenWindowMode       = 1

 

If the game crashes with "D3D reset failed" message after changing graphics setting while playing try EnableD3d9Wrapper=1 parameter in dxwrapper.ini. This parameter is required to enable D3D9 wrapping code in recent versions of dxwrapper.

(Fir AMD GPUs only) in Radeon Software/Adrenalin find AMD shader cache setting and set it explicitly to "On" instead of default "AMD Optimized". (both tips contributed by user MagicAl6244225)

 

Pros:

·         Game looks as intended - native renderer is used

·         Fast, as it does not translate anything, just fixes output

·         Has rudimentary antialiasing

Cons:

·         older DxWrapper version may sometimes freeze when you quit the game, fixed in latest version.

·         FusionFix's cutscene definition fix may not work, YMMV.

 

dgVoodoo method

Read reference article #2 in Reference links

Quick guide

  1. Download dgVoodoo2.
  2. Put dgVoodoo.conf, dgVoodooCpl.exe, D3D9.dll from MS\x86 to GTA IV folder
  3. Run dgVoodooCpl.exe, on DirectX tab configure VRAM size (it is saved in dgVoodoo.conf), and disable dgVoodoo Watermark, press Apply
  4. Add to commandline.txt line -availablevidmem {N} where {N} is the same size as VRAM for dgVoodoo virtual adapter in dgVoodoo.conf

Pros:

·         Silky smooth with DX11 (DX12 in latest WIP builds) renderer

·         many antialiasing options

·         pretty stable and problem-free e.g. starts / exits OK

Cons:

·         A little slower than dxwrapper

·         default watermark - must turn it off in configurator

·         night lights are visible through solid walls or helicopter

 

WineD3D method

Read reference article #1 in Reference links

Quick guide

  1. Download WineD3D. For OpenGL output download Pre-Vulkan v4.5. WARNING: game start not guaranteed, latest version at the time of writing v5.13 did not work for me at all, v4.5 sometimes may also not start, YMMV.
  2. Unpack d3d9.dll, libwine.dll, wined3d.dll to GTA IV folder

Pros:

·         silky smooth - framerate/frametime are rock solid and more stable than with dxwrapper.

Cons:

·         Must change the resolution on the first run - it will start correctly next time

·         often can't start the game at all – must remove -managed from commandline.txt and/or try different earlier builds, YMMV

·         3-5 fps slower than DxWrapper

 

DXVK method

Read reference article #3 in Reference links

Quick guide

  1. Make sure your GPU is Vulkan-capable and you have installed latest release or beta drivers for it
  2. Download DXVK. ATTENTION: DXVK after v2.0 requires Vulkan 1.3 compatible driver. If your GPU/driver supports Vulkan 1.2 or lower you must download DXVK v1.10.x or earlier!
  3. Unpack .tar.gz file, put d3d9.dll from dxvk-{version}\x32 subfolder to GTA IV folder. File dxgi.dll from DXVK is optional on Windows as game will work without it and it may cause problems with DXVK 1.8.1 and above.
  4. (This step is optional for later DXVK builds) Create in GTA IV folder file dxvk.conf that contains
    dxgi.maxFrameLatency = 1
    d3d9.maxFrameLatency = 1
  5. Add to commandline.txt line -availablevidmem {N} where N should be a little less than actual VRAM size e.g. for 2Gb GPU specify 1983 and not 2048 here. To find the exact number run dxdiag and look for the "Display Memory" on Display tab or start the game with default D3D9 renderer and ExtendVidMem (read "Total VRAM in GTA IV" in Appendix), look in ExtendVidMem.log that was created.

Running GTA IV with DXVK v2.X

Later DXVK versions use Vulkan 1.3 feature Graphics Pipeline Library (GPL) to improve rendering. It compiles shaders for graphical pipelines beforehand and manages pipelines so there's no need to maintain cached pipelines in state cache file. The shaders are mostly precompiled during game launch and loading screens.

ATTENTION: GPL implementation is very driver-dependent and some late nVidia drivers have memory leaks and Vulkan settings that may cause problems with DXVK and GTA IV. I had hitches in 7 of 10 game launches on affected nVidia drivers 535.98, 536.23 (Vulkan v1.3.241). Older 531.79 (v1.3.236), beta Vulkan driver 532.17 (V1.3.250) and 536.40 (v1.3.241) work OK.

How to test if your driver is affected

  • Create new savegame in Broker safehouse to spawn at night e.g. go to bed at 19:00
  • Enable HUD in dxvk.conf (dxvk.hud=full) or use other OSD e.g. MSI Afterburner to display frametime graph
  • install Fixed Shaders Collection (for 1.0.7.0 and above) or latest FusionFix (for 1.2.0.x) that bundles it
  • Delete or rename state cache file GTAIV.dxvk-cache
  • Launch the game, it should load your newest "Broker safehouse at night" savegame.
  • After spawn in the apartment rotate the camera - there should be no frametime spikes
  • Go downstairs and out - there should be no freeze when you open the door to the street
  • Drive right along the bank to the docks - there should be no frequent hitches that feel like stutter during driving
  • If your game has been butter smooth so far exit the game and retest at least 10 times

Workarounds if your driver is affected but you can't install another one:

  • Use DXVK-gplasync, enable async and state cache in dxvk.conf
    dxvk.enableAsync = True
    dxvk.gplAsyncCache = True

    This will not eliminate hitches when shaders are compiled for the first time but will make hitches less severe and fully eliminate them on subsequent launches after state cache is saved.
  • (Not recommended) disable GPL in dxvk.conf with dxvk.enableGraphicsPipelineLibrary=False, this will enable old pipeline generation mechanism and state cache file.

Running GTA IV with older DXVK versions

(for Steam users) disable Vulkan shader caching in the Steam options (the tip contributed by user MiesThies). DXVK must be able to read/write to its state cache file and it is crucial for removing stutters, see "State cache" section at DXVK page for details. The file is called GTAIV.dxvk-cache and by defailt it is created/modified by DXVK in game folder where GTAIV.exe is but Steam may mess with this and redefine DXVK state cache location to something like {path}\steamapps\shadercache\12210\DXVK_state_cache where DXVK may have trouble accessing it.

DXVK may at first be laggy as it builds state cache, it is normal - the more you play the smoother it will become e.g. do several missions or run built-in benchmark at least 3 times and you will see.

If the game starts OK and after loading your savegame it shows black screen with only minimap and mission marker or skydome visible the workaround is to reinit display. Go to Graphics settings and change shadow quality, press Space to apply - this will reinit display and everything will become visible, then press Esc several times to revert to your original shadow setting and return to the game.

Pros:

·         silky smooth

·         higher fps than any other method, YMMV

·         full VRAM utilization using -managed

·         built-in frame rate limiter (only for versions 1.9+, to enable put d3d9.maxFrameRate=60 into dxvk.conf)

Cons:

·         nVidia driver antialiasing options do not affect DXVK Vulkan output. DXVK built-in MSAA only works on very old games and not on GTA IV. As a workaround you may enable antialiasing with DXVK using SweetFX.

Summary table

 

Method

Renderer

Smooth

Start / exit

FPS

Game looks

Anti aliasing

DxWrapper

Default D3D9

☆☆

☆☆

dgVoodoo

DX11/12

☆☆

☆☆

☆☆

WineD3D

OpenGL (v4.5), Vulkan

☆☆

 

DXVK

Vulkan

☆☆

☆☆

☆☆

☆☆

 

So there you have it - test for yourself and choose whatever fits your configuration. Feel free to share your experiences with different methods and your specs in comments below.

Appendix

Why default D3D9 output is slow

Possible causes are:

·         Low-end GPU. It is not the main culprit as even the most low-end GPU e.g. gt610 that I used to have on my old rig is capable of smooth output via alternative renderer (as shown by WineD3D and dgVoodoo).

·         Poorly optimized driver. Example: on the same Xeon E5-2689 PC with Windows 10 build 2004, GTA IV default D3D9 output on gt610 with older driver very rarely loads all cores and is choppy, but on gt730 with the latest 451.67 driver all cores are loaded and default D3D9 output is very smooth. Of couse these GPUs have different number of shader units and different architecture, but nevertheless underutilization of CPU cores on older driver exists.

·         Poor compatibility of a driver with particular Windows build. It is confirmed, that older driver that was developed for earlier Windows build may not perform as well on newer Windows build, and newest driver that was developed for latest Windows build may not perform as well on earlier Windows build. So you should try your luck with latest beta drivers for your specific Windows build.

·         DirectX implementation specifics on different Windows versions. For example, I have no DxWrapper and WineD3D start/exit issues on Windows 7 and on Windows 10 with newest nVidia driver.

Total VRAM in GTA IV

 ExtendVidMem module (dinput8.dll in FitGirl repack)

·         Detects total VRAM and automatically sets -availablevidmem in the game, works for default D3D9 renderer and Wined3d

·          -availablevidmem {N}  in commandline.txt takes precedence over ExtendVidMem. Example for 2Gb VRAM videocard with ExtendVidMem: game detects 2048 mb without -availablevidmem {N}, but detects exactly {N} mb  with explicit -availablevidmem {N} .

-managed GTA IV commandline.txt parameter

This parameter is supported only on GTA IV 1.0.6.0 and above.

By default the game allocates VRAM and loads textures as needed. It results in lags that are due to world loading when Niko walks out from safehouse hall to the street, VRAM usage immediately goes up.

-managed  instructs the game to use D3D runtime managed resources. Using -managed with DirectX does not yield much, but using it with DXVK (which in this case acts as D3D runtime) allows it to preload all needed resources into VRAM e.g. DXVK fully utilizes VRAM during savegame load. This has huge impact on GTA IV performance and overall smoothness – when all needed resources are preloaded the game is enjoyable even on a lowest-end PC with fairly decent GPU e.g. it is silky-smooth at 1280x1024 with High textures, on my ancient Socket 939 Athlon 64 X2 4200+ o/c 2.6 Ghz, 3Gb RAM, gt730 2Gb GDDR5.

GTA IV VRAM management with different methods

The VRAM usage examples in this section are based on the following scenario:

·         walking out of Algonquin safehouse near the bridge, driving along the park to the end of avenue where roadblock is

·         Numbers are as reported by MSI Afterburner for Vulkan-capable Gt730 GDDR5 2Gb at 1280x1024, High texture quality

·         Very low-end Windows 7 PC (2-core Athlon 64 X2 with specs above) so your mileage may vary.

Default D3D9 with dxwrapper

·         Allocates VRAM and loads textures as needed, world loading lag

·         fps less than dxvk, YMMV – on Xeon E5-2689 with newest drivers it is faster than dxvk

~200mb VRAM after game load, ~580mb VRAM at avenue end, number is the same with or without -managed, -percentvidmem 100.

Wined3d

·         Allocates VRAM and loads textures as needed, world loading lag, does not support -managed in commandline.txt – with it the game will have infinite loading screen

·         Works with ExtendVidMem, may use -availablevidmem {N}  in commandline.txt

·         Game load is slowest, probably because it does not support IV.EFLC.ColAccel.asi

·         Lowest fps of all methods, but very stable frametime - overall fps lag but no choppiness during driving

 ~620mb VRAM at avenue end

dgVoodoo

Virtual adapter configuration in dgVoodoo.conf:

  [DirectX]
     VRAM = {N}

{N} should not be the exact amount of VRAM but a little less e.g. for 2Gb videocard enter 1983 here and not 2048, or else the game may not load savegame. To find the exact number run dxdiag and look for the "Display Memory" on Display tab or start the game with default D3D9 renderer and ExtendVidMem, look in ExtendVidMem.log that was created.

·         Requires explicit -availablevidmem {N} where {N} is the same size as VRAM for dgVoodoo virtual adapter, without it GTA will use default VRAM size 512 mb and may drop texture quality to low.

·         -managed works, loads world/textures more aggressively

·         Still does not use full amount of VRAM even if it is available: preloads much of the textures during game load, no major stutter/choppiness, but has noticeable lags when loads new world/textures.

·         Second fastest after dxvk, YMMV

~230mb after game load, ~700mb VRAM at avenue end without -managed
~400mb after game load, ~900mb VRAM at avenue end with -managed

 

DXVK

May have in dxvk.conf:

dxgi.maxFrameLatency = 1
d3d9.maxFrameLatency = 1
d3d9.maxAvailableMemory = {N}      (optional. Explicit N that you specify here will be reflected in GTAIV_d3d9.log)

·         Requires explicit -availablevidmem {N} in commandline.txt, without it GTA with dxvk will detect only 512mb. Cannot rely on ExtendVidMem to automatically supply VRAM size, it is recommended to disable it. To find the exact {N} run dxdiag and look for the "Display Memory" on Display tab or start the game with default D3D9 renderer and ExtendVidMem, look in ExtendVidMem.log that was created.

·         Full VRAM utilization, with -managed all textures are preloaded during savegame load and walking out safehouse to avenue is not choppy as with wined3d.

·         Aggressive VRAM allocation using -managed -nomemrestrict may crash the game with error dialog
GTA IV FATAL ERROR: RESC10
 GTA IV FATAL ERROR: Out of video memory - Please re-boot your system
3145272 696725

·         On a system low on RAM game may crash on savegame load or after the game loaded and Niko drove around Algonquin a little bit with error in GTAIV_d3d9.log
err:   DxvkMemoryAllocator: Memory allocation failed

·         Very low CPU utilization, good for low-end systems

·         has built-in MSAA (untested), nVidia driver antialiasing options do not affect DXVK Vulkan output

 

With -availablevidmem 1983:

·         1061mb without explicit d3d9.maxAvailableMemory in dxvk.conf

·         1061mb with explicit d3d9.maxAvailableMemory in dxvk.conf but with -percentvidmem 100 in commandline.txt

·         1189mb with explicit d3d9.maxAvailableMemory = 1983 in dxvk.conf
   1190mb without -reservedApp 0  in commandline.txt
   1446mb with -reservedApp 0 -nomemrestrict in commandline.txt. -norestrictions does not affect VRAM usage, it just allows to set arbitrary graphics settings in the game even if your videocard does not support them, by default the game does not allow that.

·         1902mb with -managed, game may freeze/crash on low RAM system as DXVK will be unable to allocate more RAM on loading comedy or cabaret club. Possible workaround is to lower -availablevidmem or remove -nomemrestrict and add correct -memrestrict {value}

 

 

Reference links

1.       Translation to OpenGL using WineD3D https://steamcommunity.com/sharedfiles/filedetails/?id=691816599

2.       DirectDraw output fix using DxWrapper or translation to DX11 using dgVoodoo - if WineD3D/Vulkan does not work for some reason https://steamcommunity.com/sharedfiles/filedetails/?id=1573821562

3.       Translation to Vulkan using DXVK https://www.reddit.com/r/pcgaming/comments/gsn6w8/dxvk_works_magic_on_gta_iv/

 

270 comments:

  1. Заебись, спасибо, завтра буду пробовать варианты!

    А то у меня комп такой, про который в 2008 году даже мечтать не могли, а гта4 тормозит так, будто я играю в нее на третьем пне.

    ReplyDelete
    Replies
    1. Вроде работает, во всяком случае антиалиасинг появился. Спасибо!

      Delete
    2. Если видеокарта мощная, самое лучшее сглаживание даёт nVidia DSR или AMD VSR. Для монитора FullHD в игре можно выставить разрешение 4К, а драйвер будет его даунсемплить со сглаживанием до FullHD.

      Ещё вариант, который даёт сравнимый результат, это связка сглаживания 2X в настройках драйвера плюс SMAA injector https://steamcommunity.com/sharedfiles/filedetails/?id=1447497524

      Delete
    3. Про DSR не подумал, спасибо, попробую. Туда бы еще DLSS добавить :D

      Но игра все еще выдает просадки, хотя у меня рязань 5 и 2060, для такой старой игры должно за глаза быть.

      Delete
    4. Оптимизация GTA IV для современных многоядерных процессоров оставляет желать лучшего т.к. во время порта были доступны только 2х-ядерные процессоры. Просадки происходят а) из-за продвинутой физики и появляются в основном в сценах, где много объектов, которые могут столкнуться друг с другом т.е. это эстакады в спальных районах, Алгонкин, мосты со множеством машин и б) из-за динамических теней. Поэтому для комфортной игры можно выставить все настройки на максимум, но нужно понизить Detail Distance, Vehicle density и детализацию теней.
      Кроме этого, при fps выше 60 физика мотоциклов слетает и они начинают ёрзать на дороге.
      У меня на новой машине E5-2689 + RX580, FullHD, стоит ограничение 60fps в FusionFix, DXVK + SweetFX для сглаживания (напишу наверное отдельный пост как это сделать), абсолютно стабильный фреймтайм без спайков и 60 fps с редкими просадками до 45-50 fps.

      Delete
  2. Привет
    А как в DXVK включить MSAA? По-моему, d3d9.forceSwapchainMSAA не работает, добавляю в dxvk.conf с различными значениями, кратными двум.
    И какой вообще приемлемый/лучший способ сглаживания для этого метода? Reshade + DSR?
    А вообще, спасибо, очень крутое решение. Единственное, что появилось на 1070 версии - это просвечивающиеся метки заданий через стены - понятия не имею, откуда это (может быть, кстати, этот "типа MSAA" виноват

    ReplyDelete
    Replies
    1. forceSwapchainMSAA работает только с очень старыми играми, говорят оно работает с GTA SA и Mafia.

      DSR/VSR делает сглаживание неявно при масштабировании вниз и больше никакого другого сглаживания не нужно. Если карта мощная это самое лучшее решение.

      Для DirectX SMAA из reshade гораздо лучше стандартного сглаживания на уровне драйвера.

      Для Vulkan последний reshade тоже работает, но в глобальном режиме т.е. решейд будет включен вообще для всех игр, которые выводят через вулкан.
      Я использую SMAA из предыдущего решейда SweetFX 1.5, он поддерживает чейнлоуд переименованного d3d_dxvk.dll.

      Delete
    2. К сожалению, DSR до 4К не хватает, слишком печально все в некоторых местах, лесенки напрягают наряду с Z-fighting-ом.

      Спасибо, попробую тогда DX

      Delete
    3. Все же можно попробовать SweetFX, он ставит свой d3d9.dll, который внедряет шейдеры, поэтому d3d9.dll файл от dxvk нужно переименовать d3d9_dxvk.dll (dxgi.dll так же переименовать dxgi_dxvk.dll) и прописать их в sweetfx_settings.txt в закоментаренных строчках external_d3d9_wrapper и external_dxgi_wrapper + включить smaa. Т.е. вначале будет внедрено сглаживание а потом пойдёт вывод через dxvk. Я напишу отдельный пост наверное про такой чейнлоуд.

      Delete
  3. Привет, уже несколько месяцев бьюсь с этой игрой, может ты сможешь помочь... Сразу скажу, что с железом все ОК, комп собирался топовый по меркам 2017-2018 годов, так что для игры 12-летней давности более чем достаточно. Короче после последнего даунского обновления фпс в игре превратился неизвестно во что: когда только завел винду и запустил игру, то почти без нареканий- 60 фпс стабильно, практически без просадок. Но когда играю 10-15 минут, фпс в тех же абсолютно местах города падает до 50-40, а то и до 30 кадров. Что только не пробовал- ничего не помогает. Стоит последняя стимовская версия игры, кстати до обновления (т.е. в 2017-2018 годах игра на этом же компе работала идеально).

    ReplyDelete
    Replies
    1. единственное, что в таком случае помогает вернуть частоту кадров на более-менее приемлимый уровень- это если выкрутить дистанцию обзора и глубину детализации на супернизкие значения (25-30 из 100)

      Delete
    2. Да, последнее обновление в общем случае нельзя назвать удачным. Я сделал даунгрейд до 1.0.7.0, конфиг и фпс см в комменте выше. Возможно, если до последнего обновления игра шла нормально, вам даунгрейд тоже может помочь (переводчик включайте на панели справа)
      https://ant-sh.blogspot.com/2020/09/easy-downgrade-gta-iv-to-1040.html

      Delete
  4. Ребят, у всех ли дико лагает (до 33 кадров) в районе Tudor? (юго-западный выступающий участок на карте, на крайнем левом острове)
    Все работает очень хорошо и плавно, особенно с Фрисинком, но в вышеуказанном месте прям беда. Может кто-то еще проверить?

    ReplyDelete
    Replies
    1. Продолжение вышеописанного. Наблюдаю странную вещь.
      Как оказалось я вчера целый день тестил EFLC в каком-то странном режиме. Все было плавно и приятно, но на разрешениях выше 1080 производительность была не самая лучшая, сильно падая местами до 33 кадров, наже 40 кадрового порога Фрисинка. (1060 6ГБ, Ризен 1700х 3.7 Ггц)
      Каким было мое удивление, когда сегодня снова запустив комп и игру я обнаружил, что она на 2х DSR летает на абсолютно выкрученных настройках 60 фпс (даже бегунки по 100), даже в Tudor, просаживаясь всего кадров на 5 О_О !!! Счастливый полетел менять разрешение на 4к, летает с 45-50 кадров на выкрученных О_О Радостно катаюсь по городу и кайфую и... игра повисла. Матернулся, убил процесс, снова запустил - и в этот раз печальная производительность как вчера (
      Перезагрузил драйвер (Win+Ctrl+Shift+B) и DWM и перезалогинился в учетку без перезагрузки - та же печальная производительность. Перезагрузил полностью комп - снова все летает !!! О_О
      Вот такая магия. Что происходит? Как понять что ломается при вылете игры и можно ли это "что-то" перезапустить, не перезагружая комп каждый раз, ибо ГТА4 никогда не была самой стабильной игрой?

      Delete
    2. В ваших сообщениях много эмоций, но мало фактов, чтобы можно было как-то диагностировать зависания. Очень много факторов влияют на это:
      - ОС и версия драйвера (см выше) + настройки драйвера
      - версия игры и метод запуска (репак, ргл)
      - рендерер и его конфиг + параметры commandline.txt. У меня бывало зависал DXVK из-за нехватки памяти (3гб всего было)
      - спецификация ПК (сколько памяти?)
      - профиль использования ресурсов (установить MSI Afterburner и наблюдать за утилизацией ядер процессора, памяти, видеопамяти, графиками фпс и фреймтайма)

      Delete
  5. Привет
    Есть ли возможность включить SLI в DXVK, как в DxWrapper?
    Бтв, спасибо за статью. Уверен, этому инструменту нужна бОльшая огласка.

    ReplyDelete
    Replies
    1. Я с SLI не сталкивался. Видел на гтафорумс один чувак через танцы с бубном запустил РДР2 на двух 2080 с выводом через вулкан. Не знаю пройдет ли такое с DXVK.

      Delete
  6. Hello! I could have sworn I've visited this website before but after browsing through a few of the posts I realized it's new to me. Regardless, I'm definitely delighted I discovered it and I'll be bookmarking it and checking back regularly!

    ReplyDelete
  7. Hey man, a desperate soul here trying to enjoy this masterpiece of a game that runs very bad on pc and makes my i7 4790K hit up to 80C degrees, i've tried every single thing you've mentioned in your post,
    My PC Specs are i7 4790K-GTX 1070-16GB RAM running on a 1360x768 monitor and my game is v1. 2.0. 32 with 2 mods FusionFX and ColAccel applied, DxWrapper didn't give me any noticeable results and it's still on dx9 so nothing on CPU usage, dgVooodo is just not usable with lights going through buildings (but had the best performance and very low cpu usage), WineD3D result in errors only and didn't run, and for the grand finale DxvK is just weird, I copy the files and do all the things you said in commandline.txt, i run the game and load my savefile, the moment i get out of Roman's apartment in the earlier stages of the game and my gpu usage just shoots up to 100% with 20-30fps dropping down to low 10s when trying to drive around during daytime or at best 52-54 at nighttime, i have no idea does this happen at all, i honestly would tolerate the frame dips and performance issues but my cpu running so toasty in a near-winter chilly room in a 12-year old game is just too much for me, i can provide you any info you want or maybe you could tell me with which version of the game you had the best success, i don't know where else i can discuss this so i hope you respond my friend.

    ReplyDelete
    Replies
    1. My game is a Dodi repack version and i'm on Windows 10 2004 NVidia Drivers 457.30, I am also forced to play the game using the RunAsDate app in order to get my game to get saved and i launch my game through the RunAsDate Shortcut.

      Delete
    2. Sorry for this mess of replies but the settings that i was running at were all settings set at max except the 3 bars for draw distance-vehicle density and the other one at 70, is this too overkill for my gtx 1070?

      Delete
    3. Hey! I was trying to use 1.0.8.0 with DXVK first and though results were much better than vanilla game, they were far from perfect and some places were just laggy mess. Than I moved to 1.0.7.0 - and it works wonderfully! On my Ryzen 1700x and GTX1060 6gb the game runs at 4k with everything maxed but Shadows (High instead of Very High - memory hog) and Night SHadow OFF (glitchy memory hog). So the game runs well on my Freesync monitor mostly 60 FPS with are dips to 45 at some places and 35-37 at Meadows Park (that place seems to be badly optimized CPU usage drops to 13% there). 1.0.4.0 works even better! So give those versions a try!

      Delete
    4. I am very happy with 1.0.7.0,
      you may read Russian language comments here through google translate.

      If you are adventurous you may try the downgrade on separate copy of gta folder. https://ant-sh.blogspot.com/2020/09/easy-downgrade-gta-iv-to-1040.html

      Delete
    5. Also I should remind you that DXVK at first may be slow as it creates shader cache. Drive around Broker, restart the game, do Roman missions and your performance should improve.

      Delete
    6. Also install latest driver https://www.guru3d.com/news-story/download-nvidia-geforce-457-51-whql-drivers.html

      Delete
    7. Yeah thanks to both of you guys, i've downgraded my game to 1.0.7.0 and used the links from this guide: https://steamcommunity.com/sharedfiles/filedetails/?id=1372047571 for the radiostations, the performance is much better and all, i have 2 issues and first is my game is locked at 53fps with Vsync on and i cannot get my previous Goldberg SocialClub Emu Save file i had from the Complete Edition v1. 2.0. 32 on the Downgraded version but i'll try and find a solution for those, i guess DxvK just doesn't work well on the latest version (Complete Edition).

      Delete
    8. Old radio downgrader link fixed in the downgrade post

      Delete
    9. You can turn off in-game vsync and force it externally via Nvidia/AMD panel, it will lock FPS to required refresh rate. Also you can use ZolikaPatch (https://gtaforums.com/topic/955449-iv-zolikapatch/#comments) to fix the ingame vsync, but be careful with patch's settings, some of them are crashy. Good luck!

      Delete
    10. Thank you friend, yep i did that and it fixed the vsync issues perfectly, only problem remaining is my save file not working on the downgraded version, if i can't find a solution to that i guess i have to start over again :(

      Delete
    11. Maybe 1.0.7.0 just uses different saves location and you have to move them there. Cant help with exact location, unfortunately, but figuring that out definitely worth trying. Mine are located at AppData\Local\Rockstar Games\GTA IV

      Delete
    12. The savegame location for GFWL versions is defined by xlive library and it is different depending on the one used. https://ant-sh.blogspot.com/2020/08/how-to-run-gta-iv-offline.html#_Toc49685062

      Delete
  8. Дай бог здоровья автору и создателю DXVK, теперь лупендит только так.

    ReplyDelete
  9. DXVK is great and removed the horrible stutter during cutscenes and gameplay, and now I can get 30fps with good framepacing, but the game has crashed twice now, always at the end of a cutscene (not every cutscene, but sometimes). Otherwise finally the game is playable, I wish I could do something about the crashes though...

    ReplyDelete
    Replies
    1. Isnt that 1.0.8.0? It was crashy to me until I moved to 1.0.7.0.

      Delete
  10. Hello dxwrapper blocks the cutscene fixes from fusion fix for patch 7 which means I'm stuck with blurry stuttering cutscenes. Is there any fix for this or any other mod or do I have to sacrifice low quality cutscenes for fps?

    ReplyDelete
    Replies
    1. What specs do you have? Does 1.0.7.0 stutter without dxwrapper?

      You may invoke dxwrapper not as asi but through a stub - remove dxwrapper.asi and copy to GTAIV folder dxwrapper.dll + .ini and dinput8.dll from stub subfolder.

      You may also try using DDrawCompat directly without dxwrapper
      https://github.com/narzoul/DDrawCompat/releases

      Delete
    2. I have a AMD 3400g with a 1660 super with 32 gb ram, Patch 7 stutter alot less with your fix! But I did not understand which folder to add dxwrapper?

      Delete
    3. Dxwrapper can be invoked either through asi loader + dxwrapper.asi/ini (in GTAIV folder or plugins subfolder) or through dxwrapper.dll/ini + stub dinput8.dll to load it (both must be in GTAIV folder). Take dinput8.dll from Stub subfolder in dxwrapper.zip.

      BTW your GPU supports Vulkan and you'll probably get smoother gameplay if you remove dxwrapper and try DXVK method.

      Delete
    4. I tried DXVK but I got a worse resolution when I used it. The dxwrapper.dll method didn't work, I'm still getting buggy cutscenes.

      Delete
    5. If you are on 1.0.7.0 for DXVK to work OK you should set -availablevidmem correctly. Older versions interpret this parameter differently e.g. you can not just specify your VRAM in megabytes. Experiment until game detects at least 2047 mb in Resource Usage in Graphics. See sample table here https://ant-sh.blogspot.com/2020/09/easy-downgrade-gta-iv-to-1040.html?#_Toc50220895

      Delete
    6. The game already detected 2048 mbs of vram.

      Delete
    7. That's as high as 1.0.7.0 can get. "I got a worse resolution", what resolutions are you talking about ? You want M x N but with DXVK game only allows Y x Z - what are specific numbers? I assume you already have -norestrictions in commandline.txt, maybe you can force the resolution you need with -width / -height parameters there?

      Delete
    8. I'm using a resolution of 1920 x 1080p but the dxvk limits it to 1176 x 664. Deleting dxvk brings back higher resolutions.

      Delete
    9. I run 1.0.7.0 with DXVK, game detects 2048Mb VRAM and resolution 1920 x 1080 works so it is something specific to your PC.
      How do you launch the game (launchGTAIV.exe or directly GTAIV.exe)? What is in your commandline.txt? What happens if you add -width 1920 -height 1080 there? Can you put your DXVK log (GTAIV_d3d9.log or launchGTAIV_d3d9.log)on pastebin.com?

      Delete
    10. I forced gta 4 to run at 1080p and it works now! It's so smooth now! But the stutters are pretty annoying as it loads new areas. However the cutscenes are still buggy. The cutscenes are blurry no definition, and some cutscenes like tree leaf clover, when you rob the bank with packie are very zoomed in

      Delete
    11. Are you sure that your FusionFix loads at all? Which version do you use?

      With 1.0.7.0 works only this version https://github.com/ThirteenAG/GTAIV.EFLC.FusionFix/releases/tag/v1.10
      Do NOT copy pc\data\maps\props\vegetation\ext_veg.ide from this FusionFix as it will make all foliage static.

      To test if it works at all set some unusual fps limit in GTAIV.EFLC.FusionFix.ini e.g. FpsLimit = 35, disable all other fps limiters you may have and see fps in MSI Afterburner overlay, it should be limited to 35.

      Delete
    12. FPS Limiter does not work, I redownloaded fusion fix but there is no effect, 45+ fps everywhere. I'm so sorry with the amount of hassle I'm giving you. :(

      Delete
    13. Don't worry, no hassle but you must provide the info I request or I will not be able to assist in troubleshooting.
      You should now carefully review all your .asi and .dll files in GTAIV folder and plugins subfolder and leave only necessary. Did you install Ultimate ASI loader as part of XLivelessAddon (xlive.dll) or did you install it separately as dsound.dll or dinput8.dll?

      Delete
  11. Thanks man! I'm using xlive, and the asilog successfully recognizes fusion fix however the cutscene fixes don't work. I installed dinput8 separately.

    ReplyDelete
    Replies
    1. Ultimate ASI loader does not create asilog.txt, it means that you have asi loader by Alexander Blade which may not be compatible with this FusionFix - that's why it does not limit your fps and does not fix cutscenes.

      Move away dinput8.dll, dsound.dll, xlive.dll and install XLivelessAddon - it will install correct Ultimate ASI loader (xlive.dll) and addon.
      http://ant-sh.blogspot.com/2020/08/how-to-run-gta-iv-offline.html#_Toc49685057

      Which .asi files do you have in GTAIV folder, scripts and plugins subfolders?

      Delete
  12. But hold on? I have xlive.dll and I have been using it the whole time? Fusion Fix does not work with dxwrapper or dxvk, When I add in dxwrapper or dxvk in my files, Fusion fix does work, but the mod does not do its cutscene fps limiter and definition on fix. As soon as I delete dxvk or dxwrapper. Fusion Fix does its job. The culprit isn't the asi loader but the dxwrapper and the dxvk. BTW i'm using Xliveless from here:https://gtaforums.com/topic/388658-relgtaiv-xliveless/

    ReplyDelete
    Replies
    1. FusionFix works OK with DXVK on my 1.0.7.0. Your setup is too complex. You should have NO dxwrapper.dll/.asi - you don't need dxwrapper as you got DXVK working, NO dsound.dll, NO dinput8.dll, NO ddraw.dll in GTAIV folder or its subfolders.

      GTAIV 1.0.7.0 launches through GTAIV.exe and works with
      - DXVK (d3d9.dll, dxgi.dll)
      - XLivelessAddon (xlive.dll size ~2Mb + plugins\xlivelessaddon.asi and .ini). This big xlive.dll is Ultimate ASI Loader which loads FusionFix asi
      - FusionFix 1.1 (plugins\GTAIV.EFLC.FusionFix.asi and .ini and .dat)

      Leave only the needed files from the list above and fps limiters from FusionFix will work with DXVK.

      Delete
    2. THANK YOU! The fps limiter and cutscenes work! THANKS! I had too much asi loaders! My bad. I just need 2 last things.
      1. How do you turn on anti-aliasing? Pop-ins are less noticeable with anti-aliasing on in my opinion
      2. Do you know how to alt-tab out of the game? The game refuses to alt-tab to other windows with dxvk.
      Thank you

      Delete
    3. I am glad you finally got it to work.

      For antialiasing you may enable DSR through nVidia panel, remove forced -width / -height from commandline.txt and set 4K resolution in game. Driver will downsample 4K with AA to your monitor resolution.

      Another option is reshade/sweetfx. I probably will write a separate post on this.

      As for alt-tab I could not get it to work with DXVK. If you manage to do so please let me know. Anyway it is a small price to pay for smoothness that DXVK provides.

      Delete
  13. DXVK делает картинку мыльной, как-будто разрешение не 1920, а 1366, хотя в настройках игры всё верно.
    Так и задумано или как-то чинится?

    ReplyDelete
    Replies
    1. Я не замечал особой разницы. Сделайте скриншоты конкретной сцены и графических настроек в обоих случаях, и если разница действительно есть размнстите багрепорт на гитхабе разработчиков.

      Delete
  14. Hello, I'm on version 1.0.7.0 Complete Edition. I tried the DxWrapper method it works great but I'm having issues with V-sync whenever I turn on V-sync my FPS is capped to 50. I tried -refreshrate 60 -frameLimit 1 in commandline.txt but no luck. Any suggestions?

    ReplyDelete
    Replies
    1. Do not use broken in-game vsync. If you need it so much enable it in driver settings. I use DXVK and no vsync anywhere and still have smooth gameplay without tearing.

      Delete
  15. Hello!
    I tested the DXVK method with the latest GTA IV Complete from Steam.
    I needed to supply -availablevidmem 4096 (or something) to have it recognize.
    Gameplay is very smooth but I run into a problem: during gameplay or a mission, whenever a loading screen occurs (before a cutscene or something), the game is stuck with that. The "loading..." black screen never ends and I need to quit the game. I have only encountered this twice during the begining of the game, I don't know if it happens all the time. Any idea on what could cause it? Is there any other dxvk.conf option that I need to activate?

    I am using Vsync as I have a Gsync compatible monitor and want to benefit from it.
    Also, the game version listed on the executable from Steam is 1.2.0.43

    ReplyDelete
    Replies
    1. I have seen DXVK shows some crazy fps during game load screens.
      Try installing latest FusionFix and set 60 fps limit there and check fps in MSI Afterburner overlay.
      Though I personally don't use it I read that ZolikaPatch somehow optimizes loading screens, you may try that.
      As a last resort you may downgrade the game using the guide here. I run downgraded 1.0.7.0 and never had infinite loading screens but when I was running 1.2.0.32 I sometimes had them.

      Delete
    2. Thanks for the reply!

      In the mean-time I highly suspect that the infinite loading screens are caused by and only after using Alt+Tab during gameplay. If I don't do that, I don't encounter this bug, I'm 90% sure of this.

      Is this Alt tabbing issue a known one with GTA IV or something with DXVK (I haven't tried to reproduce without DXVK)? Any directions to allow this? I can play in the mean-time without doing it, as DXVK is doing wonders and the game is silky smooth.

      Thanks a lot for your concise instructions from this page!

      Delete
  16. Hello Anton,

    I'm sorry if this question is not correct.. I'm using FG repack, patch v7. It has RLD dll based crack and Xlive.dll as per your blog. So I moved these files from both the EFLC and GTA IV folders (LaunchGTAIV.exe, rld.dll, rld.ini, LiveTokenHelper.dll, XLive.dll, XLive.ini) to not use them.


    I applied these

    - Very old Razor 1911.dll and Razor LaunchGTAIV.exe cracks for patch 7.

    - XLivelessAddon from ThirteenAG (I hope this XLive version supports DLCs, I however didn't try it for now)

    - DXVK files for d3d.dll & dxgi.dll and created the .conf as well, in the commandline.txt I put "-availablevidmem 8053" since 980M GPU is 8GB GDDR5 Graphics Card (CPU is 4710MQ i7)

    I ran the game but I do not see the VRAM move past 650MB, lot of textures missing and game looks very bad.

    I tried to add FusionFIx v 1.10 from Git too, as it said it's supporting patch 8, and patch 7 at gtaforums but I also saw do not copy pc which is for DLCs, I didn't, not sure how to even check if it's working or not.

    Tried Zolika patch v5 but it won't run and says an exception at the start at the GTAIV.exe execution.

    If I remove the DXVK I see 3000MB as max, and if I add -availablemem 8.0, it shows up at 4000MB that's it. No matter what I couldn't get the game stable, changing any GFX options while running in DXVK results in hard lock. But it won't show me any more than 650MB if I use DXVK, no idea what is this issue.



    I tried RLD based crack version too earlier it was stutterring hard and didn't knew GTA IV had lot of issues..I uninstalled it and now trying again..Please help to get this run properly so that I can finally enjoy this game which I missed during my college. I'm sorry if my question is stupid.

    Thanks a lot for your blog I was at-least able to know more.

    Happy New Year 2021 !!

    Best,
    Max

    ReplyDelete
    Replies
    1. Thank you, Max. I am glad you found my blog helpful. I will try to give you an outline of the troubleshooting process.
      Do not go to next step until previous step completed successfully.

      - Install latest nVidia driver for your OS

      - Start with clean FG repack patch 7 installation.
      Check file properties for launchGTAIV.exe, GTAIV.exe and make sure they are not forced to run as Administrator, FG repack usually does this but it is not needed.
      If repack uses RLD then go with it, it does not affect stuttering, you don't need Razor1911 or XlivelessAddon.
      Do not remove / install anything, run launchGTAIV.exe and make sure that game at least launches successfully e.g. no mission-critical data files missing or corrupt.

      - Configure commandline.txt so that GTAIV detects at least 2Gb of VRAM in Graphics Settings and there is no red warnings there.
      This step is tricky for dual GPU laptops and you must add -norestrictions -nomemrestrict and experiment with -availablevidmem for your config, older game versions expect multiplier here and not VRAM size in megabytes.
      One user had success with -availablevidmem 60 (https://www.reddit.com/r/GTAIV/comments/jsnzm3/can_i_install_on_another_pc/)
      Test the game in D3D9 mode with your target resolution and graphics settings.

      - Install DXVK, latest build works OK for me without any dxvk.conf. Test the game, it should run OK now.

      - (optional) Install one of the modpacks that fix cosmetics e.g. texture pop-ins, car lights ...
      Usually they are targeted at 2020 Complete Edition but will work with any version if you carefully watch
      which files are replaced and which .asi/.dll files added. Do it at your own risk. https://www.reddit.com/r/GTAIV/comments/jzjt5s/is_gta_iv_worth_playing_on_pc_or_should_i_play_it/
      - (optional) Install XLivelessAddon to replace RLD.
      You gain very little if any fps from it and it is not needed for your repack as DLCs are in a separate EFLC game.
      I strongly suggest to do it only if you fully understand what you are doing and only after your game successfully launches and runs stutter free.

      Notes
      - Older game versions may not detect all 8Gb, it is normal.
      - Latest ZolikaPatch may not work with older game version so do not install it.
      - FusionFix needs an ASI loader to load plugins\GTAIV.EFLC.FusionFix.asi. If your repack does not have asi loader by default then install Ultimate ASI Loader (see above in dxwrapper method). To test if FusionFix works set fps limit in GTAIV.EFLC.FusionFix.ini, install MSI Afterburner and watch fps in overlay - it must be limited.
      - The above must be done separately for EFLC game.

      Happy New Year

      Delete
    2. Hello Anton,

      Thank you for your clear response. I have good news and bad news.



      Good news is the following are the steps I did achieve to run the game finally with some basic mods, I was about to explore all the mods and install some very good mods...but due to the issues (mentioned in bad news section)

      - FG repack vanilla patch v7 (1.0.7.0) RLD based Xlive and crack, remove the admin privilege on executables -> EFLC.exe and GTAIV.exe
      - (Verification step) Run the game with RLD based Xlive.dll, Xlive.ini, rld.bin, LaunchToken.dll -> yeah game runs, the commandline.txt is already installed with FG repack.
      - Now the next part is to get the XlivelessAddon running since it's also an ASI Loader which helps with other mods (to avoid multiple ASI loaders for the mods and also get Xlive.dll for GFWL bypass) so for that need to move the RLD based files.
      - Move the RLD files from both EFLC and GTAIV folders to a NODVD folder for backup.
      - Copy the XlivelessAddon zip content to the root of GTAIV folder and EFLC folders, adjust the .ini for preference, SkipIntro / SkipMenu etc..
      - Execute the game, the game runs, thanks to the inbuilt VRAM Fix?, no issues with red text.
      - Copy DXVK files d3d9.dll and dxig.dll to the GTAIV root and EFLC folders root.
      - Run the game from .exe, the game will have reset Screen resolution at 120x720 or 800x600 due to DXVK, had to change it first to preferred res mine is 1920x1080, the game freezes up and locks up If I change, it has to be closed from task manager too. So to avoid that I updated the commandline.txt to have 1920x1080 as -width and -height explicitly mentioned.

      - Execute both EFLC and GTAIV exes.
      - Game runs for both EFLC and GTAIV !!
      - Now FusionFix 1.10 (this is for patch v7 and 8), copy the zip contents to the plugins folder for both EFLC and GTAIV, try to test with framelimit as 30 and execute the game, if it locks up at 30 then it works.



      Finally I got to get it working properly thank you very much for the step by step guide, I think I understand now, also that LaunchGTAIV.exe is just a part of crack, I didn't knew that !! So apparently no need of that anymore since we can launch DLCs separate -> to play TLaD or TBoGT use EFLC.exe and run with SHIFT to select or play main as GTAIV.exe

      Note - DXVK alt+tab will cause freeze, so yes we have to live with that I guess.

      Bad news is after 10-15mins the game crashes as in grey screens on me it's crashing the driver, I updated to the latest driver too, I ran with and without FusionFix as well it crashed on both. So what I did was run to on DX9 native only & I do not have the TDR errors or lockups anymore. So DXVK 1.7.3 is not working for me, not sure if the FPS is increased or not to be honest.

      Also whenever I run the game from DXVK the GTAIV browser.exe doesn't quit when I exit the game, it keeps on running. I have to manually close the GTAIV browser.exe from task manager, If I do not do that next launch will have freeze up this happened with EFLC.exe as well. With DX9 native I do not have this issue.

      I was on the verge of loading more mods into the game, but DXVK problem means I may not have optimal experience.

      I know this is a different issue, but any ideas ? the HW is 4710MQ, 980M, 16GB DDR3L Win8.1 64bit and game is running from an MLC SSD. I played and finished DOOM Eternal which ran only on Vulkan on this machine without any issues.

      Best,
      Max

      Delete
  17. Sadly I still get microstuttering with DXVK, it happens every second and it does not matter whether I am moving or just standing.

    ReplyDelete
    Replies
    1. Too bad it doesn't work gor you, still there's no guarantee that DXVK will work in every case.

      NVidia users may get additional stuttering casused by monitor sync.
      https://www.nvidia.com/en-us/geforce/forums/moar-games/35/259946/gta-iv-4-stuttering/
      Also read Nvidia users' comments here
      https://www.reddit.com/r/pcgaming/comments/gsn6w8/dxvk_works_magic_on_gta_iv/

      What you may try:
      - some other methods above
      - other OS and driver combo e.g. earlier driver build or latest Windows build
      - other game version - downgrade to 1.0.4.0 or install latest 1.2.0.43 repack

      Delete
    2. Thank you, I'll try some of it.

      Delete
    3. It's interesting how the stutters happen with the same time distance between them (looks like one second, so one stutter per one second). I have a RTX 3070 and a Ryzen 5 3600X, 16GB of fast RAM and the game is on an NVME drive so I think it should run better than this.

      Delete
    4. I'm running the latest FitGirl repack (1.2.0.43).

      Delete
    5. It is a beast of a PC and your stuttering is likely nVidia/monitor sync-specific. Unfortunately I cannot help more than that as it requires intensive experiments with similar hi-end hardware which I don't have. Read nvidia forum and reddit links I posted above or anything else you may find and try it. If you manage to fix it please let me know, I will add it to this post crediting you.

      Delete
    6. Ok, I will let you know, but I do not think I will be able to fix it.

      Delete
    7. RTFM. I told you to not remove anything and not install XLivelessAddon until your game runs smooth and there was a reason for that. GTAIV.exe and EFLC.exe are RLD-patched in your repack. They expect RLD-patched xlive.dll and may not work stable with any other xlive.dll.
      So if you install XLivelessAddon you'll also have to install Rockstar stock binaries for the game to work correctly. https://support.rockstargames.com/articles/200145406/Grand-Theft-Auto-IV-Patch-7-Title-Update-v-1-0-7-0-English-1-0-6-1-Russian-1-0-5-2-Japanese

      This VRAM GTA thing is very tricky with dual GPU laptops.
      - You must explicitly specify -availablevidmem ... in commandline.txt and not rely on XLivelessAddon VRAMfix. If you don't do it your iGPU will be used instead of discrete one.
      After that check that game detects at least 2047 mb in Graphics Settings and run benchmark, it should have your GTX 980M in benchmark results.

      - Maybe you should also add d3d9.maxAvailableMemory = {N} to dxvk.conf to help the game use correct GPU.

      - You may try earlier DXVK builds or D9VK 0.30.

      Delete
    8. It does not happen with VSync turned off, but I'm not going to play it like that because I can't stand screen tearing.

      Delete
    9. The above comment was written by the RTX 3070 commenter.

      Delete
    10. If you need vsync so much and driver setting does not affect DXVK you may try vsync options in https://raw.githubusercontent.com/doitsujin/dxvk/master/dxvk.conf
      See
      dxgi.syncInterval
      d3d9.presentInterval
      dxgi.tearFree
      d3d9.tearFree

      Delete
  18. Hey there Anton, thanks for the guide. It took me some trying but I eventually got GTA IV to run pretty well with some nice graphically intensive mods and looking pretty using Vulkan, at least I think I did. GTAIV aside though. I would like to test other DirectX 9 games that can communicate with Vulkan. I already have the list but I am unable to distinguish if the API being used in a game is actually Vulkan or if it's DX9. I use MSI Afterburner, and it always tells me DX9 in use.GTA4, listed Vulkan but after I placed some mods in, it switched to DX9. Probably because of the shaders, however my performance was still good. Sorry for the ramble but if there is a chance I can play some old games and help the community with testing on lower end rigs, I would love to be a part of it. Thanks again!

    ReplyDelete
    Replies
    1. Apologies, but I have another question regarding mods and using the Xliveless addon. With the script-hook in my previous installation, I was able to install mods that change the handling and traffic routines. Two .asi files and two .ini files. No matter where I put them though, the game doesn't pick them up. Does this have to do with the Xlivelessaddon? Is there an additional step that I should take for this?

      Delete
    2. Big xlive.dll in XLivelessAddon is Ultimate ASI Loader. It alone should be enough, check that you have no other asi loaders like dsound.dll, dinput8.dll. It expects asi files in game folder or plugins or scripts subfolders.

      Delete
    3. If MSI Afterburner shows D3D9 it means your mod replaced d3d9.dll and Vulkan is not used for rendering. Depending on your mod it may have proxy library option or chainload option to load DXVK dlls.

      Delete
  19. I was right with my line of thinking then, however, there are no other asi's. No dsound, no dinput. I have tried putting these mods in the main directory and in the plugins directory where xliveless addon and fusion fix are located but still nothing. I did try with script hook just to check but obviously that didn't work. I appreciate you getting back to me, thank you.

    ReplyDelete
    Replies
    1. Well if your FusionFix loads OK (you have cutscene definition fix and fps limiters working) and if your XLivelessAddon loads OK (DLCs are activated) then your asi loader is fine and it loads your asi files but the problem may be with scripthook.dll that is incompatible with your game version.

      Delete
  20. Anton, thank you so much for the help. I didn't realize there was another version of scripthook. They new one I downloaded is running the scripts. I've got the game to run much better, however my OCD is making me tamper with it even further, lol. Do you have any ideas of how to utilize Vulkan on other compatible games? Even a point in the right direction of where I can start searching?

    ReplyDelete
    Replies
    1. You are welcome. You may copy DXVK dlls for DirectX version a game uses to game folder and try. Many games will work but not all will benefit from it. I tried DX9 and DX11 DXVK dlls trick with LA Noire and forcing needed DirectX version through game ini file and what I found is that native DX11 renderer works best for that game on low-end PC. Also there are modders who create game-specific Vulkan addons, there is one for Fallout 4. Search and you will find.

      Delete
    2. Alright, cool. You're a legend. Thanks a lot man and have a good one. :-)

      Delete
  21. This helped me out so much!! THANK YOU

    ReplyDelete
  22. Alright, so I gotta preface by saying this blog has been SUPER useful in trying to get best performance out of my GTA4 Complete Edition, the 1.2.0.43 version from Fitgirl, along with the Grand Theft Auto IV: Fixed Edition (NBPack) modpack(link below)

    https://steamcommunity.com/sharedfiles/filedetails/?id=2119440953

    This basically condensed the last week of working on this game into one pack that actually works really well together, which was a challenge I was haven't getting all of them together.

    However, when I try to use the DxWrapper, which has been the most successful method for me so far, it get a black screen when the game runs. It's still running and I can do stuff it, but can see nothing but a whole black screen. Tried fiddling with resolutions and checking parameters in the INIs for the various mods, but I can find no reason why the DxWrapper is blacking out the image.

    Everything else works fine otherwise.

    Specs:

    i7 4765t, 2ghz quadcore
    16 gb of DDR3 RAM
    Nvidia 860GTX-m w/2gb

    Can run the game smoothly(60fps aside from some stuttering) at 1080p and 1440p, 4K kicks my GPU in the dick xD

    ReplyDelete
    Replies
    1. Follow-up: I got DXVK working and the shader cache at least partly built but I'm getting a LOT of pop-in and framerate is down in the high 20s out and about the city. I'm guessing the shader cache needs longer to keep building before it really runs smoothly?

      Commandline:

      -rglLanguage=en-US
      -managed
      -reservedApp 0
      -availablevidmem 2000
      -norestrictions
      -width 2560
      -height 1440

      About to test this in 1440p with and without Vulkan.

      Delete
    2. Thank you, I am glad my blog helped. I don't think that your Algonquin fps drops are because of shader cache building. Possible causes are
      - your CPU is a possible bottleneck due to its low frequency and possible throttling
      - also 2 Gb of VRAM may not be enough for 1440p.
      You should not expect too much from your laptop in terms of GTA IV performance - stick to FullHD, reduce draw and detail distance, shadow quality and vehicle density.

      Delete
  23. Hello. Want to say thanks for this because the game works much better now for me.

    One more question if you don't mind. After the fix, the game takes much longer to load for me, like almost 2 minutes, while it was just about 10sec before the fix. I wonder what's the problem and how can I fix it? Thanks in advance.

    ReplyDelete
    Replies
    1. Well it is good to hear. What fix did you use? What game version? What hardware/OS?
      I noticed that graphics init sometimes does take longer with DXVK.

      Delete
  24. Should I use any of these with an Intel HD 530?

    ReplyDelete
    Replies
    1. OK I tried to use the DXVK method and it worked but after I rebooted my pc it stopped working, the game opens but i'ts only a black screen and then it closes after a few seconds, no error message. I can play if I delete the d3d9 and dxgi files though, any ideas what might be the problem?

      Delete
    2. It may be something with Intel Vulkan implementation. I only tested DXVK with AMD and Nvidia GPUs and have no access to Intel iGPU. You may try updating your driver https://downloadcenter.intel.com/download/29972 and running stardust_vulkan demo to see if it is installed correctly. More info
      https://community.intel.com/t5/Graphics/Vulkan-API-Support-Intel-Core-i5-6400T-and-Intel-HD-Graphics-530/td-p/405431

      Delete
    3. Well I already had the latest drivers and even the latest windows update so I just decided to try an older driver version and now it works! Maybe they changed something on the newest drivers. Thanks for the help man!

      Delete
    4. It is good to hear. What driver version you installed that is working? What is your CPU, what resolution/graphic settings and what fps do you have with DXVK?

      Delete
    5. -I installed the version 27.20.100.8681 https://downloadcenter.intel.com/download/29855/Intel-Graphics-Windows-10-DCH-Drivers
      -I have an i5-6400
      -I'm using 1280x720 and texture, reflection, water on high but shadows turned off. Texture filter on Tri-linear, the other settings i left them around 30 and definition on.
      -I get 40+fps even when driving and making chaos around the city. I could get more by setting all on low or medium but this works for me.

      Something important is that I have dual channel enabled so that really helps on IGPUs.

      Delete
    6. You are the first to my knowledge who managed to successfully launch DXVK with Intel iGPU. Smooth 40 fps at HD res with high textures is very decent for GTA IV. Thanks for the info and congratulations - enjoy the game!

      Delete
    7. I'm excited that the newest release Intel driver 27.20.100.9466 works with DXVK 1.8.1! No more downgrading the driver! https://downloadcenter.intel.com/download/30381/Intel-Graphics-Windows-10-DCH-Drivers

      Tested Intel Core i5-8500B / Intel Graphics UHD 630 benchmarks 45fps with GTAIV 1.2.0.43, Steam layer, only d3d9.dll file added, no commandline, 1280x720 and everything on Medium, Xbox 360-like settings. Looks smooth.

      Thanks for your blogging about this!

      Delete
    8. That is indeed exciting for Intel iGPU owners. Thanks for the heads up.

      Delete
  25. Hello, this might be the wrong place but can you send me original ext_veg.ide from pc\data\maps\props\vegetation? Because the one from FG Repacks is a leftover from old fusionfix that is also leftover from old version of Vanilla Fixes Modpack and it makes all foliage static

    ReplyDelete
    Replies
    1. You may find it here https://drive.google.com/folderview?id=1E9AWjRlHn0bV1sr683ExP4ZmV0CzKg_9

      Delete
  26. Man, you are fantastic. I applied all of this (dxvk method to my GTA IV patch 1.0.8.0, working like new, like in the old days when the game was meant to run on an 'older PC'), you rock bro! :D

    ReplyDelete
  27. where the heck can one find commandline.txt? you just write for people to post in commandline.txt but you dont say where to find it

    ReplyDelete
    Replies
    1. It should be in the folder where GTAIV.exe is. FitGirl repack already has it, for clean Steam version you must create it in Notepad. It is not required, all parameters you write in commandline.txt may be passed directly to GTAIV.exe.

      Delete
  28. I am using the Steam version and I after installing this, I can't use my Xbox One controller.

    ReplyDelete
    Replies
    1. Sorry to hear. I guess you can uninstall "this", submit a bugreport to developers of "this" and alternatively try "that" 8).

      Delete
  29. Hi, have you tried GTA 4 with DXVK with async patch?
    https://github.com/Sporif/dxvk-async

    It should improve GTA 4 performance in DXVK even more.

    ReplyDelete
    Replies
    1. Thanks for the heads up. This may be very useful to decrease lagginess during original cache creation and even smoother gameplay frametimes. I don't think it will have a revolutionary breakthrough in terms of GTAIV fps but I'll sure give it a try and if it improves fps dips in Algonquin I'll update the guide with this link and credit you.

      Delete
    2. I tried async patched DXVK on RX580 in identical Algonquin gameplay scenarios e.g. loading from the same savegame and following the same route. For async DXVK I added the following to dxvk.conf
      dxvk.enableAsync = true
      dxvk.numAsyncThreads = 16
      dxvk.hud = full

      GTAIV.dxvk-cache files were prebuilt before benchmark runs using lots of Algonquin driving, separate files were used for stock and async DXVK. As of now there is no significant fps/frametime difference except increased Graphics pipelines number. Even fps drops are the same, I think it is because of older RAGE engine inefficencies and more efficient renderer can't help with it. Anyway thanks for the link.

      Delete
  30. Hi, Anton.

    I myself use the dxvk method as my gpu supports vulkan and at the same time 99.99% of the game map is now completely stutter free for me using this vulkan renderer. The only area which is 0.01% where i still get a minor stutter is below Algonquin bridge. I own this game on steam. So i tried latest version 1.2.0.43 but still the same issue and then i tested both patch 1.0.7.0 and 1.0.4.0 but no luck.

    I found 1.0.4.0 patch very stable considering performance and i am currently using patch 1.0.4.0 with enb graphics, Sweetfx, road textures mod, car pack mod (only Lamborghini instead of infernus), RIL script to fix taxi bug, and i am running game at 4k DSR. I have also done some basic tweak in dxvk.conf also. Like setting maxframelatency to 1.

    My pc specs are as below :

    i7 5930k @4.5ghz, rtx 2070 super, 32gb quad channel ddr4 ram, windows 10 pro 1909 build, samsung 970 evo plus 250gb nvme ssd, corsair ax1600i psu.

    Now as i have mentioned earlier, i only get a 0.2 second stutter at a particular area which is below Algonquin bridge.

    My problem in detail : so basically i dont get any stutter on Algonquin bridge no matter what i do, i have stress tested Algonquin bridge where 6 star cops are chasing me and shooting at me and i am driving my Lamborghini at full speed then after not a single stutter @4k and i have installed sweetfx and enb graphics mods in which i'm getting 100% gpu load.

    At the area (0.01% of map) where i get minor stutter which is below Algonquin bridge and near water's edge and after the fishmarket south, one strange thing is that if i leave my car and get back into the car again immediately and 6 star cops are firing at my car and if then i drive then only this stutter happens for 200ms.

    On Algonquin bridge if i leave my car and get back in immediately and 6 star cops are shooting at my car and then i drive then also i dont get any kind of stutter.

    This weird stutter thing like leaving car and get back in and cops firing at my car only happens below Algonquin bridge which is also near water's edge and it comes after fishmarket south which i mentioned earlier Where cops' chopper explode by itself and cops are spawning at this area from the Algonquin bridge and i think somehow this area is buggy in terms of coding. Unfortunately i cant attach the images of this particular area here. But i think you got the idea.

    Another strange things is that if i dont leave the car and keep driving then never have any of the stutter issue even after cops are firing at my car in rainy whether also. I mean like in heavy stress also.

    But this strange stutter thing happens only at that particular place below Algonquin bridge where i leave my car and get back in to my car and cops firing at my car.

    I m using zolika1351's trainer to help niko to do all these crazy things.

    I m using vsync from nvcp and i turned off it in game.

    My view distance is : 21
    Detail distance is : 39
    Vehicle density is : 19
    Shadow density is : 0
    Clip capture : off
    Autosave : on

    And all other settings are maxed out.

    And i am using global nvida control panel settings as m using vulkan renderer and it has its own settings. And only thing i have changed in nvidia control panel is turned on the vsync.

    Plz give me suggestions, how to resolve this thing? I think most probably, u had also encountered this problem similar to mine.

    Thanks a lot bro.

    ReplyDelete
    Replies
    1. You should know when it is time to leave "good enough" alone as there's possibility it is an old RAGE inefficiency and nothing can be done about it. All I can say is don't drive below that bridge if the rest of the game is fine.

      Delete
  31. Okay, but have you noticed the same kind of stutters as i have mentioned in my comment?

    ReplyDelete
  32. This is the place where i get stutter:

    https://www.linkpicture.com/view.php?img=LPic6044360a0adae1002285921

    This is the image url of that location.

    ReplyDelete
    Replies
    1. I don't remember. I am currently away from my PC with rx580 but when I get back I will drive there and check that for you.

      Delete
    2. I found the place on the screenshot and what I have there in vanilla 1.0.7.0 with FusionFix is heavy fps drop into 40s or even 30s but no stutters or frametime spikes. I think it has something to do with hi-end nVidia GPUs + vsync. I am currently testing latest ZolikaPatch , it is said to fix ingame vsync with VSyncFix=1 in ZolikaPatch.ini so you may want to try it - disable vsync in drivers settings and enable it in game. https://gtaforums.com/topic/955449-iv-zolikapatch/

      Delete
    3. thanks for having a look in my concern. i will surely try it out.

      Delete
    4. i really appriciate your efforts, thanks a bunch once again.

      Delete
  33. Pretty much solved. Bro do you know how to read dxvk-cache file to see when the cache was created?

    ReplyDelete
    Replies
    1. I don't think DXVK stores timestamps inside the cache file, also I have no idea how to read this binary file. See file creation date in file properties in Windows Explorer.

      Delete
    2. Ok. I did the same thing that you have mentioned and i looked for date modified and date accessed in file properties to get the idea about last cache build time.

      Delete
  34. why the game instantly crashed with dxgi.dll but if you delete it, it works just fine. i'm using the latest version of dxvk ver. 1.8.1 and my game is ver. 1.0.7.0

    ReplyDelete
    Replies
    1. This file is needed for DX10 games and for DX9 to enum supported video modes in Linux.
      They made some changes in 1.8.1, it used to work in 1.7.x with dxgi.dll. I also noticed that the game works without dxgi.dll when tested SweetFX chainloading.

      Delete
    2. FYI I have no problems with dxgi.dll from DXVK 1.8.1 on Win10 20H2 and latest Adrenalin drivers, I also run 1.0.7.0. It may be something OS or driver specific on your end.

      Delete
    3. after some workaround i have it working by updating drivers, it less stuttering but the fps is stable at 30 to 40 fps at high medium settings, i'm expecting it to be 50 fps or more but i'll take it.

      Delete
    4. Good to hear. What are your CPU, GPU, OS, driver version that finally worked?

      Delete
    5. My specs: Ryzen 5 3500, Radeon Vega 8, Win 10 64 20H2, adrenaline 21.3.1. Do you have a compatibility list of mods that work with dxvk?

      Delete
    6. 40 fps looks OK, Vega 8 is slower than GTX 750Ti. Any mod that does not replace d3d9.dll should work. FusionFix works.

      Delete
  35. Hi Anton, when i try to use the DXVK i get this error whenever i launch the game: https://prnt.sc/119uq2q Do you know about this issue? I use FitGirl's Complete Edition 1.2.0.43v.

    ReplyDelete
    Replies
    1. It means the game cannot initialize video mode.
      Delete SETTINGS.CFG in %LOCALAPPDATA%\Rockstar Games\GTA IV\Settings

      What you may also try if the above did not help
      - in Compatibility tab for GTAIV.exe set "Windows Vista (sp2)", uncheck run as admin, Disable fullscreen optimizations.
      - in commandline.txt add -windowed
      - try chainloading DXVK through SweetFX

      Delete
    2. I've tried everything you suggested but still i got the same error. Only when i chainloaded DXVK through SweetFX i got in the game but DXVK wasn't in use as i was using D3D9. Thank you for your helps anyway.

      Delete
    3. Hey Anton, my problem was something about my driver. I realized that i had severe issues lately with RDR2 same as GTAIV and found out that i use Vulkan on both games. I disabled my Vega GPU then re-enabled to solve the problem on RDR2 i tried the same again for GTAIV and voila i can now run DVXK. For the record i was getting this error code at logs:

      warn: DXVK: No adapters found. Please check your device filter settings and Vulkan setup.

      Delete
    4. Glad you managed to launch DXVK. In general it is a good idea to download and try different (maybe older) versions of GPU driver.

      Delete
  36. Hi, how to disable creation of log files? Adding line "DXVK_LOG_LEVEL=none" in dxvk.conf did nothing.

    ReplyDelete
    Replies
    1. Пробовал, не работает...

      Delete
    2. Я уточнил, это не директива dxvk.conf, а переменная среды т.е. её нужно создать, присвоить значение none и перезагрузиться на всякий случай.

      Open the Start Search, type in “env”, and choose “Edit the system environment variables”:
      Click the “Environment Variables…” button.
      Set the environment variables as needed. The New button adds an additional variable. ...

      Delete
    3. Спасибо! Логи больше не создаются.

      Delete
  37. Hey Anton, Im about to try this DXVK method, but I would like to also use an ENB mod. Since ENB uses d3d9.dll, how do i pair the two? How to install DXVK on an existing ENB installed? Thanks! GTA IV downgraded to 1.0.7.0., with this ENB: https://www.lcpdfr.com/downloads/gta4mods/misc/5773-vision-v1-enb-105-final/

    ReplyDelete
    Replies
    1. I do not use ENB but it may be done through proxy option http://enbdev.com/doc_proxy_en.htm
      https://stepmodifications.org/wiki/Guide:ENBlocal_INI/Proxy

      In some cases this option is already taken by some ENB helper dll and in general it is problematic to chainload more than one helper dll. You may have to turn off system file protection and put ENB d3d9.dll into system folder - it will replace system d3d9.dll - and put DXVK d3d9.dll into GTAIV folder. ENB author claims it may work but I did not test this. I can't help more than that. If you find a reliable method that allows to load ENB + its helper dll + DXVK dll please let me know.

      Delete
  38. Hi Anton,

    Thank you for posting the fix that I needed from so many days. The game works fine now for me and I have also set up the SweetFX as instructed by you in another post.

    However I am facing an issue here. The game starts at 800*600 resolution now. I have to modify it in every run to 1080p resolution. Please help me in fixing it.

    ReplyDelete
    Replies
    1. This may happen with DXVK. You may add explicit parameters
      -width ... -height ... that will force needed resolution into commandline.txt

      Delete
  39. Hi Anton, I fixed the problem but noticed that there is a lot of stuttering now at some places. Its been more than the Vanilla one. I have a 1050ti and the draw distance,density etc. is all set at 50. Shadows are set at high and Night Shadows are OFF. Please advise on how to fix this issue.

    ReplyDelete
    Replies
    1. Read comments above, if all else fails use 1.0.7.0 with default D3D9, it should be pretty smooth with later drivers. I can't help any more than that.

      Delete
  40. Hello Anton. I tried your methods for making DXVK. The method works like it should with a but stuttering at first then when I launch it next time it has no stutter or fps Drops. But my Issue is now that the game's FPS is locked at 57 Fps. I used a FPS counter and the reason the game still didnt feel smooth was because its LOCKED at 57 FPS. My 1040 INSTALL still feels smoother because of this. Pls help

    ReplyDelete
    Replies
    1. It is with deep sorrow that i say that Anton, even though your guide is amazing. DXVK didnt work as silky smooth for me on 1080 Patch. Without sweetfx and anything the game drops fps when looking around and during explosions and gun fights. Im and sick and tired of this performance now. The game only runs amazing on GTA Connected. Guess i have to play on 1040 patch for SP. :(

      Delete
    2. My advise for anyone would be to just use Patch 1040 with ZolikaPatch. Fuck the shadows. Ignore em.

      Delete
    3. Well at least you tried. I have very slow startup on 1.0.4.0 with DXVK with or without SweetFX on my Athlon X2 PC with gt730 though I can't complain about performance once the game is started. The strangest thing is 1.0.6.0 or 1.0.7.0 with FusionFix start very fast and work OK. On my newer rx580 PC both 1.0.4.0 and 1.0.7.0 work OK and I prefer enhanced shadows on Very High even if they drop fps significantly. So there is no hard and fast rule, each PC is different and it is a matter of preference. Use whatever works for you.

      Delete
    4. Yeah man. Thanks again for your guide which you made so generously for us. Your downgrading guide helped me play PATCH 1040 thanks a lot bro

      Delete
  41. Hi Anton, I have enabled DXVK for GTAIV and good news is it does run much better than I remember it running back in the day. However the game seems to be locked at 60 fps on my 144hz monitor which is recognised by the game as 2560x1440 @ 144hz in the settings. I have vsync off and no external framerate limiter all other games run at over 60fps. Do you know how I might be able to unlock fps as my eyes are spoiled by 144hz and 60 hurts my eyes.

    ReplyDelete
    Replies
    1. Disregard this, the fitgirl repack was limited to 59fps by default for game stability reasons.

      Delete
  42. hi i have
    ryzen 5 3550h with vega 8 intergrated graphics
    gtx 1050 3gb vram
    2 x 8GB 2666mhz ram
    latest drivers installed and everything

    whenever i try to use dxvk with gta iv the game comes with dd3d30 error code please suggest fix

    ReplyDelete
    Replies
    1. There's no exact fix for this and no exact explanation why it happens. It may occur occasionally on a fresh game install although previous game install ran just fine.
      Delete SETTINGS.CFG that stores graphics settings and power off and restart your PC.
      What you may try:
      - older driver
      - older DXVK build
      - with or without dxgi.dll
      - experiment with Vista or XP sp2 compatibility mode
      - experiment with availablevidmem
      and hope that something will fix it.

      Delete
  43. Alright, so I have a intel core i7-9750h and a rtx 2070 (playing on a laptop btw) and Weird thing is I found out that I have a smoother and more fps when using dxwrapper even though dxvk in here saying that it silky smooth, I have run the game with dxvk for about an hour now. and the fps hasn't much improved (at least compared to dxwrapper) the cache of dxvk is around 191 kb. Now, my question is does dxvk is better than dxwrapper?

    ReplyDelete
    Replies
    1. I mean, does dxvk work properly since I have a smoother experience when using dxwrapper?

      Delete
    2. p.s I also use icenhancer natural which leads to a proxy library to d3d9.dll from dxvk.

      Delete
    3. I don't know why DXVK works as it does in your case - there are too many variables in the equation e.g. hardware config and cooling, OS, GPU driver, nVidia specific monitor sync settings, game settings. What I know is that even 2020CE is silky smooth with DXVK 1.9 on my RX580 with latest driver. There are no stutters, frametime graph is virtually flat and it is a joy to play. Use whatever works for you. For me DXVK works best but YMMV.
      You should test wrappers on vanilla game. I wrote ENB with DXVK guide but there's no guarantee that it will work in each case as it works in mine https://ant-sh.blogspot.com/2021/05/enb-with-dxvk-for-gta-iv.html

      Delete
    4. Maybe because of different vga? i don't know. so i have another question, what does the dxgi file in dxvk do? fitgirl seems to include this file in the _wrappers but after I saw this post i'm contemplating on not to do it.

      Delete
    5. i also find out yesterday when swapping between dxvk and dxwrapper that the game actually wont run with dxwrapper if there's dxgi file from dxvk is present, so it seems that the game actually does load the dxgi file, though I'm curious though because d3d9 file from dxvk and the dxgi has a different file size...

      Delete
    6. also about dxvk should i disable -nomemrestrict when using -managed command?

      Delete
    7. Dxgi.dll was in original DXVK reddit post and from there it propagated to numerous guides. It is needed on Linux to enumerate video modes. Apparently system dxgi.dll on Windows is enough and DXVK's dxgi.dll is not needed for DirectX 9 GTA IV.
      -nomemrestrict and -managed are better together but need lots of RAM. On my 3Gb RAM PC I do not use -nomemrestrict as it increases probability of crashes due to memory allocation errors.

      Delete
  44. I've reinstalled the game several times over the last week, and I think I finally have it in a really good spot. Your posts have been invaluable, thank you so much!

    ReplyDelete
    Replies
    1. You are welcome. Please share your setup and how you are running it.

      Delete
  45. Hey man, I love this so much, it's incredible how GTA IV can perform. I only have two little issues and would like to ask for your help, I couldn't find anything on the problem.
    When using the complete edition, sometimes the game is stuck on the disclaimer screen and I have to kill it trough task manager. I don't know why it happens sometimes and sometimes don't. It's quite annoying and I can't fix it. When I make it into the game, anything is fine.

    On patch 1.0.4.0 I have a different problem with the resolution: I have a WQHD monitor and to get rid of IV's aliasing I use Nvidia DSR to get 5120x2880 resolution. When I start the game after a second it minimizes to the taskbar and I cannot get it out of the background. When I click on it, it just minimizes again and again. When I start on 2560x1440 and want to change the resolution later in game I can't, because DXVK broke the resolution slider. My "workaround" is to force the game to start in windowed mode, which works fine but is ugly. The 5120x2880 resolution works fine without DXVK on CE and 1.0.4.0.
    My specs: Windows 10, RTX 2080, i5 9600K, 16GB RAM, HP Omen 27 monitor. What I tried to do: disable/enable fullscreen optimizations (doesn't help or the game does not start at all on 1.0.4.0), kill any running punkbuster services (PCgamingwiki lists this as possible fix for game in background, didn't help) I am at my wits end, I just want to enjoy GTA IV in high resolution AND with better performance. Any help would be very much appreciated!

    ReplyDelete
    Replies
    1. I may add that it doesn't help to add -width 5120 -height 2880 -fullscreen parameters, just stays in the background as stated above. The game apparently refuses to show up in this resolution when using DXVK

      Delete
    2. If you use DSR in fullscreen mode
      1. Remove -windowed from commandline.txt
      2. Disable BorderlessWindowed everywhere
      https://steamcommunity.com/app/12210/discussions/0/5879990700812309822/

      Delete
  46. Unfortunately this doesn’t help. In Patch 1.0.4.0 it doesn’t work with -fullscreen or without -windowed. Borderesswindowed is and was disabled, still no luck.
    Also just now I have the other Problem in the complete edition as I described above: it is stuck on the disclaimer screen and has to be killed through task manager.

    Thanks though for taking your time to answer, I would still very much like to solve this

    ReplyDelete
    Replies
    1. It may be something DSR specific. I use AMD's VSR with DXVK and game 1.0.7.0 in Graphics menu detects and can select virtual resolutions. Maybe another version of driver may help. Also try chainloading DXVK through SweetFX. Try with or without dxgi.dll from DXVK.

      As for game stuck on disclaimer screen it was a common GTA IV problem with older versions which XLivelessAddon fixes. I don't know a reliable fix for 2020CE apart from downgrade.

      Delete
    2. I strongly suggest to do a safe mode boot + DDU, then reboot and reinstall GPU driver. 1.0.4.0 has different graphics init routine and I think you need to try a 1.0.7.0 downgrade with XLivelessAddon on a separate copy of your 2020CE folder. Don't give up just yet.

      Delete
    3. I don't know what exactly did the trick but it's working now. As my comment on your other blog gives away, I created both a portable 1.0.4.0 and 1.0.7.0 version downgraded with your tutorial as well and with this it worked. I can play both versions with 5120x2880 through DSR with DXVK working too. On startup the game still wants to minimize and when it does that, it doesn't load up BUT I managed to "work around" this by clicking on the black startup screen like a madman after double-clicking portableiv.bat and I guess by this I force the game to stay in foreground. I can stop clicking after a few seconds when the loading screen appears (using skipintro and skipmenu from XlivelessAddon). I'm quite happy with this.

      For the complete edition it is working now as well with 5120x2880 and DXVK. I deleted and reinstalled d3d9.dll a few times and restarted the PC several times and now it works. Will not be touched anymore as long as it works. Seems to be a question of pure chance to me, but to hell with it, as long as it works. Thanks for your help and patience!

      Delete
    4. Hooray! I am glad you got it working.

      Delete
  47. All method doesn't work on my GTX 1650 mobile with 1.0.7.0 game version (except DXVK), i hope DXVK will work

    ReplyDelete
  48. I have a suggestion, maybe you could add an information to your blog, which would have really helped me, if I wouldn't have had to figure it out myself. With your help, I got DXVK to work on different patch versions, but I noticed a problem on CE, which I launched through steam: It didn't create a shader cache file in the GTA IV folder. It actually did create a shader cache, but hidden somewhere in steamapps/shadercache/GameID/... Apparently DXVK couldn't read it from there, so the game stuttered every launch. I deleted that cache file and in the steam options disabled vulkan shader caching. After that, the DXVK shader cache file was created in the GTA IV folder and now it is not stuttering anymore after reloading the game! I thought this might be helpful for others :)
    Thanks

    ReplyDelete
    Replies
    1. I received similar report a while back on reddit
      https://www.reddit.com/r/GTAIV/comments/hqbsli/comment/g79lyt3/
      but it is you who found the way to disable Stean's redefinition of DXVK_STATE_CACHE_PATH. I don't own the game on Steam and that's why I never had this problem. I will add this to the DXVK method crediting you. Thanks! You are a truly helpful contributor to my blog and the GTA community.

      Delete
  49. Приветствую Антон! Есть проблемка, может сможете подсказать что-нить...
    Тут стена текста, увы, но я пытался все поподробнее описать.
    Итак, до начала сентября сидел на LTSC винде с самого 2019 года. Использовал FullHD 144 Гц фрисинк монитор и DXVK (который часто обновлял). Использовал DSR 4K (GTX 1060 6 гб), консольные настройки бегунков и все было прекрасно, получал гладчайший фреймтайм и 45-60 ФПС и был счастлив. Версия игры - 1.0.7.0
    commandline:
    -availablevidmem 6000
    -managed
    -width 3840
    -height 2160
    -refreshrate 144
    -reservedApp 0
    -percentvidmem 100
    -norestrictions
    -nomemrestrict

    Но в этом месяце пришлось сменить винду ( Поставил Windows 10 Enterprise 21H1 19043.1237 (сначала была версия чуть ниже, но поставив все последующие обновления проблема не исчезла). Драйвера видео тоже последние, как и DXVK.

    САМА ПРОБЛЕМА:
    Теперь, если играть на родном 1080p - все работает чудесно - и фрисинк и Вулкан, гладкий фреймтайм, 60 фпс.
    Но как только разрешение хоть немного выше родного (DSR 1.20x, 1.50x, 1.78x и тд) уже в меню фреймтайм вместе с ФПС жутко колбасит, при чем по четкому, повторяющемуся паттерну (см скрин и обратите внимание на VRR - фрисинк точно работает).
    Что я только не пробовал: Vsync вкл/выкл, разные ограничители кадров* типа RTSS или плагины (работают странно, см ниже), Полноэкранные оптимизации для gta4.exe вкл/выкл, dxvk.conf удалял, плагины удалял, совместимости с Вин7 ставил, перезагружал комп, перезапускал драйвер видео через CRU. Все xbox'ы и геймбары поотключал, в commandline удалял все, кроме разрешения. Ничего не помогло, кроме возврата на 1080р.

    Дальше - удаляю DXVK - игра в 4к работает с фрисинком отлично (не считая того, что сама оптимизация кривая как всегда).
    Возвращаю DXVK и отключаю фрисинк - ровные 60 кадров в меню 45 - 60 в игре, стабильный фреймтайм с небольшими и непостоянными микрофризами (но естественно без фрисинка не так комфортно).

    Есть подозрение, что проблема в самой винде, ибо в некоторых играх (Cyberpunk2077, например) тоже есть проблемы с фрисинк+DSR. Но если в КП2077 фрисинк просто перестает работать (частота обновления перестает меняться), то в ГТА4 фрисинк РАБОТАЕТ, но происходят скачки по паттерну, что я показал на скрине. Именно такая проблема - только в ГТА4. Тестил еще XCOM2 и Dark Souls Remastered фрисинк+DSR - все работает чудесно.

    Еще небольшая инфа, если поможет. После смены винды начались проблемы с фрисинк вцелом. Раньше я отключал все Vsync, локал фпс на 142 и запускал Pendulum DEMO - все было плавно.
    Но теперь чтобы все было плавно и без рывков нужна свистопляска для каждой игры: Отключить полноэкранные оптимизации и включить Fast Sync. Только тогда фрисинк будет плавным и работать корректно. Но не везде, видимо.

    * Про ограничители кадров в ГТА4. При моей проблеме они работают следующим образом. Использую лок на 60фпс - фпс скачет 45 - 50 кадров и не превышает 50 кадров. Решив, что комп не тащит игру в 4К локнул на 40 - фпс скачет 35-37 О_о Какого...?

    Вобщем беда, вот уже 2 недели бьюсь со всем этим и не пойму почему все стало таким геморным. Может сервис какой вырубить нужно? Или галку где-то поставить? Связана ли глобальная проблема фрисинка с DXVK или она сама по себе?
    Я хочу именно ГТА4 починить, но возможно это поможет понять и глобальную проблему с фрисинк.
    Надеюсь дал достаточно инфы, дабы натолкнуть на идею. Готов предоставить любые скрины, тесты и т.д.

    Скрины (в игре фреймтайм и ФПС точно такие же как и в меню)
    https://drive.google.com/drive/folders/1AY-Oroz9wnT0gr30OxM_mIja_vlniuTc?usp=sharing

    ReplyDelete
    Replies
    1. Спасибо за доверие, но я не какой-то гуру. В данном случае это выглядит как наложение двух проблем - sync-related и DSR на фоне изменений в ОС и драйвере. С DSR nVidia могут быть проблемы даже просто запустить игру, как в коменте MiesThies выше. Я посмотрел ваш скриншот и могу посоветовать следующее:
      - Поэкспериментируйте с -availablevidmem ... чтобы игра определяла как минимум 2Гб видеопамяти. https://ant-sh.blogspot.com/2020/09/easy-downgrade-gta-iv-to-1040.html#_Toc50220895
      - отключите везде BorderlessWindowed
      - уберите некритичные параметры -refreshrate ... -reservedApp 0 -percentvidmem 100
      - попробуйте другую версию/и DXVK например 1.7.3, с или без dxgi.dll из поставки DXVK.
      - Попробуйте другую версию драйвера видеокарты
      К сожалению, у меня нет freesync/gsync монитора и с VRR я не знаком так что ничего более конкретного не могу посоветовать.

      Delete
    2. Почитайте это, может это имеет отношение к вашей проблеме https://github.com/doitsujin/dxvk/issues/1831#issuecomment-755074994

      Delete
    3. Снова привествую! Я не ожидал чудес, надеялся, что сможете увидеть то, что не увидел я ) Но похоже так и случилось!
      Все ввышеуказанное вами я перепробовал - ноль результата.
      Однако прошерстив все-все коменты в указанной вами и связанных темах на гитхабе я решил заняться вопросом проблемы с самим монитором. В комментах советовали проверить связанные с монитором настройки в биосе. В моем случае мать Gigabyte а настройка назыввется Initial Display Output. Я весь биос облазил и не нашел такой О_о Погуглив оказалось, что я такой не один и человеку поддержка посоветовала обновить биос. Я обновил и настройка появилась. И все заработало как надо! Само значение настройки, похоже, никак не влияет (у меня два моника на одном ПК), видимо важно только наличие этой самой опции.
      Это все очень странно, буду следить, но все теперь очень плавно в 4К с фрисинк, как и было раньше )
      Так что благодарю, что уделили время и подсказали важную инфу!
      Если ситуция изменится или опровергнется - обязательно дам знать.

      Delete
    4. Ваша ситуация с биосом и то, что вам удалось всё завести - это higher level troubleshooting shit right there! Рад, что удалось дать верную наводку, я ещё было подумал на HAGS который появился в винде в билде 2004 https://github.com/ThirteenAG/GTAIV.EFLC.FusionFix/issues/27 , но все заслуги в решении проблемы ваши. Спасибо за то, что запостили решение.

      Delete
  50. Hi, thanks for your tutorial. I followed the steps for the dxwrapper method, but I can't edit the file dxwrapper.asi. How can I edit it? Thanks

    ReplyDelete
    Replies
    1. Edit dxwrapper.ini, it is a text file. Asi file is binary and should not be edited.

      Delete
  51. Приветствую! Немного оффтоп, но возможно будет интересно для статистики применения DXVK.
    Решил наконец-то поиграть в Far Cry 3. Комп у меня все еще достаточно могуч, так что выкрутил все, что можно, да еще и DSR накрутил. Выглядит все в целом хорошо, кроме 2х моментов: статтеры (при очень высоком фпс) и глючные мерцающие тени (особенно расстраивают).
    Если без DXVK игра статтерит на ультрах при 1440 с просадками на ДХ9 и ДХ11, то с DXVK выдает 70 кадров вплоть до 3К и работает плавнейше! Правда только с ДХ9, ДХ11, увы, выдает черный экран, хотя звуки меню и заставок присутствуют.
    Так что производительность чинится очень хорошо.
    А вот тени, увы, все такие же глючные. Вроде это распространенная проблема, есть у многих юзеров, но решения, кажется, не существует (мнооого всего перепробовал). Видимо у игр юбиков есть традиция портится со временем (привет SC:PT!) : )

    ReplyDelete
  52. Hi Anton. Again, thanks for your tutorial and sorry to ask something again. I couldn't make neither the dxwraper method or the DXVK method to work. With both of them I get a black screen at the beggining and the only thing I can do is forcingt to shut down my PC by pressing the "on/off" button, I don't know why. I think I followed every step right.
    Maybe it is because I have an integrated graphic cards and my specs are not that good. (i5 11°gen, intel iris Xe, 8gb ram)
    Hope you can help me. Thanks a lot beforehand

    ReplyDelete
    Replies
    1. Hi Xavier, I don't have a CPU eith an integrated GPU so I can only give you general troubleshooting guidelines:
      - Remove all wrappers, clear commandline.txt and check if vanilla game runs OK in default D3D9 mode. Note Resource Usage in Graphics menu. If it runs put d3d9.dll from DXVK back into game folder.
      - Try removing and reinstalling latest Intel driver for Iris Xe. If game still doesn't run in Vulkan mode try installing earlier version of the Intel driver. Look above in comments for link to Intel driver working with UHD integrated graphics.
      - If it still does not run try older DXVK versions 1.7.1 or 1.8
      - if game works in Vulkan mode see Resource Usage in Graphics menu and if it is low and has red warning experiment with -availablevidmem ... in commandline.txt
      If you tried everything and it still doesn't work with DXVK then you have some special sort of OS/driver incompatibility and you may consider downgrade to 1.0.4.0 using my guide here and running it in d3d9 mode. Your CPU should handle it OK at 30-40 fps with reduced shadows and draw/detail distances.
      What game version do you have?

      Delete
    2. Thanks a lot for your answer, I will try it tonight.
      I have the complete edition on steam and the 1.0.7. version.
      After I downgraded, I had to add the commandline.txt because I couldn't change the resolution on game. With only the downgraded version and no DXVK method, the game runs kind of poorly, at 20fps average I'd say.

      Delete
  53. For some reason when I want open the exe after turning on the PC, I get fps dips and the game feels weird. The problem disappears when I relaunch the game again but reappears if I shut off or restart my PC. It's pretty annoying, any fix? I already used dxwrapper and dxvk but the problem persists.

    Patch guide used:https://www.youtube.com/watch?v=ObvIv5Q-8zU&t=1019s&ab_channel=catsmackaroo

    Video of the problem: https://www.youtube.com/watch?v=SjE2m_K7pGI&ab_channel=asafall

    ReplyDelete
    Replies
    1. Hi {unknown set of pixels displayed on my screen, whoever you might be}. It looks like stuttering but fps alone does not tell much in terms of the cause if the problem. I need at least
      - your specs (CPU, RAM, GPU and driver, OS), game version and how/from where you launch it
      - 2 videos (first is when you experience the problem and second is when game runs OK without the problem) with full MSI Afterburner CPU & GPU load and temperatures, fps and frametime graphs in overlay something like this https://youtu.be/WcTZ6kekEWQ
      Don't forget to open Graphics menu.
      Get MSI Afterburner and latest RTSS beta (it works OK on Windows 11) from guru3d.com

      Delete
  54. Apologises for long wait
    1.
    CPU: AMD Ryzen 5 3400G
    RAM: 32GB
    GPU: Nvidia Geforce 1660 Super
    Driver version: 496.13
    Windows 10
    2.
    Game performance after booting up PC:
    https://www.youtube.com/watch?v=6TPEBEi5uKw&ab_channel=asafall
    Game performance after second launch:
    https://www.youtube.com/watch?v=fRhfaLvfB2w&ab_channel=asafall

    ReplyDelete
    Replies
    1. I'm using 1.0.7.0
      From PlayGTAIV.exe

      Delete
    2. I see that your GPU is underutilized and cold in both cases. In 1st run you get 20-25% GPU load in Broker, on 2nd run you get 30% GPU - that's why it shows less stutter. Your PC is OK and when properly utilized you should have better performance than I have on RX580. I think it is an OS/driver issue but let's try to remove bad game/downgrade as possible source. Create separate pristine copy of vanilla game and up/downgrade it to 1.0.4.0 with settings in its own subfolder as per the guide here. Repeat 2 benchmark runs, use Algonquin safehouse and avenue near Libertonian.

      Delete
    3. GTA IV Patch 1.0.4.0 videos
      First exe Launch: https://www.youtube.com/watch?v=lqXyR-xj5Ps&ab_channel=asafall
      Second exe launch: https://www.youtube.com/watch?v=othrLma4zQg&ab_channel=asafall
      Problem still persists

      Delete
    4. So now we know it is not the game

      patch 7 broker
      1 cpu 35% gpu 20%
      2 cpu 25% gpu 30%

      patch 4 alg
      1 cpu 50% gpu 20%
      2 cpu 35% gpu 30%

      Looks like on the first run some other process steals CPU cycles from the game. To make sure it is not antivirus turn it off and add your game drive to exclusions list. I am currently away from PC and I will think of a reliable way to detect if some other process loads CPU.

      What can be done meanwhile
      - start GTAIV.exe with above normal or high process priority to prevent stealing its CPU cycles by other process. From command line or bat file
      start /abovenormal {path\to\GTAIV.exe}
      See if it improves anything.
      - do safe mode boot, DDU, reboot, GPU driver reinstall. See if utilization/fps improves.
      - physically unplug or disable all wireless and wired controllers, gamepads, joysticks or other HID devices you might have. If you have vJoy virtual device installed disable it. Try running the game using kb&m only and see if utilization/fps improves.
      - enable DSR and try 1440p or 4K superresolutions. See if utilization/fps improves as it turns out underutilization with nVidia GPUs is common with this game
      https://youtu.be/eisdLwou7vk

      Delete
    5. I think I found the process stealing GTAIV's CPU cycles.
      I looked at Task Manager after restarting PC and found that "Service Host: Local System" uses 15-18% of my CPU Usage. GTA IV then starts to stutter.

      After waiting for 5-6 Mins, System Host: Local System no longer uses my CPU and GTAIV starts to run much better without having to relaunch the exe.

      Seems like I need to find a way to stop the process from hogging my CPU at PC startup.

      Delete