Skip to content

cl_dram_hbm_dma builds but running the way the tutorial says produces "unable to open read dma queue" #744

@dsw

Description

@dsw

I loaded the FPGA with my compiled verilog and confirmed that it was loaded, but it does not run.

I am very carefully following these instructions: https://github.com/aws/aws-fpga/blob/f2/hdk/README.md

$ ./load_aws_fpga_image.sh 
AFI          0       agfi-0c0272c37d36a7915  loaded            0        ok               0       0x10212415
AFIDEVICE    0       0x1d0f      0xf001      0000:34:00.0
$ sudo fpga-describe-local-image -S 0 -H
Type  FpgaImageSlot  FpgaImageId             StatusName    StatusCode   ErrorName    ErrorCode   ShVersion
AFI          0       agfi-0c0272c37d36a7915  loaded            0        ok               0       0x10212415
Type  FpgaImageSlot  VendorId    DeviceId    DBDF
AFIDEVICE    0       0x1d0f      0xf001      0000:34:00.0

And then these instructions: https://github.com/aws/aws-fpga/tree/f2/hdk/cl/examples/cl_dram_hbm_dma

$ cd aws-fpga/hdk/cl/examples/cl_dram_hbm_dma/software/runtime/

$ make
gcc -DCONFIG_LOGLEVEL=4 -std=gnu11 -g -Wall -Werror -I/home/ubuntu/aws-fpga/sdk/userspace/include   -c -o test_dram_dma_common.o test_dram_dma_common.c
gcc -DCONFIG_LOGLEVEL=4 -std=gnu11 -g -Wall -Werror -I/home/ubuntu/aws-fpga/sdk/userspace/include   -c -o test_dram_hbm_dma.o test_dram_hbm_dma.c
gcc -DCONFIG_LOGLEVEL=4 -std=gnu11 -g -Wall -Werror -I/home/ubuntu/aws-fpga/sdk/userspace/include   -c -o test_dram_dma_hwsw_cosim.o test_dram_dma_hwsw_cosim.c
gcc -DCONFIG_LOGLEVEL=4 -std=gnu11 -g -Wall -Werror -I/home/ubuntu/aws-fpga/sdk/userspace/include -o test_dram_hbm_dma test_dram_hbm_dma.o test_dram_dma_common.o   -lfpga_mgmt
gcc -DCONFIG_LOGLEVEL=4 -std=gnu11 -g -Wall -Werror -I/home/ubuntu/aws-fpga/sdk/userspace/include -o test_dram_dma_hwsw_cosim test_dram_dma_hwsw_cosim.o test_dram_dma_common.o  -lfpga_mgmt

However it does not work.

$ sudo ./test_dram_hbm_dma
2025-09-02T00:34:07.475012Z, test_dram_hbm_dma, ERROR, test_dram_hbm_dma.c +124: dma_example(): unable to open read dma queue
2025-09-02T00:34:07.475059Z, test_dram_hbm_dma, ERROR, test_dram_hbm_dma.c +83: main(): DMA example failed
2025-09-02T00:34:07.475068Z, test_dram_hbm_dma, INFO, test_dram_hbm_dma.c +97: main(): TEST FAILED

Now the code does attempt to read a slot_id from the command line, which the instructions do not say to proivde:

int main(int argc, char **argv) {                                               
    int rc;                                                                     
    int slot_id = 0;                                                            
    // int interrupt_n;                                                         
                                                                                
    switch (argc) {                                                             
    case 1:                                                                     
        break;                                                                  
    case 3:                                                                     
        sscanf(argv[2], "%x", &slot_id);                                        
        break;                                                                  

So that means that it is defaulting to slot_id = 0, but given that case 1 above does not error, that seems to be simply the default.

Any suggestions please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions