0

This is a follow up question to CUDA Global Memory, Where is it? In reference to GSmith's response. These Q's address the CC > 2.0 case.

When I lookup the spec's of my Nvida card, it lists 2GB of 'memory'. I've come to believe this is the 'Global' memory for this card. That is, this is GDDR3 memory that resides 'off-chip', but on the card. Would this be correct?

I don't see any case where the spec'd 'memory' is zero. Does one exist? That is, can I have a card w/ no off-chip memory? In that all my texture, local, and constant memory actually resides in pinned & mapped host memory.

Can I extend my global memory usage by pinning more than 2GB of host memory? Can I use all my off-chip global memory (2GB) and add (1GB) more global pinned memory? Or am I to understand that this card is only capable of an addressing space of 2GB max? i.e. I can only access 2GB of mem, unPinned, pinned, mapped, or any combo.

If the device is using pinned host memory (not mapped), do I need to Memcpy from dev to host? That is, the mem is physically on the host side. And it is being used by the device, so they can both see it. Why do I need to copy it to the host, when it is already there. It seems to be 'mapped' by default. (What mechanism is preventing this dual access?)

How does one go about mapping shared mem to global mem? (I'm not finding any mention of this in the doc's.) Is this a 'mapped' arrangement or do I still need to copy it from global to shared, and back again? (Could this save me a copy step?)

Community
  • 1
  • 1
Doug
  • 2,783
  • 6
  • 33
  • 37

1 Answers1

1

It's recommended to ask one question per question.

When I lookup the spec's of my Nvida card, it lists 2GB of 'memory'. I've come to believe this is the 'Global' memory for this card. That is, this is GDDR3 memory that resides 'off-chip', but on the card. Would this be correct?

Yes.

I don't see any case where the spec'd 'memory' is zero. Does one exist? That is, can I have a card w/ no off-chip memory? In that all my texture, local, and constant memory actually resides in pinned & mapped host memory.

The closest NVIDIA came to this idea was probably in the Ion 2 chipset. But there are no cuda-capable nvidia discrete graphics cards with zero on-board off-chip memory.

Can I extend my global memory usage by pinning more than 2GB of host memory?

You can pin more than 2GB of host memory. However this does not extend global memory. It does enable a variety of things such as improved host-device transfer rates, overlapped copy and compute, and zero-copy access of host memory from the GPU, but this is not the same as what you use global memory for. Zero-copy techniques perhaps come the closest to extending global memory onto host memory (conceptually) but zero copy is very slow from a GPU standpoint.

If the device is using pinned host memory (not mapped), do I need to Memcpy from dev to host?

Yes you still need to cudaMemcpy data back and forth.

That is, the mem is physically on the host side. And it is being used by the device

I don't know where this concept is coming from. Perhaps you are referring to zero-copy, but zero-copy is relatively slow compared to accessing data that is in global memory. It should be used judiciously in cases of small data sizes, and is by no means a straightforward way to provide a bulk increase to the effective size of the global memory on the card.

How does one go about mapping shared mem to global mem?

Shared memory is not automatically mapped to global memory. The methodology is to copy the data you need back and forth between shared and global memory.

Community
  • 1
  • 1
Robert Crovella
  • 143,785
  • 11
  • 213
  • 257
  • "That is, the mem is physically on the host side. And it is being used by the device" As I understand it, pinned mem is host mem that has been mlock'd. This is not mem on the graphics card. And this 'host' mem is being used as 'global' mem by the device. ('Global' appears to be vague term.) So both the host & device have access to this mem. But I still need to Memcpy it. i.e Copy it from the (pinned) host mem to the host mem. (Not ZeroCopy/mapped) It essentially says the host can't directly access it own mem. (Which doesn't add up.) – Doug Nov 07 '12 at 18:33
  • 2
    Yes pinned mem is host mem that is no longer pageable. but this host mem is not used as global mem by the device. please discard that notion. global mem is not really a vague term and you defined it adequately. it is the 2GB of on-card off-chip mem on your card. – Robert Crovella Nov 07 '12 at 20:29
  • 1
    greg smith's response is correct, but I think you're reading his statement about global memory being mapped to pinned host memory and interpreting that as a viable extension to global memory for all purposes. It is not. It is principally used for zero-copy operations. and those will be slower than normal access to global memory on the card. I think it's crisper to think of global memory as the memory on the card and keep zero-copy operations as a special case, conceptually. It's not going to be an effective means for you to try to increase the amount from 2GB to 3GB, for example. – Robert Crovella Nov 07 '12 at 20:55