xCuri0 / ReBarUEFI

Resizable BAR for (almost) any UEFI system
MIT License
1.29k stars 57 forks source link

(Solved) Only upto 1GB ReBarState is available on Gigabyte Z170-HD3-DDR3 and RTX 4060 PCIE x8 bus (Code 12) #114

Closed takem94 closed 4 months ago

takem94 commented 4 months ago

System

Description I have a very specific case, since I use a “mutant” processor, this is QQLT (ES i7 8700h). Therefore, I am already doing the modification for the modified BIOS in coffetime. I'm afraid this is the main problem, but maybe someone understands better. I've seen people successfully use rebar on the same motherboard or similar ones, but I can't reach anything larger than 1 gigabyte for ReBarSize. With a value of 2 gigabytes, it seems that initialization beyond the BIOS does not occur at all. With 4 gigabytes or more, something seems to be happening, the OS system even boots, but no image is displayed on the GPU. There is no image during BIOS loading, as well as in Windows itself. When I'm using iGPU, the image is output on 8 GB value and even 16 GB seems to work, but the iGPU itself does not support rebar, so this is not certain. If check GPU in device manager then can see status with error code 12 and not enough free resources for use. image I did the BIOS firmware using the fptw64 utility, the authenticity will not pass through the Q-flash, I think the problem may be that the wrong BIOS is being flashed, since there are two of them on this board? Another option is to try flashing it via efiflash, but when I do backup of modded bios via Q-flash or through fptw64, I getting a BIOS with FFS ReBar modification and with all patches. After that assumption, I did flashing for dual bios by efiflash 0.87 mod and got the same result. There is an impression that 4G decoding is not enabled, although both in the BIOS and in GPU Z it appears enabled; perhaps the BIOS itself is not working correctly. I tried load without Above 4g encode with 1 Gb ReBarState and instantly get infinite reboot, so it definitely do something. изображение_2024-01-12_165335219 With iGPU and 8 GB size of ReBarState but no image from RTX 4060 and error 12: image Memory range with 4g decode: image Memory range without 4g decode: image Total memory range with 4g decode (if turn iGPU on, it will appears on the end of list near to to the eXt Host Conrtoller with similar address): image

xCuri0 commented 4 months ago

@takem94 this is all expected behavior. You need to switch your monitor from iGPU to the 4060 when using 16GB BAR and you will get output. The proper workaround for this is using a dummy HDMI/DP (you can buy this) on the iGPU

Only BAR1 is used for VRAM and can be resized on NVIDIA, for AMD it's BAR0. The other BARs serve other purposes and cannot be resized.

takem94 commented 4 months ago

@xCuri0 I tried different methods, I have 2 monitors, and getting the rtx 4060 to load with a larger ReBarState than 1 GB does not work, there is always error 12 in the device manager. I tried switching 1 monitor from iGPU to GPU, it also didn’t give an image, I tried turning off iGPU in the device manager, but it didn’t make it work. I saw it work for a person from Win-Raid under the nickname Adiel235, but it seems that in my case there is something else, I’m now almost sure that it’s the VBIOS or the X8 bus on the 4060. And why close the issue, if I haven’t even answered yet about result of your's advice?

takem94 commented 4 months ago

@ xCuri0 how big is the risk of ruin the BIOS by replacing the DsdtAsl module from another BIOS from another motherboard? It’s just that the version of the HD3 motherboard with DDR4 memory has a slightly newer BIOS, maybe it makes sense to remove this module from it? It seems to me that this condition is probably not fulfilled as expected. image

xCuri0 commented 4 months ago

I don't see how this can fix this issue but you can try it

On Sat, 13 Jan 2024, 13:06 Arthur Parijskiy, @.***> wrote:

@ xCuri0 how big is the risk of ruin the BIOS by replacing the DsdtAsl module from another BIOS from another motherboard? It’s just that the version of the HD3 motherboard with DDR4 memory has a slightly newer BIOS, maybe it makes sense to remove this module from it? It seems to me that this condition is probably not fulfilled as expected. image.png (view on web) https://github.com/xCuri0/ReBarUEFI/assets/23483056/5de19ec5-d23c-4046-bbf7-aca8da1fde2f

— Reply to this email directly, view it on GitHub https://github.com/xCuri0/ReBarUEFI/issues/114#issuecomment-1890639938, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHBJLVL2EFW4EA73JQZDAQ3YOLEKRAVCNFSM6AAAAABBYI4EXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQGYZTSOJTHA . You are receiving this because you modified the open/close state.Message ID: @.***>

takem94 commented 4 months ago

@xCuri0 You was right, problem was not in DSDT module, and also both of them are identical.

I found solution for my case and it was hidding in 2 things, the incorrect display of the CSM in the UEFI-BIOS, but the more important is the initialization of the PCIE bus.

So, when I tried flash the BIOS using the efiflash utility in MS-DOS, I turned on CSM to see the flash-drive in boot option. While I was doing this, I noticed that the display of the BIOS logo during boot changed, it stopped being stretched and was in the center of the screen. I realized that I had entered in real UEFI mode, but after reflashing the stretched logo returned again and I still don’t know how to remove this effect. But after that I started turning CSM to enable with all the options and then gradually turning everything off. But the most important option turned out to be “IGFX” in the "Initial Display Output" item-list, before that I always had the PCIE1 bus selected. Usually I just only turned ON the iGPU, but it turns out that until I forcibly set it as a priority during initialization, the dedicated GPU always loaded first. At the same time, it is not necessary to insert anything into the iGPU; I can easily boot into Windows without access to the BIOS. Sleep mode also works.

image

So, I consider separately in the topic of problems and solutions to indicate the full procedure for actions if Rebar of more than 1 gigabyte is not enabled on 1151 motherboards from Gigabyte.

  1. Reflash bios by using the "efiflash 0.87 mod" utility, not 0.65 version, since it is the only one can flash two BIOS-chips at once.
  2. Load into BIOS settings and at first turn "enable" CSM and turn "disable" 4g above decoding. Before that you must check the ReBarState value, it should be set to "0" (disabled)!
  3. Save these changes and boot into the BIOS again.
  4. Now you need to disable CSM again in the BIOS and enable 4g above encoding.
  5. Again save these changes and boot into the BIOS.
  6. Now it is very important to find the "Initial Display Output" option in the peripherals section and choose "IGFX" in it. And also find the option with integrated GPU and enable it too.
  7. Save everything again and reboot into the system.
  8. Now it is preferable to switch the monitor wire to the iGPU.
  9. Then you can finnaly set ReBarState to 13, 14 or 32.
  10. After rebooting, you can change the monitor wire conection into the dedicated GPU back.
  11. Check the video output after loading in Windows, if there is no image output, switch back wire to iGPU and then try another value in ReBarState one by one with reloads.

As a bonus, here are the results of my tests of rebar in Dying Light 2. No big difference with 1GB vs 8GB, but noticeble without rebar. image

A small problem is that you need to leave the iGPU turned on, since in theory it consumes RAM and additionally creates interruptions and increases delays in the system and games.