-
Sorry to bother but lspci shows 4G BAR and nvidia-smi shows only 256MB?
What do others get? Edit by xCuri0Locking this discussion, for any further discussion go to the NvStrapsRebar repo https://github.com/terminatorul/NvStrapsReBar The latest version does not require any compiling like you may have seen in outdated guides/discussion |
Beta Was this translation helpful? Give feedback.
Replies: 83 comments 567 replies
-
What GPU is this ? I don't think NVIDIA even made any 4GB VRAM cards with Resizable BAR. You probably need to use full size |
Beta Was this translation helpful? Give feedback.
-
@Xelafic how did you get 4GB BAR on a GTX1050Ti ? It's probably some issue with the NVIDIA driver because it doesn't expect a 1050Ti to have 4GB BAR |
Beta Was this translation helpful? Give feedback.
-
Nvidia drivers are an issue. Cards post under Linux (F38) but am thinking range is truncated. However could be a bug and as I don't have anything else to test that I ask for help with a simple question. Windows is another story. Early Pascal driver sees code 43 when installed, later 5xx drivers and maybe some 4xx cause instant lock or reboot, no blue screen and happen early at start of OS boot if installed. GT640 with 2GiB aperture loads though, not sure if that's truncated or not, can also set down to 64MB for testing. A simple synthetic bench that shows differences would be nice but not sure of best way to go or if even practical. Configuration of aperture has seemingly been around on Nvidia cards years before Rebar spec appeared in 2008. Why would Nvidia have this option if it was never meant to be used. Possibly a driver bug but it's not like Nvidia are new to large apertures. I'm only looking at this through curiosity and have no real need for a large aperture myself. |
Beta Was this translation helpful? Give feedback.
-
@Xelafic did it make any difference (especially on Windows) ? Also maybe could share the code in case anyone else finds it useful |
Beta Was this translation helpful? Give feedback.
-
Also try 1 or 2GB BAR, it could be NVIDIA using a 32-bit uint on Windows maybe |
Beta Was this translation helpful? Give feedback.
-
@Xelafic able to send a full dmesg log (with the increased BAR size) ? maybe it will have something useful |
Beta Was this translation helpful? Give feedback.
-
My guess is that NVIDIA hardcoded 256MB for all pre-Ampere GPUs (except maybe Turing because they support Resizable BAR to smaller sizes), but the NVIDIA Linux open source driver now supports Pascal it may be fixable there at least. Or there could be another bit needed to be set for >256MB BARs to function properly. I think nvidia-smi uses the function |
Beta Was this translation helpful? Give feedback.
-
@Xelafic I have always wanted ReBAR on my RTX 2000 card, do you know the BAR size bits (and offset) for Turing ? Are they the same as Pascal ? |
Beta Was this translation helpful? Give feedback.
-
Also, is there a missing call to ReadDword for the GTX 1080 second register ? (register at 0x10, after line 60) ?
|
Beta Was this translation helpful? Give feedback.
-
Newest card I have is Pascal, I haven't seen Turing. Sorry. Umm, that code was just quick and dirty for testing, give me a moment to look as I have forgotten it.
|
Beta Was this translation helpful? Give feedback.
-
As you know I think many people would like to enable ReBAR on their cards, and the manufacturer just doesn't care. So can you please please give me an overview some context on what your assembly code is doing ? Really just any details and more information to get me started on how does it work ? Like where did you get the 0x0cf8 / 0x0cfc I/O port addresses ? PCI specs by chance ? Also see here my translation of your assembly to C++: |
Beta Was this translation helpful? Give feedback.
-
My issue with the missing call to ReadDword also goes to the corresponding call to WriteDword, when the values for GTX 1080 are being restored. If the original value was never read, is it correct to write there the original value of the other register at offset 0x0004 ?
Hope I am not bothering you too much with these ... ! :) |
Beta Was this translation helpful? Give feedback.
-
idk c++, even asm is just a hobby. Never worked in software or computer industry. cf8/cfc are standard IO for x86 to read PCI. The code was used this way because of implementation into @xCuri0 hooking but can also do it at post by reallocating addresses I think. RUEFI is a good tool to use for experimenting, probably best suited with 2 graphics cards, one for display and one for testing.
I did update it but can't remember where, dementia kicking in :( |
Beta Was this translation helpful? Give feedback.
-
About the PCI bridge, is it the same as the motherboard chipset ? Do you have your GPU (GTX 1080) connected directly to the CPU (usually the first PCIe slot), or to the chipset (last PCIe slot on the motherboard) ? Does the assembly code work the same in both cases ? |
Beta Was this translation helpful? Give feedback.
-
That version is hard coded to the first PCIe slot which on my Taichi x99 is 8086:6f08. I can put some more info together but would be later if your interested. Don't be surprised if buggy though ;) |
Beta Was this translation helpful? Give feedback.
-
I still think the bus numbers must be already assigned in the ProcesssControllerOverride hook, otherwise the GPU would not even be accessible. So I need to enumerate all PCIe busses, looking for my GPU, but without assigning the bus numbers .... (like a read-only enumeration). Would it be ok to do the enumeration inside the ProcesssControllerOverride hook , right where I need to check and set BAR size ? Where can I find the AllocateMemorySpace() function please ? Edk2 appears to have gDS->AllocateMemorySpace() and CoreAllocateMemorySpace(). Or do I use AllocateMemorySpace() directly from <Pi/PiDxeCish.h> header ? For the I/O range, different people report different base address for this range on their computers, although the range so far is always empty. So I have to wonder why is the range not always 00-00 in this case, and how is it allocated ... ? Another issue is it looks for some hardware the remaining low-order bit, after truncating the least-signifiant BYTE in the IO address limit, is also reassigned, and I need to set the right value for the bit in this case ... how would I even know ? I read in the UEFI specification that I/O port ranges must come from functions from the ACPI tables... ? So can I use AllocateMemorySpace() and AllocateIoSpace() in the hook as well, even if the UEFI specification calls them pre-UEFI services ? |
Beta Was this translation helpful? Give feedback.
-
I would like separate NvStrapsReBar code from ReBarUEFI code, but I still need NvStrapsReBar functions to execute before ReBarUEFI. So the GPU has a chance to expose supported BAR sizes on the PCI extended configuration registers. Do you know how to achive that ? Is it possible to build NvStrapsReBar as some sort of library (package) for UEFI code, and would you be interested to update ReBarUEFI to check if the library is present, and call it at specific points inside the ReBarUEFI handler ? The other way around works too, if ReBarUEFI could expose hooks that NvStrapsReBar could use .... But then I hope a bug in NvStrapsReBar will not affect ReBarUEFI ... |
Beta Was this translation helpful? Give feedback.
-
I think you should let NvStrapsReBar handle Resizable BAR for NVIDIA GPUs by itself, it will keep things simple. You can remove all the rebar code except for this (I changed to not need rebarState) after you set the strap within the scope of the function so it only gets run on NVIDIA GPUs that got their BAR size changed.
Remove the Also is the following needed ?
Because doesn't the GPU update it's supported BAR size list after setting strap ? |
Beta Was this translation helpful? Give feedback.
-
Also you could try removing all the Resizable BAR code and leaving it to the BIOS to resize it (ReBarUEFI on older systems). Might solve the issue @UnknownGuyzs had. If it doesn't work then maybe need to call the original PreprocessController function after setting straps instead of before. |
Beta Was this translation helpful? Give feedback.
-
So I have ResizableBAR support in all aspects except Turing. OS: Windows 11 Home 23H2 GPU: MSI ARMOR NVIDIA RTX 2070 8GB I just need to turn ResizableBAR on for Turing. This PC is expensive, and I'm not about to brick my BIOS. Is there a tutorial that poses minimal risk and is easy to follow? (all on one page/all in one video) Would be very helpful right now. |
Beta Was this translation helpful? Give feedback.
-
@Maidvelia if you want something easy to follow wait till the module is finished development, currently it requires you configure and compile it yourself |
Beta Was this translation helpful? Give feedback.
-
@terminatorul Hi, i'm trying to enable res bar on my 2080 Ti, though i'm unsure on what values i should set in LocalPciGPU.h. I know my device and vendor ids by looking at the cpuz file report though i'm not sure about the pci registers, target bar address, mem base limit, io base limit and similar. I'd like to try flashing the module on my board but can't figure out the values of that header. If you want to take a look i attached my cpuz report file to the post btw we all should thank you and the other guys for your awesome work :)) |
Beta Was this translation helpful? Give feedback.
-
Something helpful may be for someone to write a script to parse the CPU-Z txt file and output the needed info or even update the LocalPciGPU.h automatically. Also, a quick and easy build environment can be setup with gitpod.io/login and the only missing package is NASM which can be installed "sudo apt update && sudo apt install nasm" |
Beta Was this translation helpful? Give feedback.
-
is it possible to build a hybrid ReBarUEFI / NVStrapsReBar by setting up the windows executable to enter the required cpu-z PCI information for Turing GPUs to pass to the EFI driver like the BAR Size? |
Beta Was this translation helpful? Give feedback.
-
would like some help with filling out my header as well, here's how far I've gotten
and I've attached my cpu-z report This is a 1660Ti laptop with an Insyde BIOS and 6 gigs of VRAM |
Beta Was this translation helpful? Give feedback.
-
@terminatorul and @xCuri0 you are welcome to share the video, i hope this helps more people get onboard |
Beta Was this translation helpful? Give feedback.
-
no one given any thought to setting up a build environment on gitpod.io? a single script could be used to setup all missing dependencies and paths |
Beta Was this translation helpful? Give feedback.
-
@terminatorul Did everything in @UnidentifiedTag 's video + the readme's, still unable to enable ReBAR. Here's what I did:
(INTERCEPTOR.txt is my CPU-Z report) EDIT: Have tried all 3 methods of LocalPciGPU.h values (decimal, reversed hexadecimal, and @xCuri0's values that are supposed to work for 99% of systems), still not working. |
Beta Was this translation helpful? Give feedback.
-
Hello People just wanted to double check, I run a z690 mobo with a ole 1080ti I take it ReBAR with Pascal is not gonna happen ? :D |
Beta Was this translation helpful? Give feedback.
-
Locking this discussion, for any further discussion go to the NvStrapsRebar repo https://github.com/terminatorul/NvStrapsReBar The latest version does not require any compiling like you may have seen in outdated guides/discussion |
Beta Was this translation helpful? Give feedback.
@Xelafic how did you get 4GB BAR on a GTX1050Ti ?
It's probably some issue with the NVIDIA driver because it doesn't expect a 1050Ti to have 4GB BAR