NVIDIA Video BIOS Hack

Tom Li 7b20360f56 Add a comment for a magic number. 10 年 前
.gitignore 546344140a Initial commit 10 年 前
LICENSE 546344140a Initial commit 10 年 前
Makefile 5b350839dd make static 10 年 前
README.md dc0b92527b Update credits information. 10 年 前
intel.h 4187f5c9b7 First Commit. 10 年 前
nvidia.h 4187f5c9b7 First Commit. 10 年 前
nvresolution.c 7b20360f56 Add a comment for a magic number. 10 年 前

README.md

nvresolution

NVResolution: NVIDIA Video BIOS Hack

Nowadays, many people use their computers with wide-screen monitors. But, these resolutions aren't the VESA standards, the video drivers/framebuffers deal with them by themselves.

Unfortunately, NVIDIA's proprietary drivers for Linux don't provide framebuffer drivers. We have to use VESA compatible framebuffer and standard VESA resolution only. Therefore, we get poor resolutions when we using NVIDIA's proprietary drivers. Or, we could use Nouveau and get great resolutions with nouveaufb, but the performance is poor.

No, you can't use both of them. So, Nvidia users on GNU/Linux Platform are painful.

But, nvresolution changed the situation. nvresolution is a tool to hotpatch the video BIOS of the NVIDIA GPU. It modifies the video BIOS, replaces a resolution mode into your specificed resolution, in order to use the native resolutions of your monitors.

Build into GRUB 2

  • Create a sub-directory called "grub-extras" of your grub2 checkout
  • git checkout grub, at your nvresolution checkout
  • copy nvresolution checkout into grub-extras
  • Export GRUB_CONTRIB environment variable to point to grub-extras.
  • Build GRUB as usual (./autogen.sh; make).
git clone git://git.savannah.gnu.org/grub.git
cd grub
git clone git://github.com/biergaizi/nvresolution.git
cd nvresolution
git checkout grub
cd ../
mkdir grub-extras
cp nvresolution grub-extras/ -R
export GRUB_CONTRIB="$(pwd)/grub-extras/"
./autogen.sh
./configure
make
sudo make install
# grub-install to install GRUB to MBR and /boot

Usage

Usage: ./nvresolution [width] [height]

root is required.

Check If It Works

  1. make
  2. Install hwinfo
  3. hwinfo --framebuffer, get a list of available resolution.
  4. ./nvresolution [width] [height]
  5. hwinfo --frambuffer to see whether the new resolution appears in the list.
    • If so, following the next steps to hack the resolution every time you boot.
    • Otherwise, please report an issue.

How To Get a High Resolution

  1. Build nvresolution into GRUB
  2. Install GRUB
  3. Execute nvresolution every time you boot (add nvresolution 1440 900 to grub.cfg)
  4. Check whether you have uvesafb kernel module
  5. If uvesafb is built into the kernel,
    • add kernel parameter: video=uvesafb:1440x900-32,mtrr:3,ywrap, don't forget to replace 1440x900 to your resolution.
  6. If uvesafb is a kernel module,
    • echo "options uvesafb mode_option=1440x900-32 scroll=ywrap" > /etc/modprobe.d/uvesafb.conf

If you can't rebuild GRUB:

  1. make static, you got a static version of nvresolution
  2. https://wiki.archlinux.org/index.php/Uvesafb#Uvesafb_and_915resolution
    • Don't forget to replace all 915resolution (and its usage) into nvresolution

Supported Hardwares

It should work on GTX 400 and newer GPUs. But only tested with my GTX 460.

It must unlock PAM registers to modify the VBIOS memory. The method to unlocking PAM registers is depends on CPUs.

It should works on Intel Core i-series processors Gen1/Gen2/LGA2011. But only tested with my Core i7 2600K (belongs to Gen2).

Core i-series processors Gen3 and newer processors are not supported. AMD processors are not supported, because I don't have manuals or hardwares.

Pull Requests are welcomed.

Safety

It modifies the video BIOS?! Yes, but it is a hotpatch. The video BIOS area it modifies which is mapped into the RAM. It means the modifications of the BIOS are transient. The modification will lose after shutting down. There is no risk of permanent modification of the BIOS. It also means that nvresolution must be run every time the computer boots.

In the worst case, if it breaks your graphics, just reboot your computer.

But, please keep in mind:

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Credits

  • 915Resolution - The source of all the resolution hacks
  • DieBuche - The original work on hacking legacy NVIDIA/ATI VBIOS
  • Clover
  • pene - Reverse Engineering on NVIDIA VBIOS (READ IT IF YOU WANT TO JOIN ME)
  • Chameleon
  • dmazar - Providing the information about unlocking PAM on newer CPUs
  • GNU GRUB
  • VBIOS images submitted by Hackintosh users

See Also

  • my nvesabios tool - It shows the old way to analytics and modify the VBIOS.