How to directly access GPU memory
Hello,
I would like to directly access some GPU memory. Is there some standard way to do this when using the nouveau driver, e.g. by mmap'ing a specific range of /dev/something, or do I have to write my own kernel module to set up the mapping of the PCIe BARs?
If there is a standard way, is that only standard for the nouveau driver or will the same procedure work for other drivers too (in particular the proprietary nvidia driver)?
Thanks,
-Nikolaus
Signature · 7 lines
»Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C _______________________________________________ Nouveau mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): 87bp1kcef4.fsf-ki6eFfmvX+JNJvdX2p2jX/[email protected]
Quoted 7 lines · Nikolaus Rath
Hello,
I would like to directly access some GPU memory. Is there some standard way to do this when using the nouveau driver, e.g. by mmap'ing a specific range of
/dev/something, or do I have to write my own kernel module to set up the mapping of the PCIe BARs?
Quoted 9 lines
If there is a standard way, is that only standard for the nouveau driver or will the same procedure work for other drivers too (in particular the proprietary nvidia driver)?
Thanks,
-Nikolaus
You can try to mmap the pci bar but neither nouveau or the closed source driver is intended to play nicely with program that access video memory directly, you may expect crash and losing data. You need to play along the rules of each driver by using the proper API to allocate & access memory which is different btw nouveau and closed driver or others driver out there.
Cheers,
Jerome