terminatorul/NvStrapsReBar

not working

Closed this issue · 24 comments

  • Motherboard: Msi B450M PRO-VDH MAX

  • BIOS Version: 7A38vBL (2023-10-30)

  • GPU: ZOTAC TWIN RTX 2060 SUPER AMP

  • CPU: Ryzen 5 3600

  • CSM is turned off. Make sure to confirm this in the BIOS and not with GPU-Z or similar since it can be inaccurate

  • 4G decoding is enabled. Make sure to confirm this in the BIOS and not with GPU-Z or similar since it can be inaccurate

  • UEFIPatch is applied (see Using UEFIPatch for more information). On some motherboards DSDT Patching is also needed

  • I have read Common issues (and fixes)

rebar doesn't get enabled
and when put any number beside 65,64, I get efi error

image

image

UEFIPatch says this:

image

MMTool doesn't work for me. when I try to insert it says "file size exceeds the volume size"

Can you show your GPU-Z .txt report file, and your modified LocalPciGpu.h header ?

Can you show your GPU-Z .txt report file, and your modified LocalPciGpu.h header ?

Could you help me farther? how can I get those files

Download CPU-Z from cpuid.com here: https://www.cpuid.com/softwares/cpu-z.html

Openc CPU-Z, go to the about page, and click Save Report (.TXT) button:
image

Reply back here and attach the resulting file to the message.

For the other file LocalPciGpu.h, you should find it at this location if you followed the build instructions:

"%UserProfile%\edk2\NvStrapsReBar\ReBarDxe\include\LocalPciGpu.h"

Notice the github project page says you should modify the values in LocalPciGpu.h file, to match your computer hardware.

So please manually change the your LocalPciGpu.h to replace the following lines with the values you see here.

You will have to re-build the project by following the build instructions, and re-flash your motherboard again, with the new NvStrapsReBar.ffs driver. Also re-enable Above 4G Decoding and disable CSM in UEFI setup, after flashing the motherboard.

#define TARGET_GPU_PCI_VENDOR_ID        0x10DEu
#define TARGET_GPU_PCI_DEVICE_ID        0x1F06u

#define TARGET_GPU_PCI_BUS              0x29u
#define TARGET_GPU_PCI_DEVICE           0x00u
#define TARGET_GPU_PCI_FUNCTION         0x00u

// PCIe config register offset 0x10
#define TARGET_GPU_BAR0_ADDRESS         UINT32_C(0xFB00'0000)               // Should fall within memory range mapped by the bridge

#define TARGET_GPU_BAR1_SIZE_SELECTOR   _8G                                 // Desired size for GPU BAR1, should cover the VRAM size

// Secondary bus of the bridge must match the GPU bus
// Check the output form CPU-Z .txt report

#define TARGET_BRIDGE_PCI_VENDOR_ID     0x1022u
#define TARGET_BRIDGE_PCI_DEVICE_ID     0x1483u

#define TARGET_BRIDGE_PCI_BUS           0x00u
#define TARGET_BRIDGE_PCI_DEVICE        0x03u
#define TARGET_BRIDGE_PCI_FUNCTION      0x01u

// PCIe config register offset 0x20
#define TARGET_BRIDGE_MEM_BASE_LIMIT  UINT32_C(0xFC00'FB00)                 // Should cover the GPU BAR0

// PCIe config register offset 0x1C
#define TARGET_BRIDGE_IO_BASE_LIMIT   0xE1E1u

sorry for asking a lot, could you teach me how to do these parts?
I have no idea ho to do the first one and I can't find Secondary bus equal to the GPU bus, all the numbers are different!(I'm totally a noob)

  • scroll to PCI registers section of the GPU and read the DWORD (4-bytes) at offset 0x10 (or offset 16 in decimal). The DWORD is in the usual little-endian byte order, so you will have to reverse byte sequence.
  • Now search the .txt report for a PCI to PCI bridge with the Secondary bus equal to the GPU bus (that you already saved at step 2)

I can only find offset 0F which is 15 not 16

Video tutorial here, many thanks to @UnidentifiedTag for it:
https://www.youtube.com/watch?v=ldnC18u8FI0

But that part is already done by me, and I sent you the resulting values in LocalPciGpu.h header (see above)

Thanks for your time and effort it worked. Do I need all the apps that I installed for building images and etc?

No you can delete the apps but keep the executable (.exe) you made, because if you cmos reset it’s the only way to turn on rebar again. also keep NVIDIA Profile Inspector as you’ll need that to apply rebar to you’re programs. everything else can go…

Another thing I forgot to ask, I clean reinstalled my gpu driver but it still wouldn't show rebar enabled in Nvidia control panel, but everywhere else it says it's enabled

We would appreciate you running
nvidia-smi -q -d memory
and sharing the output from the console/terminal with us, along with including
CPU:
Motherboard model:
Motherboard chipset:
Graphics card model:
GPU chipset:
GPU PCI VendorID:DeviceID (check GPU-Z):
GPU PCI subsystem IDs (check GPU-Z):
VRAM size:
New BAR size (GPU-Z):
New BAR size (nvidia-smi):
NVIDIA driver ver:

Along with you’re Cupid and gpuz screen shots so we can expand our database of known working systems

@terminatorul will assistant you with NVIDIA control panel

image
image
image
image
image

Congratulations and thank you for sharing the screenshots, looks to be working to me, please close the case unless something is wrong?

for a test I would try 3DMark PCI Express feature test, you run the test with rebar disabled, either by the executable (.exe) or Nvidia profile inspector and then enable it in both, you should see a noticeable difference in score with it on. I believe nvidia control panel will be buggy, so by testing you will know for sure, with games you might only see 3fps difference but with 3d mark pci express feature test you will see a large difference in numbers so you get a concrete answer while a game might lead you guessing.

@AliZf1d
NVIDIA Control Panel does not show ReBAR for this card, sorry. Because NVIDIA only supports ReBAR for RTX 3000 line of GPUs, and newer.

NvStrapsReBar is an unofficial UEFI mod, that does not modify the Control Panel from NVIDIA

Hi I tried the 3d mark test you mentioned but it didn't have a huge difference just 3-4%, Does changing the number in NvStrapsReBar.exe make a difference?

edit: I tried 0x0000000060000000 value for rBAR size limt in nvidiaProfileInspector and it got a lot better! what numbers can I put here beside these :

  1. 0x000000000C800000 (Returnal, Diablo 4)
  2. 0x0000000060000000 (Deathloop)
  3. 0x0000000040000000 (Red Dead Redemption 2)
  4. 0x0000000012C00000 (The Riftbreaker)

You can edit the numbers manually by pressing on them in Nvidia profile inspector and change the numbers, they are just pre sets, you should set the same rebar size you set by the executable (.exe)

@terminatorul recommends you set each game manually, I find that the global setting works. try both. lots of different things to try.

Please share the numbers you got from 3d mark. The before and after and I’ll let you know if it’s expected or not, you should be able to share the url of you’re results from 3d marks website, saying it’s 3% difference is meaningless as what am I basing that on? Single digits or multiple digits long numbers?

how the number works? for example I put 65 in "NvStrapsReBar.exe". what should I put in NvidiaProfileInspector?

3DMark PCI Express feature test
ReBar off:

  • Bandwidth: 13.18 GB/s
  • best fps: 15.18
  • worst fps: 12.75

ReBar on (0x0000000060000000 (Deathloop)) :

  • Bandwidth: 14.72 GB/s
  • best fps: 17.43
  • worst fps: 14.78

I tested ReBar on Fortnite it worked better with: 0x000000000C800000 (Returnal, Diablo 4)

In my short tests, game titles tend to peak (reach best performance) with an rBAR size in Profile Inspector of 1.5 GiB (in hexadecimal), and this is what NVIDIA puts in their profiles by default.

But not all games do that, there enough games that benefit from larger BARs, usually close to the maximum BAR size of the GPU.

If you want to run a PCI bandwidth comparison, like you did above, make sure you disable ReBAR using NvStrapsReBar.exe (so not only in the Profile Inspector), to start a fair comparison.

Could you teach me how to convert the numbers for nvidia inspector? for example 1.5gb that you mentioned

how the number works? for example I put 65 in "NvStrapsReBar.exe". what should I put in NvidiaProfileInspector?

3DMark PCI Express feature test ReBar off:

  • Bandwidth: 13.18 GB/s
  • best fps: 15.18
  • worst fps: 12.75

ReBar on (0x0000000060000000 (Deathloop)) :

  • Bandwidth: 14.72 GB/s
  • best fps: 17.43
  • worst fps: 14.78

I tested ReBar on Fortnite it worked better with: 0x000000000C800000 (Returnal, Diablo 4)

These are good gains, if you were overclocking this would be like hitting the silicon lottery, what you call small gains are actually massive! You are benefiting from this project, rebar is working correctly please mark the case as resolved

These are good gains, if you were overclocking this would be like hitting the silicon lottery, what you call small gains are actually massive! You are benefiting from this project, rebar is working correctly please mark the case as resolved

Yeah that was my bad, I mentioned it in edit of my comment, I changed the rBAR size limt in nvidiaProfileInspector and it got a lot better. for example "0x0000000060000000 (Deathloop)" this value is the best one for me in 3dmark.
and could you teach me how to convert the numbers for nvidia inspector? for example 1.5gb to put in rBAR size limt section

Does changing the number in NvStrapsReBar.exe make a difference?

No, it shouldn't, as long as you got the expected BAR size of 8 GiB

edit: I tried 0x0000000060000000 value for rBAR size limt in nvidiaProfileInspector and it got a lot better! what numbers can I put here ... ?

that is the BAR size you want the game to see (from the NVIDIA driver), written in bytes and converted to hexadecimal.

1.5 GiB means 1024 * 1024 * 1024 * 3 / 2.

You can use Windows Calculator (select programmer mode) to convert numbers to hexadecimal:

image

Thank you so much