我正在尝试像这样在 VRAM 中进行交换维基百科。我的显卡 Nvidia GTX 275 具有 896 MiB 板载:
[ 9.818641] nouveau 0000:03:00.0: NVIDIA GT200 (0a0300b1)
[ 9.946633] nouveau 0000:03:00.0: bios: version 62.00.59.00.02
[ 9.967125] nouveau 0000:03:00.0: fb: 896 MiB GDDR3
[ 10.207255] nouveau 0000:03:00.0: DRM: VRAM: 896 MiB
[ 10.207260] nouveau 0000:03:00.0: DRM: GART: 1048576 MiB
[ 10.207264] nouveau 0000:03:00.0: DRM: TMDS table version 2.0
[ 10.207267] nouveau 0000:03:00.0: DRM: DCB version 4.0
然而,只有 256MiB+16MiB+32MiB 被映射到内存地址空间:
lspci -vnn -s 03:00.0
03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT200b [GeForce GTX 275] [10de:05e6] (rev a1) (prog-if 00 [VGA controller])
Flags: bus master, fast devsel, latency 0, IRQ 39
Memory at f8000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f6000000 (64-bit, non-prefetchable) [size=32M]
I/O ports at 9f00 [size=128]
Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
<...>
Kernel driver in use: nouveau
Kernel modules: nvidiafb, nouveau
还:
cat /proc/iomem
00000000-00000fff : Reserved
00001000-0009f7ff : System RAM
0009f800-0009ffff : Reserved
00000000-00000000 : PCI Bus 0000:00
000a0000-000dffff : PCI Bus 0000:00
000c0000-000cdbff : Video ROM
000e0000-000effff : pnp 00:05
000f0000-000fffff : Reserved
000f0000-000fffff : System ROM
00100000-dfedffff : System RAM
dfee0000-dfee0fff : ACPI Non-volatile Storage
dfee1000-dfeeffff : ACPI Tables
dfef0000-dfefffff : Reserved
dfef0000-dfefffff : pnp 00:05
dff00000-febfffff : PCI Bus 0000:00
>>> e0000000-efffffff : PCI Bus 0000:03
>>> e0000000-efffffff : 0000:03:00.0 -----> 256 MiB
f0000000-f3ffffff : PCI MMCONFIG 0000 [bus 00-3f]
f0000000-f3ffffff : Reserved
f0000000-f3ffffff : pnp 00:04
f4000000-f41fffff : PCI Bus 0000:04
f4200000-f43fffff : PCI Bus 0000:04
f4400000-f45fffff : PCI Bus 0000:05
f4600000-f47fffff : PCI Bus 0000:06
>>> f6000000-f9ffffff : PCI Bus 0000:03
>>> f6000000-f7ffffff : 0000:03:00.0 -----> 32 MiB
>>> f8000000-f8ffffff : 0000:03:00.0 -----> 16 MiB
fb600000-fb6fffff : PCI Bus 0000:01
fb600000-fb60ffff : 0000:01:00.0
fb6ff000-fb6ff7ff : 0000:01:00.0
fb6ff000-fb6ff7ff : ahci
fb700000-fb7fffff : PCI Bus 0000:09
fb700000-fb70ffff : 0000:09:00.0
fb7f8000-fb7fbfff : 0000:09:06.0
fb7fe000-fb7fe7ff : 0000:09:06.0
fb7fe000-fb7fe7ff : firewire_ohci
fb7ff000-fb7ff0ff : 0000:09:00.0
fb7ff000-fb7ff0ff : 8139too
fb800000-fb8fffff : PCI Bus 0000:02
fb8fe000-fb8fffff : 0000:02:00.0
fb8fe000-fb8fffff : xhci-hcd
fb900000-fb9fffff : PCI Bus 0000:08
fb9f8000-fb9fbfff : 0000:08:00.0
fb9ff000-fb9fffff : 0000:08:00.0
fb9ff000-fb9fffff : r8169
fba00000-fbafffff : PCI Bus 0000:08
fba00000-fba1ffff : 0000:08:00.0
fbb00000-fbbfffff : PCI Bus 0000:07
fbbf8000-fbbfbfff : 0000:07:00.0
fbbff000-fbbfffff : 0000:07:00.0
fbbff000-fbbfffff : r8169
fbc00000-fbcfffff : PCI Bus 0000:07
fbc00000-fbc1ffff : 0000:07:00.0
fbd00000-fbdfffff : PCI Bus 0000:06
fbdfe000-fbdfffff : 0000:06:00.0
fbdfe000-fbdfffff : ahci
fbe00000-fbefffff : PCI Bus 0000:05
fbefe000-fbefffff : 0000:05:00.0
fbefe000-fbefffff : ahci
fbff8000-fbffbfff : 0000:00:1b.0
fbff8000-fbffbfff : ICH HD audio
fbffc000-fbffc0ff : 0000:00:1f.3
fbffd000-fbffd3ff : 0000:00:1d.7
fbffd000-fbffd3ff : ehci_hcd
fbffe000-fbffe3ff : 0000:00:1a.7
fbffe000-fbffe3ff : ehci_hcd
fbfff000-fbffffff : 0000:00:13.0
fec00000-ffffffff : Reserved
fec00000-fec003ff : IOAPIC 0
fed00000-fed003ff : HPET 0
fed00000-fed003ff : PNP0103:00
fed10000-fed1dfff : pnp 00:05
fed1f410-fed1f414 : iTCO_wdt.1.auto
fed20000-fed8ffff : pnp 00:05
fee00000-fee00fff : Local APIC
fee00000-fee00fff : pnp 00:05
ffb00000-ffb7ffff : pnp 00:05
ffb80000-ffbfffff : INT0800:00
fff00000-ffffffff : pnp 00:05
100000000-c1fffffff : System RAM
be9000000-bea404d47 : Kernel code
bea600000-beac58fff : Kernel rodata
beae00000-beb15c2bf : Kernel data
beb9cf000-bebdfffff : Kernel bss
因此,据我了解,nouveau
仅使用 304MiB (256+16+32) 的 VRAM,其他 592 个都被浪费了。是否可以将尾部 592MiB 映射到地址空间以抓取它们进行交换?