just wondering,what does it really keep,some pixel data?
and how can i direct read and write the whole video memory?
is there a way to dump the whole video memory like common memory?
if video memory is a large canvas,can i display it's direct image on screen?
what does video memory keep,how can i direct read and write to
1) just wondering,what does it really keep,some pixel data?1) Whatever you put in it - usually textures and vertices.
2) and how can i direct read and write the whole video memory?
3) is there a way to dump the whole video memory like common memory?
4) if video memory is a large canvas,can i display it's direct image on screen?
2+3) You're not supposed to be able to do that, it's a virtualised resource, just like regular system RAM. Only the OS or it's device drivers should be able to do such a thing.
4) No. You can only present specific parts of video memory to the screen, such as a texture that you allocated earlier.
thank you,but right now i really want to try to do such thing.
it all begins with WinHex,a software can dump RAM i guess,lead me to think this way.
if RAM can be dumped,so i think maybe video RAM can also do that??
you mentioned Only the OS or it's device drivers should be able to do such a thing,i have no idea of OS and DD.
is it possible to learn some way to do that,is is too hard to learn such way?
i searched something,it tells me to use assembly language to access some address,but windows forbids me to do that,
so i got no idea how to do that.
it all begins with WinHex,a software can dump RAM i guess,lead me to think this way.
if RAM can be dumped,so i think maybe video RAM can also do that??
you mentioned Only the OS or it's device drivers should be able to do such a thing,i have no idea of OS and DD.
is it possible to learn some way to do that,is is too hard to learn such way?
i searched something,it tells me to use assembly language to access some address,but windows forbids me to do that,
so i got no idea how to do that.
thank you,but right now i really want to try to do such thing.
it all begins with WinHex,a software can dump RAM i guess,lead me to think this way.
if RAM can be dumped,so i think maybe video RAM can also do that??
you mentioned Only the OS or it's device drivers should be able to do such a thing,i have no idea of OS and DD.
is it possible to learn some way to do that,is is too hard to learn such way?
i searched something,it tells me to use assembly language to access some address,but windows forbids me to do that,
so i got no idea how to do that.
You could download the Windows DDK and write your own driver (drivers in windows are allowed to mess around quite a bit). (Just remember that most GPUs are highly proprietary so the exact details on how to access them varies and can be hard to find)
It is possible to make a VRAM dump but you can't do that with standard userland software, it needs to be done in kernel space. Windows (or any other modern OS, for that matter) will not let you touch whatever memory address you want, because your program is essentially sandboxed in a per-process environment (this is called virtualization). So ultimately, the operating system and the associated drivers get to decide what your program can read from and write to. Think of it as a very relaxed virtual machine, because that's basically what it is.
Windows used to allow you to read from physical memory in user space (starting from Vista this is no longer possible and requires a driver), this is how WinHex does it. However no such facility exists for video memory, because, I guess, not many people have a need for that, and it depends a lot of what your graphics card is. Many integrated graphics cards actually use system memory instead of their own on-chip memory, can you see the problem there?
You could certainly write up a graphics driver that will read video memory directly and dump it to a file, but there are a few difficulties with that approach:
- it is very difficult (writing a driver is certainly not trivial, and may also be harmful to your computer if you don't know what you are doing)
- there are security issues in using a homemade driver (and you may also need to get Microsoft to sign your driver, good luck with that)
Why do you need to read video memory? Its contents are largely meaningless, and if you simply want to read the frontbuffer (the image that the graphics card is about to push to the monitor) as many people who ask this question do, there are simpler options involving DMA.
Video memory contains much, much more than just the image that's about to go on your screen, so if you just want to read that, a full dump clearly isn't the right way to go.
Windows used to allow you to read from physical memory in user space (starting from Vista this is no longer possible and requires a driver), this is how WinHex does it. However no such facility exists for video memory, because, I guess, not many people have a need for that, and it depends a lot of what your graphics card is. Many integrated graphics cards actually use system memory instead of their own on-chip memory, can you see the problem there?
You could certainly write up a graphics driver that will read video memory directly and dump it to a file, but there are a few difficulties with that approach:
- it is very difficult (writing a driver is certainly not trivial, and may also be harmful to your computer if you don't know what you are doing)
- there are security issues in using a homemade driver (and you may also need to get Microsoft to sign your driver, good luck with that)
Why do you need to read video memory? Its contents are largely meaningless, and if you simply want to read the frontbuffer (the image that the graphics card is about to push to the monitor) as many people who ask this question do, there are simpler options involving DMA.
Video memory contains much, much more than just the image that's about to go on your screen, so if you just want to read that, a full dump clearly isn't the right way to go.
Look into CUDA or OpenCL development, these two APIs allow for device memory computation on the device, and give support for pushing data back and forth from RAM and GPU.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement