NvSciBufAttrListDebugDump always returns NvSciError_BadParameter

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.8.1

Target Operating System
Linux

Hardware Platform
DRIVE AGX Orin Developer Kit (not sure its number)
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager

Can somebody provide a minimal sample for a succesful call to NvSciBufAttrListDebugDump()?
Whatever NvSciBufAttrList I pass as parameter I get NvSciError_BadParameter result

Example:

       auto status = cameraQueues.second.captureCompletionQueue->Get(pBuffer, IMAGE_QUEUE_TIMEOUT_US);

        auto pNvMBuffer = dynamic_cast<INvSIPLClient::INvSIPLNvMBuffer*>(pBuffer);

        NvSciBufObj sciBufObj = pNvMBuffer->GetNvSciBufImage();

        NvSciBufAttrList bufAttrList;

        checkSciStatus(NvSciBufObjGetAttrList(sciBufObj, &bufAttrList), "NvSciBufObjGetAttrList failed");

        void* dump{};
        size_t len{};
        auto err = NvSciBufAttrListDebugDump(bufAttrList, &dump, &len);
        // Not successful. Will result in NvSciError_BadParameter

Please check out the code snippet shared by a developer at Import block linear NvSciBufObj with pitch to CUDA - #15 by AdamBalazsVay. It might offer a sample that can guide you with the correct usage of NvSciBufAttrListDebugDump(). I hope this helps.

I think NvSciBufAttrListDebugDump is broken. I copied the code but no matter what list you pass it returns Bad_Parameter.

I even managed to generate a conflictList from NvSciBufAttrListReconcile and even that fails to generate any output.

Here is a repro to generate a conflictList and to see NvSciBufAttrListDebugDump can not process it

    NvSciBufType bufType = NvSciBufType_Image;
    NvSciBufAttrValAccessPerm accessPerm = NvSciBufAccessPerm_ReadWrite;
    NvSciBufAttrKeyValuePair attrKeyValuePairs[] = {
        { NvSciBufGeneralAttrKey_Types, &bufType, sizeof(bufType) },
        { NvSciBufGeneralAttrKey_RequiredPerm, &accessPerm, sizeof(accessPerm) }
    };

    NvSciBufType bufType2 = NvSciBufType_RawBuffer;
    uint64_t rawsize = (128 * 1024);  // Allocate 128K Raw-buffer
    uint64_t align = (4 * 1024);  //Buffer Alignment of 4K
    bool cpuaccess_flag = false;
    NvSciBufAttrKeyValuePair rawbuffattrs[] = {
        { NvSciBufGeneralAttrKey_Types, &bufType2, sizeof(bufType2) },
        { NvSciBufRawBufferAttrKey_Size, &rawsize, sizeof(rawsize) },
        { NvSciBufRawBufferAttrKey_Align, &align, sizeof(align) },
        { NvSciBufGeneralAttrKey_NeedCpuAccess, &cpuaccess_flag,
         sizeof(cpuaccess_flag) },
    };

    NvSciBufAttrList unreconciledAttrLists[2];
    memset(unreconciledAttrLists, 0, sizeof(unreconciledAttrLists));
    const auto unreconciledListCnt = sizeof(unreconciledAttrLists)/sizeof(NvSciBufAttrList);

    checkSciStatus(NvSciBufAttrListCreate(bufModule, &unreconciledAttrLists[0]),"NvSciBufAttrListCreate failed");

    checkSciStatus(NvSciBufAttrListSetAttrs(unreconciledAttrLists[0], attrKeyValuePairs, sizeof(attrKeyValuePairs) / sizeof(NvSciBufAttrKeyValuePair)), "NvSciBufAttrListSetAttrs failed" );

    checkSciStatus(NvSciBufAttrListCreate(bufModule, &unreconciledAttrLists[1]),"NvSciBufAttrListCreate failed");

    checkSciStatus(NvSciBufAttrListSetAttrs(unreconciledAttrLists[1], rawbuffattrs, sizeof(rawbuffattrs) / sizeof(NvSciBufAttrKeyValuePair)), "NvSciBufAttrListSetAttrs failed" );


    checkStatus(cameraController->GetImageAttributes(uSensorId, INvSIPLClient::ConsumerDesc::OutputType::ICP, unreconciledAttrLists[0]), "GetImageAttributes failed" );

    NvSciBufAttrList reconciledAttrList = nullptr;
    NvSciBufAttrList conflictList = nullptr;

    if (auto const sciErr{NvSciBufAttrListReconcile(unreconciledAttrLists, unreconciledListCnt, &reconciledAttrList, &conflictList)}; NvSciError_Success != sciErr)
    {
        if(conflictList != nullptr)
        {
            void* dump{};
            size_t len{};
            if (auto const err{NvSciBufAttrListDebugDump(conflictList, &dump, &len)}; NvSciError_Success != err)
                axGlobalUtils::Log(axGlobalUtils::LogLevel::Error,"NvSciBufAttrListDebugDump failed: ", err);
            else
                axGlobalUtils::Log(axGlobalUtils::LogLevel::Error, "Conflicted args: ", static_cast<char*>(dump));

            NvSciBufAttrListFree(conflictList);
        } else {
            axGlobalUtils::Log(axGlobalUtils::LogLevel::Error,"No conflict list");
        }
        checkSciStatus(sciErr, "Couldn't reconcile NvSciBufAttr and allocate NvSciBufObj");
    }

It has been confirmed that NvSciBufAttrListDebugDump() is now obsolete, which is why you’re encountering the NvSciError_BadParameter result.

What made it obsolete? What can I use to debug NvSciBufAttrLists?

The original purpose of NvSciBufAttrListDebugDump() was to debug NvSciBufAttrListReconcile() during early NvStreams development.
Now you can fetch the NvSciBufAttrList and then call NvSciBufAttrListGetAttrs() to read each of the attributes of interest.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.