Questions tagged [mapped-memory]

Mapped memory permits different processes to communicate via a shared file.

Mapped Memory permits different processes to communicate via a shared file. Although you can think of mapped memory as using a shared memory segment with a name, you should be aware that there are technical differences. Mapped memory can be used for interprocess communication or as an easy way to access the contents of a file.

Mapped memory forms an association between a file and a process's memory. Linux splits the file into page-sized chunks and then copies them into virtual memory pages so that they can be made available in a process's address space. Thus, the process can read the file's contents with ordinary memory access. It can also modify the file's contents by writing to memory. This permits fast access to files.

7 questions
26
votes
3 answers

How to properly access mapped memory without undefined behavior in C++

I've been trying to figure out how to access a mapped buffer from C++17 without invoking undefined behavior. For this example, I'll use a buffer returned by Vulkan's vkMapMemory. So, according to N4659 (the final C++17 working draft), section…
Socrates Zouras
  • 271
  • 2
  • 7
2
votes
1 answer

GPU memory oversubscription with mapped memory, Unified Virtual Addressing and Unified Memory

I'm considering possibilities to process data on a GPU, that is too big for the GPU memory, and I have a few questions. If I understand that correctly, with mapped memory the data resides in the main memory and is transferred to the GPU only when…
lawful_neutral
  • 633
  • 8
  • 29
1
vote
0 answers

vb memory mapped file Array of Integers

I am trying to create an array of Integers into a memory mapped file and read the file in C++, but I won't ask the c++ part here. MakeMem() has {"Not enough space available in the buffer."} Private Sub MakeMem() Dim integer2 = New Integer(31) {} For…
jester
  • 238
  • 5
  • 13
1
vote
1 answer

Is there an opposite to cudaHostGetDevicePointer()?

Suppose my device is Kepler and up, CUDA is 6.5 or up, and my driver is from 2015 at the earliest. Is it possible to do the opposite of cudaHostGetDevicePointer()? i.e., provided the address of the device-side manifestation of some mapped memory,…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

Consistency Rules for cudaHostAllocMapped

Does anyone know of documentation on the memory consistency model guarantees for a memory region allocated with cudaHostAlloc(..., cudaHostAllocMapped)? For instance, when writes from the device become visible to reads from the host would be useful…
agrippa
  • 379
  • 5
  • 19
0
votes
1 answer

Should cudaMemset work on the device pointer mapped from cudaHostRegister

I came across the sample code from one of my colleagues where the cudaMemset doesn't seem to work properly, when run on V100. #include #include #define CUDACHECK(cmd) \ {\ cudaError_t error = cmd;\ if (error !=…
Satyanvesh D
  • 323
  • 1
  • 4
  • 16
0
votes
1 answer

Can't open mapped file from address

I can't open mapped memory. When I use OpenFileMappingA() it returns NULL and GetLastError() returns 161 (ERROR_BAD_PATHNAME). I use the following code: MEMORY_BASIC_INFORMATION mbi = { 0 }; VirtualQuery(image->raw_data, &mbi, sizeof(mbi)); if…