terminatorul / NvStrapsReBar

Resizable BAR for Turring GTX 1600 / RTX 2000 GPUs
MIT License
556 stars 12 forks source link

GPU-side ReBAR Configured without PCI confirm (0x0300000000000082) #29

Open eurano opened 8 months ago

eurano commented 8 months ago

System

Bez tytułu2

xCuri0 commented 8 months ago

Probably because you haven't removed the ReBarUEFI module

eurano commented 8 months ago

[Uploading Z97Ex9_2_nvstraps_16GB.zip…]() @xCuri0 Thank you for quick response but how do i remove it? Should i use [Z97Ex9DSDTFIXED.zip] (4.4 MB) bios you made for Prazola wich only allow me to enable 4g and add nvstraps to that bios and flash it and then set strap using NvStrapsReBar.exe ?

EDIT: I removed RebarDxe from bios using UefiTool and flashed bios again but i still got same: UEFI DXE driver status: GPU-side ReBAR Configured without PCI confirm (0x0300000000000082)

I have dedicated sound card in one of the PCI slot x16 mounted below 2080TI (x16 slot) is it possible that this card is preventing changing ReBAR with NVStrapsReBar.exe?

I dont understand why Prazola could enable Rebar with same BIOS and i cant and we have same motherboard model.

xCuri0 commented 8 months ago

@eurano try patching a clean bios instead of trying to edit this modified one

sound card shouldnt affect anything

eurano commented 8 months ago

Im trying to follow instruction from - > https://github.com/xCuri0/ReBarUEFI I cant modify Asrock vanilla bios because it wont let me flash it (some security error) thats why i downloaded Prazola bios from his first post. It doesnt have ME so i guess this is some kind of bypass. Anyway i tryed DSTD patch patches.txt however when i extracted dsl file and opened it with notepad i cant find "CreateQWordField". I found something like this wich is quite simillar:

            CreateDWordField (BUF0, \_SB.PCI0._Y0E._MIN, M1MN)  // _MIN: Minimum Base Address
            CreateDWordField (BUF0, \_SB.PCI0._Y0E._MAX, M1MX)  // _MAX: Maximum Base Address
            CreateDWordField (BUF0, \_SB.PCI0._Y0E._LEN, M1LN)  // _LEN: Length
            M1MN = (TLUD << 0x14)
            M1LN = ((M1MX - M1MN) + One)
            Return (BUF0) /* \_SB_.PCI0.BUF0 */

What i should do ?

xCuri0 commented 8 months ago

@eurano read the dsdt patching again.

you're doing the wrong one not for asrock haswell

terminatorul commented 8 months ago

@eurano Can you update the source code at this line, and build the DXE driver ?

https://github.com/terminatorul/NvStrapsReBar/blob/master/ReBarDxe/ReBar.c#L70

uint_least32_t getReBarSizeMask(UINTN pciAddress, uint_least16_t capabilityOffset, uint_least16_t vid, uint_least16_t did, uint_least16_t subsysVenID, uint_least16_t subsysDevID, uint_least8_t barIndex)
{
    uint_least32_t barSizeMask = pciRebarGetPossibleSizes(pciAddress, capabilityOffset, vid, did, barIndex);

    /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
    if (vid == PCI_VENDOR_ID_ATI && did == 0x731fu && barIndex == PCI_BAR_IDX0 && barSizeMask == 0x7000u)
        barSizeMask = 0x3f000u;
//  else
//      if (NvStraps_CheckBARSizeListAdjust(pciAddress, vid, did, subsysVenID, subsysDevID, barIndex))
//          barSizeMask = NvStraps_AdjustBARSizeList(pciAddress, vid, did, subsysVenID, subsysDevID, barIndex, barSizeMask);

    return barSizeMask;
}

Modify the line with PCI_VENDOR_ATI and:

You can see the next 3 commented lines, where I tried to do the same thing in a more automated way, but in the meantime I have deleted the functions used for this, as my motherboard started to work fine without them .... I don't know why. My functions are still present in git history, just one or two commits ago, if you want to search for them

eurano commented 8 months ago

@terminatorul yes i will try

@xCuri0 yes i read wrong section but after pasting correct one and using .\iasl DSDTMod.dsl command in shell i have 9 errors wich i cant fix mostly Missing dependency ^ (Device object requires a _HID or _ADR)

I think i will just load your working BIOS for Prazola again because its too hard for me to make it myself. I will try to use @terminatorul solution for now.

My DSTDTMod.dls file -> https://file.io/jA9Q5nhfFwG3

eurano commented 8 months ago

@terminatorul I edited code but cant compile project in Visual Studio 2022. I have no idea what error it is. Google result suggest its some kind o issue with IDE and c++ 23 but i didnt manage to fix it.

image

terminatorul commented 8 months ago

Can you follow the build instructions that are linked from the main project page ? And b uild from the command line ?

terminatorul commented 8 months ago

@eurano After a better look at the source code, you can achieve the same effect without changing source code or flashing the motherboard, if you just use value 64 instead of 14 for PCI BAR size.

Any reason you used 14 in the first place ?

eurano commented 8 months ago

@terminatorul Im in the middle of building nvstraps I used 14 in @xCuri0 ReBarState and for some unknown reason i though both values should match

eurano commented 8 months ago

@terminatorul Ok so i did the following: 1) downloaded BIOS @xCuri0 prepared for Prazola wich worked for same motherboard (4g enabled) file name = Z97Ex9PciBusFix.zip (4.4 MB) https://winraid.level1techs.com/t/request-above-4g-decoding-for-asrock-z97-extreme-9-and-asus-p8p67-evo/89575/86?u=eurano 2) used uefi tool to add new nvstraps (i compiled new code you posted above) to modify BIOS described above 3) flash bios 4) reboot 5) in bios disable CSM and secure boot 6) use GRUB method (win10 bootable usb) to use command "setup_var 0x1 0x0" 5) reboot 6) use GRUB method (win10 bootable usb) to use command "setup_var 0x1 0x1" 7) run ReBarState.exe to set variable to 14 8) reboot 9) run NvStrapsReBar,exe i compiled earlier and put E, P , 64 , S , Q 10) reboot

Unfortunently the result is the same. GPU-side ReBAR Configured without PCI confirm (0x0300000000000082)

First thing i noticed is that unmodified current bar size is 128mb and after 256mb so maybe thats this GPU limit? Do you guys know what else i can try? Maybe removing my sound card and try again? :( Second thing that bothers me is that Prazola screenshots shows that there is difference between our pci memory range.

image

Bez tytułu

terminatorul commented 8 months ago

The screenshot shows you manually configured GPU bar size to 64 GiB, any reason for you to do that ?

terminatorul commented 8 months ago

Any reason you need both ReBarUEFI and NvStrapsReBar ? Can you set ReBarState to 0 in ReBarUEFI ?

terminatorul commented 8 months ago

Can you also show the output of from "Show DXE driver configuration" (option W) ?

terminatorul commented 8 months ago

Can you show output from IFR-Extractor ? Is the byte offset 0x1 correct for your Above 4G Decoding option ?

eurano commented 8 months ago

@terminatorul setting ReBarState to 0 didnt change anything i tryed :( yes the byte offset is correct (4g is enabled now)

Got frustrated and tryed random settings :( I think i dont fully understand how to use this tool. Whats the difference between option E and option 1 ? Can it be mixed or only use 1 option? How to clear settings?

Bez tytułu2

terminatorul commented 8 months ago

Sorry I don't know what else to try. The driver configuration looks as expected.

Option 1 overrides option E.

Option E searches the GPU in a pre-defined list of all Turing GPUs, using the PCI device ID (0x1E07). From that list the expected BAR size is read and the Target BAR size column is populated in the output table.

Option 1 is for manually selecting a different BAR size if the default one is wrong or doesn't work, or for trying the mod on non-Turing GPUs (mostly unsuccessful).

To clear option 1 there is option C right in the main menu.

There is nothing special to understand about using the tool. You applied the right sequence in your previous message: E, P , 64 , S , Q. When I do the same, it just works on my MB.

terminatorul commented 8 months ago

Remember to disable NvStrapsReBar if you make hardware changes, or UEFI Setup changes ...