2

My system hosts 8 GB of RAM and 2 GB of VRAM. It runs Ubuntu 18.04 with kernel 4.15.0-74-generic x86_64.

IIUC, these two types of memory, in addition to the BIOS read-only memory, are mapped into the virtual and the physical address space.

Is there a tool to show how has this mapping been performed? In particular, which ranges of physical/virtual addresses are located for the system RAM, which for the VRAM and which for the BIOS.

I don't know if lsmem is the right tool, because it seems not to distinguish between the types of memory.


Edit

About lspci:

$ lspci -v -s 01:00.0
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: ASUSTeK Computer Inc. GK107 [GeForce GTX 650]
    Flags: bus master, fast devsel, latency 0, IRQ 29
    Memory at ee000000 (32-bit, non-prefetchable) [size=16M]
    Memory at d0000000 (64-bit, prefetchable) [size=256M]
    Memory at e0000000 (64-bit, prefetchable) [size=32M]
    I/O ports at e000 [size=128]
    [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

The total amount of memory appears to be 16+256+32 = 304 MB, while this card should have 1024 MB.

1
  • About virtual addresses: This will vary by process. Every process has its own virtual address. There can be two processes sharing the same physical memory, but have different virtual addresses (e.g. two processes have read/execute access to a library, and the library is mapped to different virtual addresses in the two processes). Reasons that the virtual addresses are different include: virtual address range in use, address randomisation, just because. Jan 27, 2020 at 22:12

1 Answer 1

0

You already found lsmem:

$ lsmem

Then, lspci will give the information about the graphic card's memory and mappings. First list the PCI bus:

$ lscpi

Identify your card (the numbers on the left). Let's say that it is listed as 00:02.0.

$ lspci -v -s 00:02.0

For the full video memory, that doesn't have to be mapped, you can do:

$ glxinfo | egrep -i 'device|memory'
2
  • Are you sure it is enough? I edited the question with a sample output of lspci.
    – BowPark
    Jan 27, 2020 at 21:48
  • I updated my answer. Note that the unused RAM will not be mapped. You could put it to another use though. For example swap on video RAM. I'm not saying it is a good idea, just that it is possible. Jan 27, 2020 at 22:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .