Skip to content

RTX 4090D 48GB support? (RuntimeError: CUDA error: mapping of buffer object failed) #36

Open

Description

@ac101m

NVIDIA Open GPU Kernel Modules Version

570.124.04-p2p

Please confirm this issue does not happen with the proprietary driver (of the same version). This issue tracker is only for bugs specific to the open kernel driver.

  • I confirm that this does not happen with the proprietary driver package.

Operating System and Version

Ubuntu 24.04.2 LTS

Kernel Release

6.8.0-57-generic

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • I am running on a stable kernel release.

Hardware: GPU

NVIDIA GeForce RTX 4090D (48GB)

Describe the bug

In a system with four RTX 4090D GPUs (modded Chinese variant with 48GB VRAM) an error 'mapping of buffer object failed' occurs when attempting p2p communication. I've been able to reproduce the same error with several programs (tabbyAPI, a simple cuda test program, cuda samples etc). The GPUs are connected to the CPU directly without switches.

Obvious stuff out of the way:

  • IOMMU off in bios
  • Pcie ACS off in bios
  • Virtualization disabled (SR-IOV & CPU virtualization)
  • Secure boot disabled
  • Resizable bar enabled
  • nouveau driver blacklisted

General system information:

  • Mainboard: asrock rack romd8-2t
  • CPU: epyc 7532
  • 256GB RAM
  • 4x "tronizm" (obscure chinese brand) RTX 4090D 48GB

The cards also purport to be capable of p2p operation (according to cuda samples deviceQuery):

<other 3 devices truncated>

Device 3: "NVIDIA GeForce RTX 4090 D"
  CUDA Driver Version / Runtime Version          12.8 / 12.0
  CUDA Capability Major/Minor version number:    8.9
  Total amount of global memory:                 48519 MBytes (50875924480 bytes)
MapSMtoCores for SM 8.9 is undefined.  Default to use 128 Cores/SM
MapSMtoCores for SM 8.9 is undefined.  Default to use 128 Cores/SM
  (114) Multiprocessors, (128) CUDA Cores/MP:    14592 CUDA Cores
  GPU Max Clock rate:                            2520 MHz (2.52 GHz)
  Memory Clock rate:                             10501 Mhz
  Memory Bus Width:                              384-bit
  L2 Cache Size:                                 75497472 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
  Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total shared memory per multiprocessor:        102400 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  1536
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 2 copy engine(s)
  Run time limit on kernels:                     No
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device supports Managed Memory:                Yes
  Device supports Compute Preemption:            Yes
  Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 193 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
> Peer access from NVIDIA GeForce RTX 4090 D (GPU0) -> NVIDIA GeForce RTX 4090 D (GPU1) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU0) -> NVIDIA GeForce RTX 4090 D (GPU2) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU0) -> NVIDIA GeForce RTX 4090 D (GPU3) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU1) -> NVIDIA GeForce RTX 4090 D (GPU0) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU1) -> NVIDIA GeForce RTX 4090 D (GPU2) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU1) -> NVIDIA GeForce RTX 4090 D (GPU3) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU2) -> NVIDIA GeForce RTX 4090 D (GPU0) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU2) -> NVIDIA GeForce RTX 4090 D (GPU1) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU2) -> NVIDIA GeForce RTX 4090 D (GPU3) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU3) -> NVIDIA GeForce RTX 4090 D (GPU0) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU3) -> NVIDIA GeForce RTX 4090 D (GPU1) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU3) -> NVIDIA GeForce RTX 4090 D (GPU2) : Yes

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.8, CUDA Runtime Version = 12.0, NumDevs = 4
Result = PASS

Also nvidia-smi output:

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.124.04             Driver Version: 570.124.04     CUDA Version: 12.8     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4090 D      On  |   00000000:01:00.0 Off |                  Off |
| 30%   43C    P0             53W /  425W |       1MiB /  49140MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  NVIDIA GeForce RTX 4090 D      On  |   00000000:81:00.0 Off |                  Off |
| 30%   42C    P0             54W /  425W |       1MiB /  49140MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   2  NVIDIA GeForce RTX 4090 D      On  |   00000000:82:00.0 Off |                  Off |
| 30%   35C    P0             58W /  425W |       1MiB /  49140MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   3  NVIDIA GeForce RTX 4090 D      On  |   00000000:C1:00.0 Off |                  Off |
| 30%   40C    P0             42W /  425W |       1MiB /  49140MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

To Reproduce

  • Install nvidia drivers 570.124.04 from .run file without kernel modules.
  • Install kernel modules from here: https://github.com/aikitoria/open-gpu-kernel-modules/tree/570.124.04-p2p (as I understand, this is just a more up-to-date fork of this repository with patches for more recent driver versions).
  • Install cuda 12-8 and cudnn 12-8.
  • Compile and run nvidia sample simpleP2P

Simple p2p output:

[./simpleP2P] - Starting...
Checking for multiple GPUs...
CUDA-capable device count: 4

Checking GPU(s) for support of peer to peer memory access...
> Peer access from NVIDIA GeForce RTX 4090 D (GPU0) -> NVIDIA GeForce RTX 4090 D (GPU1) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU0) -> NVIDIA GeForce RTX 4090 D (GPU2) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU0) -> NVIDIA GeForce RTX 4090 D (GPU3) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU1) -> NVIDIA GeForce RTX 4090 D (GPU0) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU1) -> NVIDIA GeForce RTX 4090 D (GPU2) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU1) -> NVIDIA GeForce RTX 4090 D (GPU3) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU2) -> NVIDIA GeForce RTX 4090 D (GPU0) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU2) -> NVIDIA GeForce RTX 4090 D (GPU1) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU2) -> NVIDIA GeForce RTX 4090 D (GPU3) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU3) -> NVIDIA GeForce RTX 4090 D (GPU0) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU3) -> NVIDIA GeForce RTX 4090 D (GPU1) : Yes
> Peer access from NVIDIA GeForce RTX 4090 D (GPU3) -> NVIDIA GeForce RTX 4090 D (GPU2) : Yes
Enabling peer access between GPU0 and GPU1...
CUDA error at simpleP2P.cu:129 code=205(cudaErrorMapBufferObjectFailed) "cudaDeviceEnablePeerAccess(gpuid[1], 0)"

As we can see, the GPUs purport to be be capable of p2p communication, but p2p programs fall over at runtime.

A test program derived from the content of this gist exhibits the following error:

device(type='cuda', index=0)
device(type='cuda', index=1)
device(type='cuda', index=2)
device(type='cuda', index=3)
cuda:0 -> cuda:1
cuda:2 -> cuda:3
cuda:1 -> cuda:0
cuda:3 -> cuda:2
cuda:1 -> cuda:2
cuda:3 -> cuda:0
cuda:2 -> cuda:1
cuda:0 -> cuda:3
cuda:2 -> cuda:0
cuda:3 -> cuda:1
cuda:0 -> cuda:2
cuda:1 -> cuda:3
All 12 GPU transfer combinations are present
GPU cuda:0 can access: GPU cuda:1: ✓,  GPU cuda:2: ✓,  GPU cuda:3: ✓,  
GPU cuda:1 can access: GPU cuda:0: ✓,  GPU cuda:2: ✓,  GPU cuda:3: ✓,  
GPU cuda:2 can access: GPU cuda:0: ✓,  GPU cuda:1: ✓,  GPU cuda:3: ✓,  
GPU cuda:3 can access: GPU cuda:0: ✓,  GPU cuda:1: ✓,  GPU cuda:2: ✓,  
  0%|                                                                                                                                 | 0/12 [00:00<?, ?it/s]Testing cuda:0 to cuda:1
  0%|                                                                                                                                 | 0/12 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/home/ac/local-projects/cuda-p2p-testing/./run.py", line 76, in <module>
    _ = warm_up.to(gpu2)
        ^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: mapping of buffer object failed
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

Despite the error message, setting CUDA_LAUNCH_BLOCKING has no effect on the error.

Bug Incidence

Always

nvidia-bug-report.log.gz

nvidia-bug-report.log.gz

More Info

I wasn't expecting these GPUs to be well behaved exactly and had already accepted that I probably wouldn't get good p2p speeds. However, if this patch can be adapted to these cards somehow, then that truly would be excellent!

I expect the firmware has been tampered with in some way to support the additional memory so that may also play a role here.

Activity

  1. LuosjDD commented on Apr 7, 2025

    @LuosjDD

    BAR1 Memory Usage Total : 32768 MiB Used : 1 MiB Free : 32767 MiB

    It looks like the BAR1 size is less than 48G.

  2. ac101m commented on Apr 7, 2025

    @ac101m
    Author

    It looks like the BAR1 size is less than 48G.

    Yeah, I noticed that...

    The supported values only go up to 32G, probably like the base 4090D. I wonder if there is a way to override the supported values and bump it to 64G?

  3. Ph0rk0z commented on Apr 7, 2025

    @Ph0rk0z

    Maybe kernel modules assign bar size by card SKU and it needs another patch.

  4. ac101m commented on Apr 7, 2025

    @ac101m
    Author

    Maybe kernel modules assign bar size by card SKU and it needs another patch.

    I'm currently poking around the driver code looking for things I might be able to hack. I did find this file that seems like it might be promising, but I haven't spent much time really looking at it yet.

  5. ac101m commented on Apr 7, 2025

    @ac101m
    Author

    It looks like rebar options are reported by the card through UEFI to the kernel. The driver picks the largest supported size and tries to enable that. If it fails, it tries the next lowest value repeatedly until something works. I tried modifying the driver to enter this loop one level greater than the supported value reported by pci_rebar_get_possible_sizes but as I should probably have expected, this did not work.

    I did learn elsewhere though that there are UEFI hacks to enable rebar on cards older than ampere (2000 series), without a supporting vbios. This might be worth a try if I can't get a modified vbios for these cards. Will post back here if I manage to figure anything out.

  6. Ph0rk0z commented on Apr 8, 2025

    @Ph0rk0z

    You can certainly try: terminatorul/NvStrapsReBar@bfa61f5

    Add your GPU to the list and see if you can customize. I only used regular ReBar with 3090s.

    Alternatively, ask your vendor for a vbios update if they are able. It's in their interest to fix this too.

  7. xvim commented on May 10, 2025

    @xvim

    It looks like rebar options are reported by the card through UEFI to the kernel. The driver picks the largest supported size and tries to enable that. If it fails, it tries the next lowest value repeatedly until something works. I tried modifying the driver to enter this loop one level greater than the supported value reported by pci_rebar_get_possible_sizes but as I should probably have expected, this did not work.

    I did learn elsewhere though that there are UEFI hacks to enable rebar on cards older than ampere (2000 series), without a supporting vbios. This might be worth a try if I can't get a modified vbios for these cards. Will post back here if I manage to figure anything out.

    were you ultimately able to get around the 32GB BAR space limitation and successfully enable P2P on the RTX 4090D 48GB?

  8. lambo111-x86 commented on May 30, 2025

    @lambo111-x86

    +1

  9. kirbyzhou commented on Jun 11, 2025

    @kirbyzhou

    +1

  10. ChiikawaSama commented on Jul 4, 2025

    @ChiikawaSama

    +1

  11. ac101m commented on Jul 9, 2025

    @ac101m
    Author

    were you ultimately able to get around the 32GB BAR space limitation and successfully enable P2P on the RTX 4090D 48GB?

    Nope, haven't looked into it much yet.

  12. ChiikawaSama commented on Jul 13, 2025

    @ChiikawaSama

    can we just simply force pci_rebar_get_possible_sizes to give 48GB back?

  13. ac101m commented on Jul 13, 2025

    @ac101m
    Author

    can we just simply force pci_rebar_get_possible_sizes to give 48GB back?

    BAR is only adjusted in power-of-two increments, so the magic number is 64GB rather than 48, but you can certainly try! Though it's a kernel function so you'd have to build a kernel with your change.

    NvStrapsRebar may also be able to do this at the bios level.

  14. ZiliangMiao commented on Aug 1, 2025

    @ZiliangMiao

    +1

  15. 7 remaining items

  16. ac101m commented on Aug 26, 2025

    @ac101m
    Author

    @aluo-x Not so fast! Another user (just above) seems to have gotten something working. @kezewang What steps did you take to get p2p working on your system?

  17. ilovesouthpark commented on Sep 5, 2025

    @ilovesouthpark

    Thank you very much for all of your valuable and constructive suggestions.

    Image Image

    all the 4090d/4090 48GB i found are not with resizebar vbios which is the precondition for p2p patch, how you can bypass this or you have one vbios supports resizebar for 4090d 48GB? Thanks for sharing.

  18. alicepolice commented on Sep 12, 2025

    @alicepolice

    +1 still waiting for a solution,dual 4090 48G

  19. BluffeyTest commented on Dec 16, 2025

    @BluffeyTest

    See this modded version (not by me) which attempts to enable 48GB P2P support: https://github.com/dockettidal0b/open-gpu-kernel-modules/blob/550.90.07-p2p/memory-bank/productContext.md

    I tried it,it's bullshit!even cannot make!

  20. BluffeyTest commented on Dec 17, 2025

    @BluffeyTest

    +1 still waiting for a solution,4 * 4090 48G

  21. LuosjDD commented on Dec 17, 2025

    @LuosjDD

    According to what I've heard, it can only be modified through vbios; the only hope is insider leaks

    Image
  22. BluffeyTest commented on Dec 17, 2025

    @BluffeyTest

    According to what I've heard, it can only be modified through vbios; the only hope is insider leaks

    how to do?

  23. ChihayaK commented on May 14, 2026

    @ChihayaK

    I manged to make it work also. But it still in very early stage. I dont know if it really works under load and what are the performance improvements.
    But seems promising to me.

    p2pBandwidthLatencyTest
    [P2P (Peer-to-Peer) GPU Bandwidth Latency Test]
    Device: 0, NVIDIA GeForce RTX 4090, pciBusID: 85, pciDeviceID: 0, pciDomainID:0
    Device: 1, NVIDIA GeForce RTX 4090, pciBusID: 86, pciDeviceID: 0, pciDomainID:0
    Device: 2, NVIDIA GeForce RTX 4090, pciBusID: 89, pciDeviceID: 0, pciDomainID:0
    Device: 3, NVIDIA GeForce RTX 4090, pciBusID: 8d, pciDeviceID: 0, pciDomainID:0
    Device=0 CAN Access Peer Device=1
    Device=0 CAN Access Peer Device=2
    Device=0 CAN Access Peer Device=3
    Device=1 CAN Access Peer Device=0
    Device=1 CAN Access Peer Device=2
    Device=1 CAN Access Peer Device=3
    Device=2 CAN Access Peer Device=0
    Device=2 CAN Access Peer Device=1
    Device=2 CAN Access Peer Device=3
    Device=3 CAN Access Peer Device=0
    Device=3 CAN Access Peer Device=1
    Device=3 CAN Access Peer Device=2
    
    ***NOTE: In case a device doesn't have P2P access to other one, it falls back to normal memcopy procedure.
    So you can see lesser Bandwidth (GB/s) and unstable Latency (us) in those cases.
    
    P2P Connectivity Matrix
         D\D     0     1     2     3
         0	     1     1     1     1
         1	     1     1     1     1
         2	     1     1     1     1
         3	     1     1     1     1
    Unidirectional P2P=Disabled Bandwidth Matrix (GB/s)
       D\D     0      1      2      3 
         0 917.50  17.02  17.11  17.12 
         1  17.04 950.43  17.12  17.02 
         2  17.13  17.02 949.83  17.12 
         3  17.02  17.12  17.02 951.58 
    Unidirectional P2P=Enabled Bandwidth (P2P Writes) Matrix (GB/s)
       D\D     0      1      2      3 
         0 919.12  26.36  26.36  26.36 
         1  26.36 968.09  26.37  26.36 
         2  26.37  26.36 968.69  26.37 
         3  26.36  26.36  26.36 968.69 
    Bidirectional P2P=Disabled Bandwidth Matrix (GB/s)
       D\D     0      1      2      3 
         0 922.92  13.92  14.07  13.91 
         1  13.59 949.56  14.09  14.25 
         2  13.97  13.97 949.56  13.41 
         3  13.71  13.49  13.75 949.85 
    Bidirectional P2P=Enabled Bandwidth Matrix (GB/s)
       D\D     0      1      2      3 
         0 922.37  52.18  52.18  52.18 
         1  52.18 946.40  52.19  52.20 
         2  52.20  52.19 947.54  52.20 
         3  52.19  52.19  52.19 946.97 
    P2P=Disabled Latency Matrix (us)
       GPU     0      1      2      3 
         0   1.44  12.47  12.43  12.54 
         1  12.34   1.34  12.64  12.52 
         2  21.57  13.28   1.37  20.44 
         3  12.35  17.27  16.87   1.39 
    
       CPU     0      1      2      3 
         0   2.56   7.91   7.86   7.78 
         1   7.84   2.48   7.83   7.83 
         2   7.85   7.78   2.52   7.75 
         3   7.81   7.75   7.79   2.48 
    P2P=Enabled Latency (P2P Writes) Matrix (us)
       GPU     0      1      2      3 
         0   1.44   1.19   1.19   1.19 
         1   1.22   1.35   1.19   1.20 
         2   1.23   1.22   1.36   1.22 
         3   1.20   1.16   1.19   1.39 
    
       CPU     0      1      2      3 
         0   2.55   2.19   2.10   2.19 
         1   2.27   2.51   2.11   2.24 
         2   2.17   2.16   2.68   2.12 
         3   2.24   2.25   2.15   2.65 
    
    NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.  
    
    nccl-tests
    ./build/all_reduce_perf -b 256M -e 2G -f 2 -g 4
    # nThread 1 nGpus 4 minBytes 268435456 maxBytes 2147483648 step: 2(factor) warmup iters: 5 iters: 20 agg iters: 1 validation: 1 graph: 0
    #
    # Using devices
    #  Rank  0 Group  0 Pid  19124 on 7773x device  0 [0000:85:00] NVIDIA GeForce RTX 4090
    #  Rank  1 Group  0 Pid  19124 on 7773x device  1 [0000:86:00] NVIDIA GeForce RTX 4090
    #  Rank  2 Group  0 Pid  19124 on 7773x device  2 [0000:89:00] NVIDIA GeForce RTX 4090
    #  Rank  3 Group  0 Pid  19124 on 7773x device  3 [0000:8d:00] NVIDIA GeForce RTX 4090
    #
    #                                                              out-of-place                       in-place          
    #       size         count      type   redop    root     time   algbw   busbw #wrong     time   algbw   busbw #wrong
    #        (B)    (elements)                               (us)  (GB/s)  (GB/s)            (us)  (GB/s)  (GB/s)       
       268435456      67108864     float     sum      -1    15654   17.15   25.72      0    15658   17.14   25.72      0
       536870912     134217728     float     sum      -1    31194   17.21   25.82      0    31183   17.22   25.83      0
      1073741824     268435456     float     sum      -1    62077   17.30   25.95      0    62057   17.30   25.95      0
      2147483648     536870912     float     sum      -1   123805   17.35   26.02      0   123691   17.36   26.04      0
    # Out of bounds values : 0 OK
    # Avg bus bandwidth    : 25.8797 
    
    ./build/all_gather_perf -b 256M -e 2G -f 2 -g 4
    # nThread 1 nGpus 4 minBytes 268435456 maxBytes 2147483648 step: 2(factor) warmup iters: 5 iters: 20 agg iters: 1 validation: 1 graph: 0
    #
    # Using devices
    #  Rank  0 Group  0 Pid  19301 on 7773x device  0 [0000:85:00] NVIDIA GeForce RTX 4090
    #  Rank  1 Group  0 Pid  19301 on 7773x device  1 [0000:86:00] NVIDIA GeForce RTX 4090
    #  Rank  2 Group  0 Pid  19301 on 7773x device  2 [0000:89:00] NVIDIA GeForce RTX 4090
    #  Rank  3 Group  0 Pid  19301 on 7773x device  3 [0000:8d:00] NVIDIA GeForce RTX 4090
    #
    #                                                              out-of-place                       in-place          
    #       size         count      type   redop    root     time   algbw   busbw #wrong     time   algbw   busbw #wrong
    #        (B)    (elements)                               (us)  (GB/s)  (GB/s)            (us)  (GB/s)  (GB/s)       
       268435456      16777216     float    none      -1   8014.7   33.49   25.12      0   7998.1   33.56   25.17      0
       536870912      33554432     float    none      -1    15982   33.59   25.19      0    15975   33.61   25.21      0
      1073741824      67108864     float    none      -1    31995   33.56   25.17      0    31838   33.72   25.29      0
      2147483648     134217728     float    none      -1    63701   33.71   25.28      0    63197   33.98   25.49      0
    # Out of bounds values : 0 OK
    # Avg bus bandwidth    : 25.2405 
    #
    
    ./build/reduce_scatter_perf -b 256M -e 2G -f 2 -g 4
    # nThread 1 nGpus 4 minBytes 268435456 maxBytes 2147483648 step: 2(factor) warmup iters: 5 iters: 20 agg iters: 1 validation: 1 graph: 0
    #
    # Using devices
    #  Rank  0 Group  0 Pid  19447 on 7773x device  0 [0000:85:00] NVIDIA GeForce RTX 4090
    #  Rank  1 Group  0 Pid  19447 on 7773x device  1 [0000:86:00] NVIDIA GeForce RTX 4090
    #  Rank  2 Group  0 Pid  19447 on 7773x device  2 [0000:89:00] NVIDIA GeForce RTX 4090
    #  Rank  3 Group  0 Pid  19447 on 7773x device  3 [0000:8d:00] NVIDIA GeForce RTX 4090
    #
    #                                                              out-of-place                       in-place          
    #       size         count      type   redop    root     time   algbw   busbw #wrong     time   algbw   busbw #wrong
    #        (B)    (elements)                               (us)  (GB/s)  (GB/s)            (us)  (GB/s)  (GB/s)       
       268435456      16777216     float     sum      -1   8131.1   33.01   24.76      0   8129.0   33.02   24.77      0
       536870912      33554432     float     sum      -1    16188   33.16   24.87      0    16197   33.15   24.86      0
      1073741824      67108864     float     sum      -1    32134   33.41   25.06      0    32188   33.36   25.02      0
      2147483648     134217728     float     sum      -1    63797   33.66   25.25      0    63610   33.76   25.32      0
    # Out of bounds values : 0 OK
    # Avg bus bandwidth    : 24.9881 
    #
    
    ./build/alltoall_perf -b 256M -e 2G -f 2 -g 4
    # nThread 1 nGpus 4 minBytes 268435456 maxBytes 2147483648 step: 2(factor) warmup iters: 5 iters: 20 agg iters: 1 validation: 1 graph: 0
    #
    # Using devices
    #  Rank  0 Group  0 Pid  19543 on 7773x device  0 [0000:85:00] NVIDIA GeForce RTX 4090
    #  Rank  1 Group  0 Pid  19543 on 7773x device  1 [0000:86:00] NVIDIA GeForce RTX 4090
    #  Rank  2 Group  0 Pid  19543 on 7773x device  2 [0000:89:00] NVIDIA GeForce RTX 4090
    #  Rank  3 Group  0 Pid  19543 on 7773x device  3 [0000:8d:00] NVIDIA GeForce RTX 4090
    #
    #                                                              out-of-place                       in-place          
    #       size         count      type   redop    root     time   algbw   busbw #wrong     time   algbw   busbw #wrong
    #        (B)    (elements)                               (us)  (GB/s)  (GB/s)            (us)  (GB/s)  (GB/s)       
       268435456      16777216     float    none      -1   8481.0   31.65   23.74      0   8535.7   31.45   23.59    N/A
       536870912      33554432     float    none      -1    16962   31.65   23.74      0    17060   31.47   23.60    N/A
      1073741824      67108864     float    none      -1    33910   31.66   23.75      0    33977   31.60   23.70    N/A
      2147483648     134217728     float    none      -1    67450   31.84   23.88      0    68067   31.55   23.66    N/A
    # Out of bounds values : 0 OK
    # Avg bus bandwidth    : 23.707 
    #  
    
    nvidia-smi
    Thu May 14 02:45:40 2026       
    +-----------------------------------------------------------------------------------------+
    | NVIDIA-SMI 595.71.05              Driver Version: 595.71.05      CUDA Version: 13.2     |
    +-----------------------------------------+------------------------+----------------------+
    | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
    |                                         |                        |               MIG M. |
    |=========================================+========================+======================|
    |   0  NVIDIA GeForce RTX 4090        Off |   00000000:85:00.0 Off |                  Off |
    | 30%   31C    P8             26W /  450W |       1MiB /  49140MiB |      0%      Default |
    |                                         |                        |                  N/A |
    +-----------------------------------------+------------------------+----------------------+
    |   1  NVIDIA GeForce RTX 4090        Off |   00000000:86:00.0 Off |                  Off |
    | 30%   33C    P8              4W /  450W |       1MiB /  49140MiB |      0%      Default |
    |                                         |                        |                  N/A |
    +-----------------------------------------+------------------------+----------------------+
    |   2  NVIDIA GeForce RTX 4090        Off |   00000000:89:00.0 Off |                  Off |
    | 30%   36C    P8             11W /  450W |       1MiB /  49140MiB |      0%      Default |
    |                                         |                        |                  N/A |
    +-----------------------------------------+------------------------+----------------------+
    |   3  NVIDIA GeForce RTX 4090        Off |   00000000:8D:00.0 Off |                  Off |
    | 30%   36C    P8              6W /  450W |       1MiB /  49140MiB |      0%      Default |
    |                                         |                        |                  N/A |
    +-----------------------------------------+------------------------+----------------------+
    
    +-----------------------------------------------------------------------------------------+
    | Processes:                                                                              |
    |  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
    |        ID   ID                                                               Usage      |
    |=========================================================================================|
    |  No running processes found                                                             |
    +-----------------------------------------------------------------------------------------+
    

    Edit: Kind of bad news is that I still did not mange to make write work >32GB without error. Still the current working siutations might limit the usable vram to just <= 32GB.

    Edit2: I think to correctly handling the >32GB write needs to patch the cuda side of thing. At least that is how I partially solve it, but it is quite intrusive to exsiting software stack. And the performance, not great, at least without optimization. Dont think it is worth to dive in to this rabbit hole. And only using 32GB of vram is not acceptable for me, so I think a real solution is still somehow we get a 64GB bar vbios.

  24. 152334H commented on May 14, 2026

    @152334H

    @ChihayaK what is the result of sudo lspci -vvs 85:00.0 | grep -E "Region|Resizable BAR|BAR [0-9]" on your machine?

  25. ChihayaK commented on May 14, 2026

    @ChihayaK

    @ChihayaK what is the result of sudo lspci -vvs 85:00.0 | grep -E "Region|Resizable BAR|BAR [0-9]" on your machine?

    I dont have a special variant of this gpu. It is indeed 32GB.

    sudo lspci -vvs 85:00.0 | grep -E "Region|Resizable BAR|BAR [0-9]"
    	Region 0: Memory at bc000000 (32-bit, non-prefetchable) [size=16M]
    	Region 1: Memory at 1d800000000 (64-bit, prefetchable) [size=32G]
    	Region 3: Memory at 1e000000000 (64-bit, prefetchable) [size=32M]
    	Region 5: I/O ports at 4000 [size=128]
    	Capabilities: [bb0 v1] Physical Resizable BAR
    		BAR 0: current size: 16MB, supported: 16MB
    		BAR 1: current size: 32GB, supported: 64MB 128MB 256MB 512MB 1GB 2GB 4GB 8GB 16GB 32GB
    		BAR 3: current size: 32MB, supported: 32MB
    
  26. iox commented on Jun 7, 2026

    @iox

    @ChihayaK Can you share some additional details of what you did?

    I have two 4080 super modded with 32GB vram each, but BAR1 only reports 16GB.

  27. Ph0rk0z commented on Jun 13, 2026

    @Ph0rk0z

    Problem is also on the 3080 20gb. Owners have reported no rebar at all.

  28. ChihayaK commented on Jun 15, 2026

    @ChihayaK

    @ChihayaK Can you share some additional details of what you did?

    I have two 4080 super modded with 32GB vram each, but BAR1 only reports 16GB.

    Not possible to alter barsize. That effort was made to adapt the limiation. So a vbios mod is still needed to unlock full potential. Or only 16Gigs of vram can be use while p2p and we all know that is not the point here.

  29. Duanyll commented on Jul 14, 2026

    @Duanyll

    This works on the modded 48G 4090s now — with one caveat worth stating up front.

    With cuMem (modern NCCL / PyTorch, NCCL_CUMEM_ENABLE=1, which is the default) only NCCL's comm buffers go into the 32G BAR1, so model/activations can use the full 48G while P2P is active. Verified on 4× and 8× 4090-48G: 38 GB resident per GPU + NCCL all-reduce via P2P/CUMEM, data correct; ~22–26 GB/s peer copy, ~20–25 GB/s all-reduce busbw (needs iommu=pt + ACS off).

    The catch @ChihayaK : the legacy cudaDeviceEnablePeerAccess path (what simpleP2P uses) opens the whole device, so it's still capped at ~32 GB — that's exactly your wall, and it doesn't go away for legacy apps. Use a cuMem/NCCL workload instead.

    Please check my fork (based on the tinygrad/aikitoria mod): https://github.com/Duanyll/open-gpu-kernel-modules (branches 595.71.05-p2p-48g / 590.48.01-p2p-48g; see docs/48g-4090-p2p/)

    Raw test logs: https://github.com/Duanyll/open-gpu-kernel-modules/tree/590.48.01-p2p-48g/docs/48g-4090-p2p/hw-logs-2026-07

  30. ChihayaK commented on Aug 5, 2026

    @ChihayaK

    Yes, that i pretty much what i ended up with, the part i did not quite solve is that after some testing, i notice that in some cases the memory write will fail silently. And it casues unknown data coruptions without any error, and a lot of work is trying to check if I can at least throw an error when this kind of thing happens and not quite work with a fast solution, thats where i decided to stop. Great work tho!
    Edit: typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions