Esempio n. 1
0
    def vdpauInformation():

        os.system(
            "cat /tmp/gpu-viewer/vdpauinfo.txt | grep -E 'API|string' > /tmp/gpu-viewer/vdpauInformation.txt"
        )
        with open("/tmp/gpu-viewer/vdpauInformation.txt", "r") as file:
            for i, line in enumerate(file):
                vdpauinfoStore.append(None, [
                    ' '.join(line.split()[0:2]).strip('[]'), ' '.join(
                        line.split()[2:]).strip('[]'),
                    setBackgroundColor(i)
                ])

        iter = vdpauinfoStore.append(
            None, ["Supported Codecs:", ' ', Const.BGCOLOR3])

        with open("/tmp/gpu-viewer/vdpauDecoder.txt", "r") as file1:
            i = 1
            for line in file1:
                if "not" not in line:
                    vdpauinfoStore.append(iter, [
                        "",
                        line.split()[0].strip('\n'),
                        setBackgroundColor(i)
                    ])
                    i = i + 1

        treeVdpauInfo.expand_all()
Esempio n. 2
0
    def getPlatfromDetails(value):

        oclPlatformslocal = []
        oclPlatformslocal = oclPlatformslocal + oclPlatforms
        oclPlatformslocal.append("BLANK")

        for i in range(len(oclPlatformslocal)):
            oclPlatformslocal[i] = [
                j.replace("(", "\(") for j in oclPlatformslocal[i]
            ]
            oclPlatformslocal[i] = [
                j.replace(")", "\)") for j in oclPlatformslocal[i]
            ]
            oclPlatformslocal[i] = ''.join(oclPlatformslocal[i])

        os.system(
            "cat /tmp/gpu-viewer/clinfo.txt | awk '/Number of platforms.*/{flag=1;next}/Number of devices/{flag=0}flag' | awk '/%s/{flag=1;next}/Platform Name/{flag=0}flag' | awk /./> /tmp/gpu-viewer/oclPlatformDetails.txt"
            % oclPlatformslocal[value])
        os.system(
            "cat /tmp/gpu-viewer/oclPlatformDetails.txt | grep -o Platform.* | awk '{gsub(/  .*/,'True');print}' > /tmp/gpu-viewer/oclPlatformDetailsLHS.txt"
        )
        os.system(
            "cat /tmp/gpu-viewer/oclPlatformDetails.txt | grep -o Platform.* | awk '{gsub(/Platform.*  /,'True');print}' > /tmp/gpu-viewer/oclPlatformDetailsRHS.txt"
        )

        oclPlatformDetailsLHS = copyContentsFromFile(
            "/tmp/gpu-viewer/oclPlatformDetailsLHS.txt")
        oclPlatformDetailsRHS = copyContentsFromFile(
            '/tmp/gpu-viewer/oclPlatformDetailsRHS.txt')
        platformDetails_Store.clear()
        platformDetailsTreeView.set_model(platformDetails_Store)

        for i in range(len(oclPlatformDetailsLHS)):
            platformDetailsTreeView.expand_all()
            background_color = setBackgroundColor(i)
            if "Extensions" in oclPlatformDetailsLHS[
                    i] and "suffix" not in oclPlatformDetailsLHS[i]:
                oclPlatformExtensions = oclPlatformDetailsRHS[i].split(' ')
                iter = platformDetails_Store.append(None, [
                    oclPlatformDetailsLHS[i].strip('\n'),
                    str(len(oclPlatformExtensions)), background_color
                ])
                for j in range(len(oclPlatformExtensions)):
                    background_color = setBackgroundColor(j)
                    platformDetails_Store.append(iter, [
                        oclPlatformExtensions[j].strip('\n'), " ",
                        background_color
                    ])
            else:
                platformDetails_Store.append(None, [
                    oclPlatformDetailsLHS[i].strip('\n'),
                    oclPlatformDetailsRHS[i].strip('\n'), background_color
                ])
Esempio n. 3
0
def about(tab3):
    frame1 = Gtk.Frame(label="")
    tab3.add(frame1)
    frame2 = Gtk.Frame(label="")
    tab3.add(frame2)
    screen = Gdk.Screen.get_default()
    About_list = Gtk.ListStore(str, str)
    i = 0
    with open("../About GPU Viewer", "r") as file1:
        for line in file1:
            background_color = setBackgroundColor(i)
            About_list.append([line.strip('\n'), background_color])
            i = i + 1

    TreeAbout = Gtk.TreeView(About_list, expand=True)
    wrapWidth = screen.get_width() * 0.58

    for i, column_title in enumerate(Title1):
        renderer1 = Gtk.CellRendererText(font=Const.FONT)
        renderer1.set_property("wrap-width", wrapWidth)
        column = Gtk.TreeViewColumn(column_title, renderer1, text=i)
        column.add_attribute(renderer1, "background", 1)
        column.set_alignment(0.5)
        TreeAbout.append_column(column)

    scrollable_treelist1 = createScrollbar(TreeAbout)
    frame1.add(scrollable_treelist1)

    ChangeLog_list = Gtk.ListStore(str, str)

    with open("../Change Log", "r") as file1:
        i = 0
        for line in file1:
            background_color = setBackgroundColor(i)
            ChangeLog_list.append([line.strip('\n'), background_color])
            i = i + 1

    TreeChangeLog = Gtk.TreeView(ChangeLog_list, expand=True)

    for i, column_title in enumerate(Title2):
        renderer2 = Gtk.CellRendererText(font=Const.FONT)
        renderer2.set_property("wrap-width", wrapWidth)
        renderer2.set_property("wrap-mode", True)
        column = Gtk.TreeViewColumn(column_title, renderer2, text=i)
        column.add_attribute(renderer2, "background", 1)
        column.set_alignment(0.5)
        TreeChangeLog.append_column(column)

    scrollable_treelist2 = createScrollbar(TreeChangeLog)
    frame2.add(scrollable_treelist2)
Esempio n. 4
0
    def radcall2(button):
        value = button.get_active()

        GL_All = []

        List = copyContentsFromFile("/tmp/gpu-viewer/Vendor1.txt")

        List = [i.strip(' ') for i in List]
        List = [i.strip('\n ') for i in List]
        List.insert(0, " ALL")

        with open("/tmp/gpu-viewer/extensions.txt", "r") as file1:
            for line in file1:
                if List[int(value)] == " ALL":
                    GL_All.append(line)
                elif List[int(value)] != " ALL":
                    if "_%s_" % List[int(value)] in line:
                        GL_All.append(line)

        OpenGLExt_list.clear()
        TreeGLExt.set_model(OpenGLExt_list_filter)

        for i in range(len(List)):
            if int(value) == i:
                frame4.set_label(List[i])

        count = len(GL_All)
        for i in range(count):
            background_color = setBackgroundColor(i)
            text = GL_All[i].strip(' ')
            OpenGLExt_list.append([text.strip('\n'), background_color])
Esempio n. 5
0
    def Limits(GPUname):

        for i in range(len(list)):
            if GPUname == i:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/VkPhysicalDeviceSparseProperties:/{flag=0}flag'| awk '/--/{flag=1 ; next} flag' | sort > /tmp/VKDlimits1.txt"
                    % i)

        os.system(
            "cat /tmp/VKDlimits1.txt | awk '{gsub(/=.*/,'True');}1' > /tmp/VKDlimits.txt"
        )
        os.system(
            "cat /tmp/VKDlimits1.txt | grep -o '=.*' | grep -o '[ -].*' > /tmp/VKDlimits2.txt"
        )

        value = copyContentsFromFile("/tmp/VKDlimits2.txt")

        # finding and converting any hexadecimal value to decimal

        for i in range(len(value)):
            if "0x" in value[i]:
                value[i] = str(int(value[i], 16))

        LimitsTab_Store.clear()
        TreeLimits.set_model(LimitsTab_Store)

        value = [i.strip(' ') for i in value]
        with open("/tmp/VKDlimits.txt", "r") as file1:
            i = 0
            for line in file1:
                text = line.strip('\t')
                background_color = setBackgroundColor(i)
                LimitsTab_Store.append(
                    [text.strip('\n'), value[i].strip('\n'), background_color])
                i = i + 1
Esempio n. 6
0
    def Features(GPUname):

        for i in range(len(list)):
            if GPUname == i:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/Format Properties:/{flag=0}flag' | awk '/VkPhysicalDeviceFeatures:/{flag=1; next}/Format Properties:/{flag=0}flag' | awk '/==/{flag=1 ; next} flag' | grep = | sort > /tmp/VKDFeatures1.txt"
                    % i)

        os.system(
            "cat /tmp/VKDFeatures1.txt | awk '{gsub(/= 1/,'True');print}' | awk '{gsub(/= 0/,'False');print}' > /tmp/VKDFeatures.txt"
        )

        fgColor, value = colorTrueFalse("/tmp/VKDFeatures1.txt", "= 1")

        FeaturesTab_Store.clear()
        TreeFeatures.set_model(FeaturesTab_Store)
        i = 0
        with open("/tmp/VKDFeatures.txt", "r") as file1:
            for line in file1:
                text = line.strip('\t')
                background_color = setBackgroundColor(i)
                FeaturesTab_Store.append([
                    text.strip('\n'), value[i].strip('\n'), background_color,
                    fgColor[i]
                ])
                i = i + 1
Esempio n. 7
0
def about(tab3):
    grid = Gtk.Grid()
    tab3.add(grid)
    frame1 = Gtk.Frame(label="")
    grid.attach(frame1, 0, 1, 12, 1)
#    grid.set_row_spacing(20)
#    grid.set_column_spacing(20)
    screen = Gdk.Screen.get_default()
    About_list = Gtk.ListStore(str, str)

    with open("../About GPU Viewer", "r") as file1:
        for i, line in enumerate(file1):
            background_color = setBackgroundColor(i)
            About_list.append([line.strip('\n'), background_color])

    TreeAbout = Gtk.TreeView(About_list, expand=True)
    wrapWidth = screen.get_width() * 0.50

    for i, column_title in enumerate(Title1):
        renderer1 = Gtk.CellRendererText()
        renderer1.set_property("wrap-width", wrapWidth)
        renderer1.set_property("wrap-mode", Pango.WrapMode(0))
        column = Gtk.TreeViewColumn(column_title, renderer1, text=i)
        column.add_attribute(renderer1, "background", 1)
        column.set_alignment(0.5)
        TreeAbout.set_property("can-focus", False)
        TreeAbout.append_column(column)

    scrollable_treelist1 = createScrollbar(TreeAbout)
    frame1.add(scrollable_treelist1)

    Logimg = fetchImageFromUrl(Const.LOG_LOGO_PNG, Const.ICON_WIDTH, Const.ICON_HEIGHT2, True)
    Logbutton = getLinkButtonImg(Logimg, Const.CHANGE_LOG_LINK, Const.TOOLTIP_CHANGE_LOG)
    grid.attach_next_to(Logbutton, frame1, Gtk.PositionType.BOTTOM, 1, 1)

    Licenseimg = fetchImageFromUrl(Const.LICENSE_LOGO_PNG, Const.ICON_WIDTH, Const.ICON_HEIGHT2, True)
    Licensebutton = getLinkButtonImg(Licenseimg, Const.LICENSE_HTML_LINK, Const.TOOLTIP_LICENSE)
    grid.attach_next_to(Licensebutton, Logbutton, Gtk.PositionType.RIGHT, 1, 1)

    Faqimg = fetchImageFromUrl(Const.FAQ_LOGO_PNG, Const.ICON_WIDTH, Const.ICON_HEIGHT2, True)
    Faqbutton = getLinkButtonImg(Faqimg, Const.FAQ_LINK, Const.TOOLTIP_FAQ)
    grid.attach_next_to(Faqbutton, Licensebutton, Gtk.PositionType.RIGHT, 1, 1)

    Reportimg = fetchImageFromUrl(Const.BUG_LOGO_PNG, Const.ICON_WIDTH, Const.ICON_HEIGHT2, True)
    Reportbutton = getLinkButtonImg(Reportimg, Const.ISSUE_LINK, Const.TOOLTIP_BUG)
    grid.attach_next_to(Reportbutton, Faqbutton, Gtk.PositionType.RIGHT, 1, 1)

    Donateimg = fetchImageFromUrl(Const.DONATE_LOGO_PNG, Const.ICON_WIDTH, Const.ICON_HEIGHT2, True)
    Donatebutton = getLinkButtonImg(Donateimg, Const.PAYPAL_LINK, Const.TOOLTIP_DONATE)
    grid.attach_next_to(Donatebutton, Reportbutton, Gtk.PositionType.RIGHT, 1, 1)

    Githubimg = fetchImageFromUrl(Const.GITHUB_LOGO_PNG, Const.ICON_WIDTH, Const.ICON_HEIGHT2, True)
    Githubbutton = getLinkButtonImg(Githubimg, Const.GITHUB_LINK, Const.TOOLTIP_GITHUB)
    grid.attach_next_to(Githubbutton, Donatebutton, Gtk.PositionType.RIGHT, 1, 1)

    Contactimg = fetchImageFromUrl(Const.CONTACT_LOGO_PNG, Const.ICON_WIDTH, Const.ICON_HEIGHT2, True)
    Contactbutton = getLinkButtonImg(Contactimg, Const.EMAIL_LINK, Const.TOOLTIP_CONTACT)
    grid.attach_next_to(Contactbutton, Githubbutton, Gtk.PositionType.RIGHT, 1, 1)
Esempio n. 8
0
    def videoSurfaceLimits():
        os.system(
            "cat /tmp/gpu-viewer/vdpauinfo.txt | awk '/Video surface:/{flag=1;next}/Decoder capabilities:/{flag=0}flag' | awk '/-------.*/{flag=1;next}/Bitmap surface:/{flag=0}flag' | awk '/./' > /tmp/gpu-viewer/vdpauVideoSurfaceLimits.txt"
        )
        iter = surfaceVideoStore.append(
            None, ["Video Surface", "", "", "", Const.BGCOLOR3])
        with open("/tmp/gpu-viewer/vdpauVideoSurfaceLimits.txt", "r") as file1:
            for i, line in enumerate(file1):
                surfaceVideoStore.append(iter, [
                    line.split()[0].strip('\n'),
                    line.split()[1].strip('\n'),
                    line.split()[2].strip('\n'),
                    (' '.join(line.split()[3:]).strip('[]')),
                    setBackgroundColor(i)
                ])

        os.system(
            "cat /tmp/gpu-viewer/vdpauinfo.txt | awk '/Output surface:/{flag=1;next}/Bitmap surface:/{flag=0}flag' | awk '/-------.*/{flag=1;next}/Bitmap surface:/{flag=0}flag' | awk '/./' > /tmp/gpu-viewer/vdpauSurfaceOutputLimits.txt"
        )
        iter = surfaceVideoStore.append(
            None, ["Output Surface", "", "", "", Const.BGCOLOR3])
        with open("/tmp/gpu-viewer/vdpauSurfaceOutputLimits.txt", "r") as file:
            for i, line in enumerate(file):
                surfaceVideoStore.append(iter, [
                    line.split()[0].strip('\n'),
                    line.split()[1].strip('\n'),
                    line.split()[2], (' '.join(line.split()[4:]).strip('[]')),
                    setBackgroundColor(i)
                ])

        os.system(
            "cat /tmp/gpu-viewer/vdpauinfo.txt | awk '/Bitmap surface:/{flag=1;next}/Video mixer:/{flag=0}flag' | awk '/-------.*/{flag=1;next}/Video mixer:/{flag=0}flag' | awk '/./' > /tmp/gpu-viewer/vdpauSurfaceBitmapLimits.txt"
        )
        iter = surfaceVideoStore.append(
            None, ["Bitmap Surface", "", "", "", Const.BGCOLOR3])
        with open("/tmp/gpu-viewer/vdpauSurfaceBitmapLimits.txt", "r") as file:
            for i, line in enumerate(file):
                surfaceVideoStore.append(iter, [
                    line.split()[0].strip('\n'),
                    line.split()[1].strip('\n'),
                    line.split()[2].strip('\n'), "",
                    setBackgroundColor(i)
                ])

        treeSurfaceVideoLimits.expand_all()
Esempio n. 9
0
    def Radio(value):

        if 1 <= value <= 2:
            os.system(
                "cat /tmp/gpu-viewer/extensions.txt | awk 'gsub(/GL_|_.*/,'true')'| uniq > /tmp/gpu-viewer/Vendor.txt"
            )
            os.system(
                "cat /tmp/gpu-viewer/extensions.txt | awk 'gsub(/GLX_|_.*/,'true')'| uniq >> /tmp/gpu-viewer/Vendor.txt"
            )
            os.system(
                "cat /tmp/gpu-viewer/Vendor.txt | sort | uniq | grep -v GLX | grep -v GL$  > /tmp/gpu-viewer/Vendor1.txt"
            )

        if value == 3:
            os.system(
                "cat /tmp/gpu-viewer/extensions.txt | awk 'gsub(/EGL_|_.*/,'true')'| sort | uniq > /tmp/gpu-viewer/Vendor1.txt"
            )

        vCount = []
        vendorList = []
        with open("/tmp/gpu-viewer/Vendor1.txt", "r") as file1:
            for line in file1:
                vendorList.append(line)

        vendorList = [i.strip(' ') for i in vendorList]
        vendorList = [i.strip('\n ') for i in vendorList]
        vendorList.insert(0, "Total")

        with open("/tmp/gpu-viewer/extensions.txt", "r") as file1:
            for i in range(len(vendorList)):
                file1.seek(0, 0)
                GL_All = []
                for line in file1:
                    if vendorList[i] == "Total":
                        GL_All.append(line)
                    elif vendorList[i] != "Total":
                        if "_%s_" % vendorList[i] in line:
                            GL_All.append(line)
                vCount.append(len(GL_All))

        NewList = []
        for i in range(len(vendorList)):
            NewList.append("%s (%d)" % (vendorList[i], vCount[i]))

        VendorExt_list.clear()
        TreeVendor.set_model(VendorExt_list)
        Toggle = []
        for i in range(len(NewList) - 1):
            Toggle.append(False)
        Vendor_Store.clear()
        Vendor_Combo.set_model(Vendor_Store)
        Toggle.insert(True, 0)
        for i in range(len(NewList)):
            background_color = setBackgroundColor(i)
            VendorExt_list.append([NewList[i], Toggle[i], background_color])
            Vendor_Store.append([NewList[i]])
Esempio n. 10
0
    def Format(GPUname):

        for i in range(len(list)):
            if GPUname == i:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/Device Properties/{flag=0}flag'|awk '/Format Properties/{flag=1; next}/Device Properties/{flag=0} flag' | grep ^FORMAT_ | grep -o _.* | grep -o [a-zA-Z].* > /tmp/VKDFORMATS.txt"
                    % i)
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/Device Properties/{flag=0}flag'|awk '/Format Properties/{flag=1; next}/Device Properties/{flag=0} flag' | awk 'f{print;f=0} /linearTiling.*/{f=1}'> /tmp/VKDFORMATSlinear.txt"
                    % i)
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/Device Properties/{flag=0}flag'|awk '/Format Properties/{flag=1; next}/Device Properties/{flag=0} flag' | awk 'f{print;f=0} /optimalTiling.*/{f=1}'> /tmp/VKDFORMATSoptimal.txt"
                    % i)
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/Device Properties/{flag=0}flag'|awk '/Format Properties/{flag=1; next}/Device Properties/{flag=0} flag' | awk 'f{print;f=0} /bufferFeatures.*/{f=1}'> /tmp/VKDFORMATSBuffer.txt"
                    % i)

        linear = []
        optimal = []
        Buffer = []
        linearfg = []

        # Linear values

        linearfg, linear = colorTrueFalse("/tmp/VKDFORMATSlinear.txt", "VK")

        # Optimal Values
        optimalfg, optimal = colorTrueFalse("/tmp/VKDFORMATSoptimal.txt", "VK")

        # Buffer Values
        Bufferfg, Buffer = colorTrueFalse("/tmp/VKDFORMATSBuffer.txt", "VK")

        count = len(linear)
        # counting the number of formats supported
        Formats = 0
        for i in range(count):
            if linear[i] == "true" or optimal[i] == "true" or Buffer[
                    i] == "true":
                Formats = Formats + 1
        FormatsTab_Store.clear()
        TreeFormats.set_model(FormatsTab_Store)
        with open("/tmp/VKDFORMATS.txt", "r") as file1:
            file1.seek(0, 0)
            label = "Formats (%d)" % Formats
            notebook.set_tab_label(FormatsTab, Gtk.Label(label))
            i = 0
            for line in file1:
                background_color = setBackgroundColor(i)
                FormatsTab_Store.append([
                    line.strip('\n'), linear[i].strip('\n'),
                    optimal[i].strip('\n'), Buffer[i].strip('\n'),
                    background_color, linearfg[i], optimalfg[i], Bufferfg[i]
                ])
                i = i + 1
Esempio n. 11
0
    def showLimits(Combo, Limits_Store, TreeLimits,openGLLimits):
        k = 0
        count = 0
        limitValue = Combo.get_active_text()
        if "Show All OpenGL Hardware Core Limits" in limitValue or "Show All OpenGL Hardware Compatible Limits" in limitValue:
            os.system(
                "cat %s > /tmp/gpu-viewer/selectOpenglLimits.txt"%openGLLimits)

            os.system("cat /tmp/gpu-viewer/selectOpenglLimits.txt | awk '{gsub(/=.*/,'True');print}' > /tmp/gpu-viewer/OpenGLLimitsLHS.txt")
            os.system("cat /tmp/gpu-viewer/selectOpenglLimits.txt | grep -o =.* | grep -o ' .*' > /tmp/gpu-viewer/OpenGLLimitsRHS.txt")

        else:
            with open(openGLLimits,"r") as file1:
                for line in file1:
                    if limitValue in line:
                        os.system("cat %s | awk '/%s:/{flag=1;next}/:.*/{flag=0}flag' > /tmp/gpu-viewer/selectOpenglLimits.txt"%(openGLLimits,limitValue))
                        os.system("cat /tmp/gpu-viewer/selectOpenglLimits.txt | awk '{gsub(/=.*/,'True');print}' > /tmp/gpu-viewer/OpenGLLimitsLHS.txt")
                        os.system("cat /tmp/gpu-viewer/selectOpenglLimits.txt | grep -o =.* | grep -o ' .*' > /tmp/gpu-viewer/OpenGLLimitsRHS.txt")


        with open("/tmp/gpu-viewer/OpenGLLimitsLHS.txt", "r") as file1:
            temp = copyContentsFromFile("/tmp/gpu-viewer/OpenGLLimitsRHS.txt")
            LimitsRHS,LimitRHSValue = appendLimitsRHS("/tmp/gpu-viewer/selectOpenglLimits.txt",temp)

            Limits_Store.clear()
            TreeLimits.set_model(Limits_Store)
            for i, line in enumerate(file1):
                background_color = setBackgroundColor(k)
                k += 1
                TreeLimits.expand_all()
                text = line.strip(' ')
                if ("TEXTURE_FORMATS" in line or "SHADING_LANGUAGE" in line) and LimitRHSValue[i] == True:
                    try:
                        iter3 = Limits_Store.append(iter2, [text.strip('\n'), LimitsRHS[i].strip('\n'), background_color])
                    except Exception:
                        iter3 = Limits_Store.append(None, [text.strip('\n'), LimitsRHS[i].strip('\n'), background_color])
                    finally:
                        pass
                elif "      " in line and LimitRHSValue[i] == False and ":" not in line:
                    Limits_Store.append(iter3, [text.strip('\n'), LimitsRHS[i].strip('\n'), background_color])
                else:
                    if ":" in line:
                        k = 0
                        text = line[:-2]
                        count += 1
                        iter2 = Limits_Store.append(None,
                                                    [text.strip('\n'), LimitsRHS[i].strip('\n'), Const.BGCOLOR3])
                        continue
                    if count > 0 and "    " in line:
                        Limits_Store.append(iter2, [text.strip('\n'), LimitsRHS[i].strip('\n'), background_color])
                    else:
                        Limits_Store.append(None, [text.strip('\n'), LimitsRHS[i].strip('\n'), background_color])
Esempio n. 12
0
    def decoderCapabilities():

        os.system(
            "cat /tmp/gpu-viewer/vdpauinfo.txt | awk '/Decoder capabilities:/{flag=1;next}/Output surface:/{flag=0}flag' | awk '/------.*/{flag=1;next}/Output surface:/{flag=0}flag' | awk '/./'> /tmp/gpu-viewer/vdpauDecoder.txt"
        )
        with open("/tmp/gpu-viewer/vdpauDecoder.txt", "r") as file1:
            for i, line in enumerate(file1):
                if "not" in line:
                    decoderStore.append([
                        line.split()[0].strip('\n'), "not supported",
                        "not supported", "not supported", "not supported",
                        setBackgroundColor(i)
                    ])
                else:
                    decoderStore.append([
                        line.split()[0].strip('\n'),
                        line.split()[1].strip('\n'),
                        line.split()[2].strip('\n'),
                        line.split()[3].strip('\n'),
                        line.split()[4].strip('\n'),
                        setBackgroundColor(i)
                    ])
Esempio n. 13
0
    def GLXFB(button, value):
        FB_Store.clear()
        TreeFB.set_model(FB_Store)
        if value == 1:
            os.system(
                "glxinfo | awk '/GLX Visuals.*/{flag=1;next}/GLXFBConfigs.*/{flag=0}flag' | awk '/----.*/{flag=1;next}flag' > /tmp/FrameBufferGLXVisual.txt"
            )

            list = []
            with open("/tmp/FrameBufferGLXVisual.txt", "r") as file1:
                for line in file1:
                    list.append(line.split())

            for i in range(len(list) - 1):
                background_color = setBackgroundColor(i)
                FB_Store.append(list[i] + [background_color])
            label = "%d GLX Visuals" % (len(list) - 1)
            button.set_label(label)

        if value == 2:

            os.system(
                "glxinfo | awk '/GLXFBConfigs.*/{flag=1;next}flag' | awk '/----.*/{flag=1;next}flag' > /tmp/FrameBufferGLXFBconfigs.txt"
            )

            list = []
            with open("/tmp/FrameBufferGLXFBconfigs.txt", "r") as file1:
                for line in file1:
                    list.append(line.split())

            for i in range(len(list) - 1):
                background_color = setBackgroundColor(i)
                if list[i][6] == "r" or list[i][6] == "c":
                    pass
                else:
                    list[i].insert(6, ".")
                FB_Store.append(list[i] + [background_color])
            label = "%d  GLXFBConfigs" % (len(list) - 1)
            button.set_label(label)
Esempio n. 14
0
    def Surface(GPUname):

        for GPU in range(len(list)):
            if GPUname == GPU:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/Presentable Surfaces.*/{flag=1;next}/Device Properties and Extensions.*/{flag=0}flag' | awk '/GPU id       : %d.*/{flag=1;next}/GPU id       : %d.*/{flag=0}flag' | awk '/VkSurfaceCapabilities.*/{flag=1}/Device Properties.*/{flag=0}flag'> /tmp/VKDsurface.txt"
                    % (GPU, GPU + 1))
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/Presentable Surfaces.*/{flag=1;next}/Device Properties and Extensions.*/{flag=0}flag' | awk '/GPU id       : %d.*/{flag=1;next}/VkSurfaceCapabilities.*/{flag=0}flag' | awk '{gsub(/count =.*/,'True');print}' | grep -v type >> /tmp/VKDsurface.txt"
                    % GPU)

        os.system(
            "cat /tmp/VKDsurface.txt | awk '{gsub(/= .*/,'True');print} ' > /tmp/VKDsurface1.txt"
        )
        os.system(
            "cat /tmp/VKDsurface.txt | grep -o =.* | grep -o ' .*' > /tmp/VKDsurface2.txt"
        )
        temp = []

        temp = copyContentsFromFile("/tmp/VKDsurface2.txt")
        SurfaceRHS = []
        i = 0
        with open("/tmp/VKDsurface.txt", "r") as file1:
            for line in file1:
                if "= " in line:
                    SurfaceRHS.append(temp[i])
                    i = i + 1
                else:
                    SurfaceRHS.append(" ")

        Surface = []
        with open("/tmp/VKDsurface1.txt", "r") as file1:
            for line in file1:
                Surface.append(line)

        Surface = [i.strip('\n ') for i in Surface]
        SurfaceTab_Store.clear()
        TreeSurface.set_model(SurfaceTab_Store)

        for i in range(len(Surface)):
            if "====" in Surface[i]:
                continue
            if "type" in Surface[i]:
                continue
            background_color = setBackgroundColor(i)
            if "VkSurfaceCapabilities" in Surface[i] or "Modes" in Surface[i] or "Formats" in Surface[i] or "Extent" in \
                    Surface[i] or "supported" in Surface[i] or "current" in Surface[i]:
                background_color = Const.BGCOLOR3
            text = Surface[i].strip('\t')
            SurfaceTab_Store.append(
                [text, SurfaceRHS[i].strip('\n'), background_color])
Esempio n. 15
0
    def _getinstalledapplications(self):

        os.system("eopkg list-installed > installedPackages.txt")
        os.system("cat installedPackages.txt | grep -o ' -.*' > installedPackageDescription.txt")
        os.system("cat installedPackages.txt | awk '{gsub(/ -.*/,'True');print}' > installedPackageNames.txt ")

        installedPackageDescription = copyContentsFromFile("installedPackageDescription.txt")
        installedPackageName = copyContentsFromFile("installedPackageNames.txt")

        package_count = len(installedPackageName)
        installationCheck = []
        background_color = []
        for i in range(len(installedPackageName)):
            installationCheck.append(True)
            background_color = setBackgroundColor(i)
            installedStore.append([installationCheck[i],installedPackageName[i].strip('\n'),installedPackageDescription[i].strip('\n'),background_color])
Esempio n. 16
0
    def Extensions(GPUname):

        for i in range(len(list)):
            if GPUname == i:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/VkQueueFamilyProperties/{flag=0}flag'|awk '/Device Extensions/{flag=1; next}/VkQueueFamilyProperties/{flag=0} flag' | grep VK_ | sort > /tmp/VKDExtensions1.txt"
                    % i)

        os.system(
            "cat /tmp/VKDExtensions1.txt | awk '{gsub(/:.*/,'True');print} ' > /tmp/VKDExtensions.txt"
        )

        # This should take care of further versioning till 100
        with open("/tmp/VKDExtensions1.txt", "r") as file1:
            value = []
            for line in file1:
                for j in range(RANGE1):
                    if ": extension revision %2d" % j in line:
                        value.append("0.0.%d" % j)
                        break

        ExtensionTab_Store.clear()
        TreeExtension.set_model(ExtensionTab_Store)

        with open("/tmp/VKDExtensions.txt", "r") as file1:
            count = len(file1.readlines())
            label = "Extensions (%d)" % count
            notebook.set_tab_label(ExtensionTab, Gtk.Label(label))
            file1.seek(0, 0)
            i = 0
            for line in file1:
                text = line.strip('\t')
                background_color = setBackgroundColor(i)
                ExtensionTab_Store.append(
                    [text.strip('\n'), value[i].strip('\n'), background_color])
                i = i + 1
Esempio n. 17
0
    def VideoMixerFeature():

        os.system(
            "cat /tmp/gpu-viewer/vdpauinfo.txt | awk '/feature name/{flag=1;next}/parameter name.*/{flag=0}flag' | awk '/-------.*/{flag=1;next}/Output surface:/{flag=0}flag' | awk '/./' > /tmp/gpu-viewer/vdpauVideoMixerFeature.txt"
        )

        iter = videoMixerFeatureStore.append(
            None, ["Features", "", Const.BGCOLOR3, ""])
        with open("/tmp/gpu-viewer/vdpauVideoMixerFeature.txt", "r") as file2:
            for i, line in enumerate(file2):
                if 'y' in line:
                    text = "true"
                    fgcolor = Const.COLOR1
                else:
                    text = "false"
                    fgcolor = Const.COLOR2
                if "HIGH" in line:
                    videoMixerFeatureStore.append(
                        iter, [(' '.join(line.split()[0:5])).strip('[]'), text,
                               setBackgroundColor(i), fgcolor])
                else:
                    videoMixerFeatureStore.append(iter, [
                        line.split()[0].strip('\n'), text,
                        setBackgroundColor(i), fgcolor
                    ])

        os.system(
            "cat /tmp/gpu-viewer/vdpauinfo.txt | awk '/parameter name/{flag=1;next}/attribute name.*/{flag=0}flag' | awk '/-------.*/{flag=1;next}/Output surface:/{flag=0}flag' | awk '/./' > /tmp/gpu-viewer/vdpauVideoMixerParameter.txt"
        )

        iter = videoMixerFeatureStore.append(
            None, ["Parameters", "", Const.BGCOLOR3, ""])
        with open("/tmp/gpu-viewer/vdpauVideoMixerParameter.txt",
                  "r") as file2:
            for i, line in enumerate(file2):
                if line.split()[1].strip('\n') == 'y':
                    text = "true"
                    fgcolor = Const.COLOR1
                else:
                    text = "false"
                    fgcolor = Const.COLOR2
                videoMixerFeatureStore.append(iter, [
                    line.split()[0].strip('\n'), text,
                    setBackgroundColor(i), fgcolor
                ])

        os.system(
            "cat /tmp/gpu-viewer/vdpauinfo.txt | awk '/Video mixer:/{flag=1;next}/Output surface:/{flag=0}flag' | awk '/attribute name/{flag=1;next}/Output surface:/{flag=0}flag' | awk '/-------.*/{flag=1;next}/Output surface:/{flag=0}flag' | awk '/./' > /tmp/gpu-viewer/vdpauVideoMixerAttribute.txt"
        )

        iter = videoMixerFeatureStore.append(
            None, ["Attributes", "", Const.BGCOLOR3, ""])
        with open("/tmp/gpu-viewer/vdpauVideoMixerAttribute.txt",
                  "r") as file2:
            for i, line in enumerate(file2):
                if line.split()[1].strip('\n') == 'y':
                    text = "true"
                    fgcolor = Const.COLOR1
                else:
                    text = "false"
                    fgcolor = Const.COLOR2
                videoMixerFeatureStore.append(iter, [
                    line.split()[0].strip('\n'), text,
                    setBackgroundColor(i), fgcolor
                ])

        treeVideoMixerFeature.expand_all()
Esempio n. 18
0
    def Instance():

        os.system(
            "cat /tmp/vulkaninfo.txt | awk '/Instance Extensions	count.*/{flag=1;next}/Layers: count.*/{flag=0}flag'| grep VK_ | sort > /tmp/VKDInstanceExtensions1.txt"
        )
        os.system(
            "cat /tmp/VKDInstanceExtensions1.txt | awk '{gsub(/:.*/,'True');print} ' > /tmp/VKDInstanceExtensions.txt"
        )

        # This should take care of further versioning till RANGE1
        with open("/tmp/VKDInstanceExtensions1.txt", "r") as file1:
            value = []
            for line in file1:
                for j in range(RANGE1):
                    if ": extension revision %2d" % j in line:
                        value.append("0.0.%d" % j)
                        break
        InstanceTab_Store.clear()
        TreeInstance.set_model(InstanceTab_Store)
        with open("/tmp/VKDInstanceExtensions.txt", "r") as file1:
            count1 = len(file1.readlines())
            label = "Instances (%d)" % count1
            notebook.set_tab_label(InstanceTab, Gtk.Label(label))
            file1.seek(0, 0)
            i = 0
            for line in file1:
                text = line.strip('\t')
                background_color = setBackgroundColor(i)
                InstanceTab_Store.append(
                    [text.strip('\n'), value[i].strip('\n'), background_color])
                i = i + 1

        os.system(
            "cat /tmp/vulkaninfo.txt | awk '/Layers: count.*/{flag=1;next}/Presentable Surfaces.*/{flag=0}flag' > /tmp/VKDLayer1.txt"
        )
        os.system(
            "cat /tmp/VKDLayer1.txt | grep _LAYER_ | awk '{gsub(/\(.*/,'True');print} ' > /tmp/VKDLayer.txt"
        )

        Vversion = []
        with open("/tmp/VKDLayer1.txt", "r") as file1:
            for line in file1:
                for j in range(RANGE1):
                    if "Vulkan version 1.0.%d," % j in line:
                        Vversion.append("1.0.%d" % j)

        LVersion = []
        with open("/tmp/VKDLayer1.txt", "r") as file1:
            for line in file1:
                for j in range(RANGE1):
                    if "layer version %d" % j in line:
                        LVersion.append("0.0.%d" % j)
                        break

        ECount = []
        with open("/tmp/VKDLayer1.txt", "r") as file1:
            for line in file1:
                for j in range(RANGE1):
                    if "Layer Extensions	count = %d" % j in line:
                        ECount.append("%d" % j)
                        break

        LayerTab_Store.clear()
        TreeLayer.set_model(LayerTab_Store)
        count2 = len(LVersion)
        label = "Instances (%d) & Layers (%d)" % (count1, count2)
        notebook.set_tab_label(InstanceTab, Gtk.Label(label))
        with open("/tmp/VKDLayer.txt", "r") as file1:
            i = 0
            for line in file1:
                background_color = setBackgroundColor(i)
                LayerTab_Store.append([
                    line.strip('\n'), Vversion[i].strip('\n'),
                    LVersion[i].strip('\n'), ECount[i].strip('\n'),
                    background_color
                ])
                i = i + 1
Esempio n. 19
0
    def Devices(GPUname):

        for i in range(len(list)):
            if GPUname == i:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/VkPhysicalDeviceLimits:/{flag=0}flag' | awk '/==.*/{flag=1;next}flag' | grep -v driver > /tmp/VKDDeviceinfo1.txt"
                    % i)

        os.system(
            "cat /tmp/VKDDeviceinfo1.txt | awk '{gsub(/=.*/,'True');}1' > /tmp/VKDDeviceinfo.txt"
        )
        os.system(
            "cat /tmp/VKDDeviceinfo1.txt | grep -o =.* | grep -o ' .*' > /tmp/VKDDeviceinfo2.txt"
        )

        # Storing the RHS values into a list

        value = copyContentsFromFile("/tmp/VKDDeviceinfo2.txt")

        # This should take care of api version from 0.0.0 to 5.9.99
        for i in range(5):
            for k in range(10):
                for j in range(RANGE1):
                    if "(%d.%d.%d)" % (i, k, j) in value[0]:
                        value[0] = " %d.%d.%d" % (i, k, j)
                        break

        for i in range(len(value)):
            if i > 0:
                if "0x" in value[i]:
                    value[i] = int(value[i], 16)
                    value[i] = str(" %d" % value[i])

        # Printing the Details into the Treeview

        DeviceTab_Store.clear()
        TreeDevice.set_model(DeviceTab_Store)

        with open("/tmp/VKDDeviceinfo.txt", "r") as file1:
            file1.seek(0, 0)
            i = 0
            for line in file1:
                text = line.strip('\t')
                background_color = setBackgroundColor(i)
                DeviceTab_Store.append(
                    [text.strip('\n'), value[i].strip('\n'), background_color])
                i = i + 1

        for i in range(len(list)):
            if GPUname == i:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/Device Extensions.*/{flag=0}flag' | awk '/VkPhysicalDeviceSparseProperties:/{flag=1;next}/Device Extensions.*/{flag=0}flag' | grep = | sort > /tmp/VKDDevicesparseinfo1.txt"
                    % i)

        os.system(
            "cat /tmp/VKDDevicesparseinfo1.txt | awk '{gsub(/=.*/,'True');}1' > /tmp/VKDDevicesparseinfo.txt"
        )

        fgColor, value = colorTrueFalse("/tmp/VKDDevicesparseinfo1.txt", "= 1")

        SparseTab_Store.clear()
        TreeSparse.set_model(SparseTab_Store)
        with open("/tmp/VKDDevicesparseinfo.txt", "r") as file1:
            file1.seek(0, 0)
            i = 0
            for line in file1:
                text = line.strip('\t')
                background_color = setBackgroundColor(i)
                SparseTab_Store.append([
                    text.strip('\n'), value[i].strip('\n'), background_color,
                    fgColor[i]
                ])
                i = i + 1
Esempio n. 20
0
    def Queues(GPUname):

        for i in range(len(list)):
            if GPUname == i:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/VkPhysicalDeviceMemoryProperties:/{flag=0}flag'|awk '/VkQueue.*/{flag=1; next}/VkPhysicalDeviceMemoryProperties:/{flag=0} flag' > /tmp/VKDQueues.txt"
                    % i)

        os.system(
            "cat /tmp/VKDQueues.txt | grep Count | grep -o =.* | grep -o ' .*' > /tmp/VKDQueuecount.txt"
        )
        os.system(
            "cat /tmp/VKDQueues.txt | grep times | grep -o =.* | grep -o ' .*' > /tmp/VKDQueuebits.txt"
        )
        os.system(
            "cat /tmp/VKDQueues.txt | grep Flags | grep -o =.* | grep -o ' .*' > /tmp/VKDQueueFlags.txt"
        )

        qCount = []
        qBits = []
        GBit = []
        CBit = []
        TBit = []
        SBit = []
        width = []
        height = []
        depth = []
        Gfg = []
        Cfg = []
        Tfg = []
        Sfg = []

        with open("/tmp/VKDQueues.txt", "r") as file1:
            for line in file1:
                for i in range(10):
                    for j in range(10):
                        for k in range(10):
                            if "(%d, %d, %d)" % (i, j, k) in line:
                                width.append("%d" % i)
                                height.append("%d" % j)
                                depth.append("%d" % k)

        # finding and storing the value for Flags
        Gfg, GBit = colorTrueFalse("/tmp/VKDQueueFlags.txt", "GRAPHICS")
        Cfg, CBit = colorTrueFalse("/tmp/VKDQueueFlags.txt", "COMPUTE")
        Tfg, TBit = colorTrueFalse("/tmp/VKDQueueFlags.txt", "TRANSFER")
        Sfg, SBit = colorTrueFalse("/tmp/VKDQueueFlags.txt", "SPARSE")

        qCount = copyContentsFromFile("/tmp/VKDQueuecount.txt")

        qBits = copyContentsFromFile("/tmp/VKDQueuebits.txt")

        QueueTab_Store.clear()
        TreeQueue.set_model(QueueTab_Store)
        for i in range(len(qCount)):
            background_color = setBackgroundColor(i)
            QueueTab_Store.append([
                i,
                int(qCount[i]),
                int(qBits[i]), GBit[i], CBit[i], TBit[i], SBit[i], width[i],
                height[i], depth[i], background_color, Gfg[i], Cfg[i], Tfg[i],
                Sfg[i]
            ])
        label = "Queues (%d)" % len(qCount)
        notebook.set_tab_label(QueueTab, Gtk.Label(label))
Esempio n. 21
0
    def MemoryTypes(GPUname):

        for i in range(len(list)):
            if GPUname == i:
                os.system(
                    "cat /tmp/vulkaninfo.txt | awk '/GPU%d/{flag=1;next}/VkPhysicalDeviceFeatures:/{flag=0}flag'|awk '/VkPhysicalDeviceMemoryProperties:/{flag=1; next}/VkPhysicalDeviceFeatures:/{flag=0} flag' > /tmp/VKDMemoryType.txt"
                    % i)

        with open("/tmp/VKDMemoryType.txt", "r") as file1:
            heapIndex = []
            for line in file1:
                for j in range(RANGE1):
                    if "heapIndex" in line:
                        if "= %d" % j in line:
                            heapIndex.append(j)
                            break

        Device_Local = []
        Host_Visible = []
        Host_Coherent = []
        Host_Cached = []
        Lazily_Allocated = []
        Flags = []
        Mcount = 0
        LAfg = []
        HCAfg = []
        HCOfg = []
        HVfg = []
        DLfg = []

        with open("/tmp/VKDMemoryType.txt", "r") as file1:
            for line in file1:
                if "memoryTypes" in line:
                    Mcount = Mcount + 1
                for i in range(32):
                    if " %s:" % hex(i) in line:
                        dec = int(hex(i), 16)
                        binary = bin(dec)[2:]
                        for j in range(len(binary)):
                            if binary[j] == '0':
                                Flags.insert(j, "false")
                            if binary[j] == '1':
                                Flags.insert(j, "true")
                        for j in range(5 - len(binary)):
                            Flags.insert(0, "false")
                        for i in range(len(Flags)):
                            if i == 0:
                                Lazily_Allocated.append(Flags[i])
                                if Flags[i] == "false":
                                    LAfg.append(Const.COLOR2)
                                else:
                                    LAfg.append(Const.COLOR1)
                            elif i == 1:
                                Host_Cached.append(Flags[i])
                                if Flags[i] == "false":
                                    HCAfg.append(Const.COLOR2)
                                else:
                                    HCAfg.append(Const.COLOR1)
                            elif i == 2:
                                Host_Coherent.append(Flags[i])
                                if Flags[i] == "false":
                                    HCOfg.append(Const.COLOR2)
                                else:
                                    HCOfg.append(Const.COLOR1)
                            elif i == 3:
                                Host_Visible.append(Flags[i])
                                if Flags[i] == "false":
                                    HVfg.append(Const.COLOR2)
                                else:
                                    HVfg.append(Const.COLOR1)
                            elif i == 4:
                                Device_Local.append(Flags[i])
                                if Flags[i] == "false":
                                    DLfg.append(Const.COLOR2)
                                else:
                                    DLfg.append(Const.COLOR1)

        MemoryTab_Store.clear()
        TreeMemory.set_model(MemoryTab_Store)
        for i in range(Mcount):
            background_color = setBackgroundColor(i)
            MemoryTab_Store.append([
                i, heapIndex[i], Device_Local[i].strip('\n'),
                Host_Visible[i].strip('\n'), Host_Coherent[i].strip('\n'),
                Host_Cached[i].strip('\n'), Lazily_Allocated[i].strip('\n'),
                background_color, DLfg[i], HVfg[i], HCOfg[i], HCAfg[i], LAfg[i]
            ])

        HCount = 0
        size = []
        HEAP_DEVICE_LOCAL = []

        with open("/tmp/VKDMemoryType.txt", "r") as file1:
            Heapfg = []
            for line in file1:
                if "memoryHeaps" in line:
                    HCount = HCount + 1
                if "HEAP_DEVICE_LOCAL" in line:
                    HEAP_DEVICE_LOCAL.append("true")
                    Heapfg.append(Const.COLOR1)
                if "None" in line:
                    HEAP_DEVICE_LOCAL.append("false")
                    Heapfg.append(Const.COLOR2)
                if "size " in line:
                    for j in range(1024):
                        for k in range(RANGE1):
                            if "(%d.%02d GiB)" % (j, k) in line:
                                size.append("%d.%02d GB" % (j, k))
                                break
                            elif "(%d.%02d MiB)" % (j, k) in line:
                                size.append("%d.%02d MB" % (j, k))
                                break

        HeapTab_Store.clear()
        TreeHeap.set_model(HeapTab_Store)

        for i in range(HCount):
            background_color = setBackgroundColor(i)
            HeapTab_Store.append([
                i, size[i].strip('\n'), HEAP_DEVICE_LOCAL[i].strip('\n'),
                background_color, Heapfg[i]
            ])

        label = "Memory Types (%d) & Heaps (%d)" % (Mcount, HCount)
        notebook.set_tab_label(MemoryTab, Gtk.Label(label))
Esempio n. 22
0
def OpenGL(tab1):
    grid = Gtk.Grid()
    grid.set_row_spacing(10)
    grid.set_column_spacing(10)
    tab1.add(grid)
    grid4 = Gtk.Grid()
    #    grid4.set_row_spacing(5)
    frame1 = Gtk.Frame(label="", expand=True)
    grid.attach(frame1, 0, 0, 12, 1)
    frame1.add(grid4)
    OpenGLInfo_list = Gtk.ListStore(str, str, str)
    os.system("glxinfo -s > /tmp/gpu-viewer/glxinfo.txt")
    os.system(
        "cat /tmp/gpu-viewer/glxinfo.txt | grep string | grep -v glx > /tmp/gpu-viewer/OpenGL_Information.txt"
    )
    os.system(
        "es2_info | awk '/EGL_VERSION|VENDOR/' >> /tmp/gpu-viewer/OpenGL_Information.txt"
    )
    os.system(
        "cat /tmp/gpu-viewer/OpenGL_Information.txt | grep -o :.* | grep -o ' .*' > /tmp/gpu-viewer/OpenGLRHS.txt"
    )
    os.system(
        "cat /tmp/gpu-viewer/glxinfo.txt | grep memory: | grep -o :.* | grep -o ' .*' >> /tmp/gpu-viewer/OpenGLRHS.txt"
    )
    os.system(
        "cat /tmp/gpu-viewer/OpenGL_Information.txt | awk '{gsub(/string|:.*/,'True');print}' > /tmp/gpu-viewer/OpenGLLHS.txt"
    )
    os.system(
        "cat /tmp/gpu-viewer/glxinfo.txt | grep memory: | awk '{gsub(/:.*/,'True');print}' >> /tmp/gpu-viewer/OpenGLLHS.txt"
    )
    value = copyContentsFromFile("/tmp/gpu-viewer/OpenGLRHS.txt")

    with open("/tmp/gpu-viewer/OpenGLLHS.txt", "r") as file1:
        for i, line in enumerate(file1):
            text = line.strip(" ")
            background_color = setBackgroundColor(i)
            OpenGLInfo_list.append(
                [text.strip('\n'), value[i].strip('\n'), background_color])

    TreeGL = Gtk.TreeView(OpenGLInfo_list, expand=True)
    # TreeGL.set_enable_search(True)
    setColumns(TreeGL, Title2, Const.MWIDTH, 0.0)

    scrollable_treelist = createScrollbar(TreeGL)
    grid4.add(scrollable_treelist)

    def clickme(button):

        button.set_sensitive(False)
        os.system(
            "glxinfo -l | awk '/OpenGL core profile limits:/{flag=1}/GLX Visuals.*/{flag=0} flag' | awk '/OpenGL core profile limits:/{flag=1;next}/OpenGL version string.*/{flag=0} flag' | awk '/./'  > /tmp/gpu-viewer/OpenGL_Core_Limits.txt"
        )
        os.system(
            "cat /tmp/gpu-viewer/OpenGL_Core_Limits.txt | awk '{gsub(/=.*/,'True');print}' > /tmp/gpu-viewer/OpenGLCoreLimitsLHS.txt"
        )
        LimitsWin = Gtk.Window()
        LimitsWin.set_title("OpenGL Hardware Limits")
        #    LimitsWin.set_size_request(1000, 500)
        setScreenSize(LimitsWin, Const.WIDTH_RATIO, Const.HEIGHT_RATIO2)
        LimitsWin.set_border_width(10)
        LimitsNotebook = Gtk.Notebook()
        LimitsWin.add(LimitsNotebook)
        LimitsCoreTab = Gtk.Box("spacing=10")
        LimitsNotebook.add(LimitsCoreTab)
        LimitsNotebook.set_tab_label(LimitsCoreTab, Gtk.Label("\tCore\t"))
        LimitsCoreFrame = Gtk.Frame()
        limitsCombo = Gtk.ComboBoxText()

        # get Combo box value

        limitsCombo.remove_all()
        with open("/tmp/gpu-viewer/OpenGLCoreLimitsLHS.txt", "r") as file1:
            for line in file1:
                if ":" in line:
                    text = line[:-2]
                    limitsCombo.append_text(text.strip(" "))

        limitsCombo.insert_text(0, "Show All OpenGL Hardware Core Limits")

        LimitsCoreTab.add(LimitsCoreFrame)
        LimitsGrid = Gtk.Grid()
        LimitsGrid.set_row_spacing(5)
        LimitsCoreFrame.add(LimitsGrid)
        LimitsGrid.add(limitsCombo)
        LimitsCore_Store = Gtk.TreeStore(str, str, str)
        TreeCoreLimits = Gtk.TreeView(LimitsCore_Store, expand=True)
        TreeCoreLimits.set_property("enable-tree-lines", True)

        limitsCombo.connect("changed", showLimits, LimitsCore_Store,
                            TreeCoreLimits,
                            "/tmp/gpu-viewer/OpenGL_Core_Limits.txt")
        limitsCombo.set_active(0)

        #    showLimits(LimitRHSValue, LimitsRHS, LimitsCore_Store, TreeCoreLimits,"/tmp/gpu-viewer/OpenGLCoreLimitsLHS.txt")

        setColumns(TreeCoreLimits, LimitsTitle, Const.MWIDTH, 0.0)
        LimitsCoreScrollbar = createScrollbar(TreeCoreLimits)
        LimitsGrid.attach_next_to(LimitsCoreScrollbar, limitsCombo,
                                  Gtk.PositionType.BOTTOM, 1, 1)

        os.system(
            "glxinfo -l | awk '/OpenGL limits:/{flag=1}/GLX Visuals.*/{flag=0} flag' | awk '/OpenGL limits:/{flag=1;next}/OpenGL ES profile/{flag=0} flag' | awk '/./'  > /tmp/gpu-viewer/OpenGL_Limits.txt"
        )
        os.system(
            "cat /tmp/gpu-viewer/OpenGL_Limits.txt | awk '{gsub(/=.*/,'True');print}' > /tmp/gpu-viewer/OpenGLLimitsLHS.txt"
        )
        LimitsCompatTab = Gtk.Box("spacing=10")
        LimitsNotebook.add(LimitsCompatTab)
        LimitsNotebook.set_tab_label(LimitsCompatTab,
                                     Gtk.Label("    Compat.\t"))
        LimitsCompatFrame = Gtk.Frame()
        limitsCompatCombo = Gtk.ComboBoxText()

        limitsCompatCombo.remove_all()
        with open("/tmp/gpu-viewer/OpenGLLimitsLHS.txt", "r") as file1:
            for line in file1:
                if ":" in line:
                    text = line[:-2]
                    limitsCompatCombo.append_text(text.strip(" "))

        limitsCompatCombo.insert_text(
            0, "Show All OpenGL Hardware Compatible Limits")

        LimitsCompatTab.add(LimitsCompatFrame)
        limitsCompatGrid = Gtk.Grid()
        limitsCompatGrid.set_row_spacing(5)
        LimitsCompatFrame.add(limitsCompatGrid)
        limitsCompatGrid.add(limitsCompatCombo)
        LimitsCompat_Store = Gtk.TreeStore(str, str, str)
        TreeCompatLimits = Gtk.TreeView(LimitsCompat_Store, expand=True)
        TreeCompatLimits.set_property("enable-tree-lines", True)

        limitsCompatCombo.connect("changed", showLimits, LimitsCompat_Store,
                                  TreeCompatLimits,
                                  "/tmp/gpu-viewer/OpenGL_Limits.txt")
        limitsCompatCombo.set_active(0)

        #   showLimits(LimitRHSValue2, LimitsRHS2, LimitsCompat_Store, TreeCompatLimits,"/tmp/gpu-viewer/OpenGLLimitsLHS.txt")

        setColumns(TreeCompatLimits, LimitsTitle, Const.MWIDTH, 0.0)
        LimitsCompatScrollbar = createScrollbar(TreeCompatLimits)
        limitsCompatGrid.attach_next_to(LimitsCompatScrollbar,
                                        limitsCompatCombo,
                                        Gtk.PositionType.BOTTOM, 1, 1)

        def button_enable(win, value):
            button.set_sensitive(True)

        LimitsWin.connect("delete-event", button_enable)

        LimitsWin.show_all()

    def showLimits(Combo, Limits_Store, TreeLimits, openGLLimits):
        k = 0
        count = 0
        limitValue = Combo.get_active_text()
        if "Show All OpenGL Hardware Core Limits" in limitValue or "Show All OpenGL Hardware Compatible Limits" in limitValue:
            os.system("cat %s > /tmp/gpu-viewer/selectOpenglLimits.txt" %
                      openGLLimits)

            os.system(
                "cat /tmp/gpu-viewer/selectOpenglLimits.txt | awk '{gsub(/=.*/,'True');print}' > /tmp/gpu-viewer/OpenGLLimitsLHS.txt"
            )
            os.system(
                "cat /tmp/gpu-viewer/selectOpenglLimits.txt | grep -o =.* | grep -o ' .*' > /tmp/gpu-viewer/OpenGLLimitsRHS.txt"
            )

        else:
            with open(openGLLimits, "r") as file1:
                for line in file1:
                    if limitValue in line:
                        os.system(
                            "cat %s | awk '/%s:/{flag=1;next}/:.*/{flag=0}flag' > /tmp/gpu-viewer/selectOpenglLimits.txt"
                            % (openGLLimits, limitValue))
                        os.system(
                            "cat /tmp/gpu-viewer/selectOpenglLimits.txt | awk '{gsub(/=.*/,'True');print}' > /tmp/gpu-viewer/OpenGLLimitsLHS.txt"
                        )
                        os.system(
                            "cat /tmp/gpu-viewer/selectOpenglLimits.txt | grep -o =.* | grep -o ' .*' > /tmp/gpu-viewer/OpenGLLimitsRHS.txt"
                        )

        with open("/tmp/gpu-viewer/OpenGLLimitsLHS.txt", "r") as file1:
            temp = copyContentsFromFile("/tmp/gpu-viewer/OpenGLLimitsRHS.txt")
            LimitsRHS, LimitRHSValue = appendLimitsRHS(
                "/tmp/gpu-viewer/selectOpenglLimits.txt", temp)

            Limits_Store.clear()
            TreeLimits.set_model(Limits_Store)
            for i, line in enumerate(file1):
                background_color = setBackgroundColor(k)
                k += 1
                TreeLimits.expand_all()
                text = line.strip(' ')
                if ("TEXTURE_FORMATS" in line or "SHADING_LANGUAGE"
                        in line) and LimitRHSValue[i] == True:
                    try:
                        iter3 = Limits_Store.append(iter2, [
                            text.strip('\n'), LimitsRHS[i].strip('\n'),
                            background_color
                        ])
                    except Exception:
                        iter3 = Limits_Store.append(None, [
                            text.strip('\n'), LimitsRHS[i].strip('\n'),
                            background_color
                        ])
                    finally:
                        pass
                elif "      " in line and LimitRHSValue[
                        i] == False and ":" not in line:
                    Limits_Store.append(iter3, [
                        text.strip('\n'), LimitsRHS[i].strip('\n'),
                        background_color
                    ])
                else:
                    if ":" in line:
                        k = 0
                        text = line[:-2]
                        count += 1
                        iter2 = Limits_Store.append(None, [
                            text.strip('\n'), LimitsRHS[i].strip('\n'),
                            Const.BGCOLOR3
                        ])
                        continue
                    if count > 0 and "    " in line:
                        Limits_Store.append(iter2, [
                            text.strip('\n'), LimitsRHS[i].strip('\n'),
                            background_color
                        ])
                    else:
                        Limits_Store.append(None, [
                            text.strip('\n'), LimitsRHS[i].strip('\n'),
                            background_color
                        ])

#  LimitsFrame = Gtk.Frame()
#  grid.attach(LimitsFrame, 0, 1, 2, 1)

    Button_Limits = Gtk.Button("Show OpenGL Limits")
    Button_Limits.connect("clicked", clickme)
    grid.attach(Button_Limits, 0, 1, 2, 1)
    #  LimitsFrame.add(Button_Limits)
    # grid4.attach(Button_Limits, 0, 1, 2, 1)

    # vendorFrame = Gtk.Frame()
    # grid.attach_next_to(vendorFrame,LimitsFrame,Gtk.PositionType.RIGHT,1,1)

    #  FBFrame = Gtk.Frame()
    Button_FB = Gtk.Button.new_with_label(
        "Show GLX Frame Buffer Configuration")
    Button_FB.connect("clicked", FrameBuffer)
    #  FBFrame.add(Button_FB)

    with open("/tmp/gpu-viewer/OpenGLRHS.txt", "r") as file1:
        for line in file1:
            if "Intel" in line:
                vendorImg = fetchImageFromUrl(Const.INTEL_LOGO_PNG,
                                              Const.ICON_WIDTH,
                                              Const.ICON_HEIGHT, True)
                grid.attach_next_to(Gtk.Image.new_from_pixbuf(vendorImg),
                                    Button_Limits, Gtk.PositionType.RIGHT, 1,
                                    1)
                break
            elif "NVIDIA" in line:
                vendorImg = fetchImageFromUrl(Const.GTX_LOGO_PNG,
                                              Const.ICON_WIDTH,
                                              Const.ICON_HEIGHT, True)
                grid.attach_next_to(Gtk.Image.new_from_pixbuf(vendorImg),
                                    Button_Limits, Gtk.PositionType.RIGHT, 1,
                                    1)
                break
            elif "AMD" in line or "ATI" in line:
                vendorImg = fetchImageFromUrl(Const.AMD_LOGO_PNG,
                                              Const.ICON_WIDTH,
                                              Const.ICON_HEIGHT, True)
                grid.attach_next_to(Gtk.Image.new_from_pixbuf(vendorImg),
                                    Button_Limits, Gtk.PositionType.RIGHT, 1,
                                    1)
                break

        # vendorFrame.add(Gtk.Image.new_from_pixbuf(vendorImg))
        grid.attach(Button_FB, 3, 1, 2, 1)

    # End of Frame 1
    OpenGLExt_list = Gtk.ListStore(str, str)
    OpenGLExt_list_filter = OpenGLExt_list.filter_new()
    TreeGLExt = Gtk.TreeView(OpenGLExt_list_filter, expand=True)
    TreeGLExt.set_headers_visible(False)
    frame4 = Gtk.Frame(label=" ")

    def radcall2(button):
        value = button.get_active()

        GL_All = []

        List = copyContentsFromFile("/tmp/gpu-viewer/Vendor1.txt")

        List = [i.strip(' ') for i in List]
        List = [i.strip('\n ') for i in List]
        List.insert(0, " ALL")

        with open("/tmp/gpu-viewer/extensions.txt", "r") as file1:
            for line in file1:
                if List[int(value)] == " ALL":
                    GL_All.append(line)
                elif List[int(value)] != " ALL":
                    if "_%s_" % List[int(value)] in line:
                        GL_All.append(line)

        OpenGLExt_list.clear()
        TreeGLExt.set_model(OpenGLExt_list_filter)

        for i in range(len(List)):
            if int(value) == i:
                frame4.set_label(List[i])

        count = len(GL_All)
        for i in range(count):
            background_color = setBackgroundColor(i)
            text = GL_All[i].strip(' ')
            OpenGLExt_list.append([text.strip('\n'), background_color])

    VendorExt_list = Gtk.ListStore(str, bool, str)
    TreeVendor = Gtk.TreeView(VendorExt_list, expand=True)

    Vendor_Store = Gtk.ListStore(str)
    Vendor_Combo = Gtk.ComboBox.new_with_model(Vendor_Store)

    def Radio(value):

        if 1 <= value <= 2:
            os.system(
                "cat /tmp/gpu-viewer/extensions.txt | awk 'gsub(/GL_|_.*/,'true')'| uniq > /tmp/gpu-viewer/Vendor.txt"
            )
            os.system(
                "cat /tmp/gpu-viewer/extensions.txt | awk 'gsub(/GLX_|_.*/,'true')'| uniq >> /tmp/gpu-viewer/Vendor.txt"
            )
            os.system(
                "cat /tmp/gpu-viewer/Vendor.txt | sort | uniq | grep -v GLX | grep -v GL$  > /tmp/gpu-viewer/Vendor1.txt"
            )

        if value == 3:
            os.system(
                "cat /tmp/gpu-viewer/extensions.txt | awk 'gsub(/EGL_|_.*/,'true')'| sort | uniq > /tmp/gpu-viewer/Vendor1.txt"
            )

        vCount = []
        vendorList = []
        with open("/tmp/gpu-viewer/Vendor1.txt", "r") as file1:
            for line in file1:
                vendorList.append(line)

        vendorList = [i.strip(' ') for i in vendorList]
        vendorList = [i.strip('\n ') for i in vendorList]
        vendorList.insert(0, "Total")

        with open("/tmp/gpu-viewer/extensions.txt", "r") as file1:
            for i in range(len(vendorList)):
                file1.seek(0, 0)
                GL_All = []
                for line in file1:
                    if vendorList[i] == "Total":
                        GL_All.append(line)
                    elif vendorList[i] != "Total":
                        if "_%s_" % vendorList[i] in line:
                            GL_All.append(line)
                vCount.append(len(GL_All))

        NewList = []
        for i in range(len(vendorList)):
            NewList.append("%s (%d)" % (vendorList[i], vCount[i]))

        VendorExt_list.clear()
        TreeVendor.set_model(VendorExt_list)
        Toggle = []
        for i in range(len(NewList) - 1):
            Toggle.append(False)
        Vendor_Store.clear()
        Vendor_Combo.set_model(Vendor_Store)
        Toggle.insert(True, 0)
        for i in range(len(NewList)):
            background_color = setBackgroundColor(i)
            VendorExt_list.append([NewList[i], Toggle[i], background_color])
            Vendor_Store.append([NewList[i]])

    def radcall(button, value):
        if value == 1:
            try:
                switch.set_active(True)
                switch.set_sensitive(True)
            except:
                pass
            os.system(
                "cat /tmp/gpu-viewer/glxinfo.txt | awk '/OpenGL extensions/{flag=1;next}/OpenGL ES profile/{flag=0} flag' | grep GL_ | sort > /tmp/gpu-viewer/extensions.txt"
            )
            os.system(
                "cat /tmp/gpu-viewer/glxinfo.txt  | awk '/client glx extensions/{flag=1; next}/GLX version/{flag=0} flag' | grep GLX_ | sort >> /tmp/gpu-viewer/extensions.txt"
            )

        elif value == 2:
            switch.set_active(True)
            switch.set_sensitive(False)
            os.system(
                "cat /tmp/gpu-viewer/glxinfo.txt  | awk '/OpenGL ES profile/{flag=1;next}/80 GLX Visuals/{flag=0} flag' | grep GL_ | sort > /tmp/gpu-viewer/extensions.txt"
            )

        elif value == 3:
            switch.set_active(True)
            switch.set_sensitive(False)
            os.system(
                "es2_info | awk '/EGL_EXTENSIONS.*/{flag=1;next}/EGL_CLIENT.*/{flag=0}flag'| awk '{n=split($0,a,/,/);{for (i=1;i<=n;i++) print a[i]}}' | grep -o EGL.* > /tmp/gpu-viewer/extensions.txt"
            )

        Radio(value)
        Vendor_Combo.set_active(0)

    frame2 = Gtk.Frame(label="Extensions\t")
    grid.attach(frame2, 0, 2, 12, 1)
    grid1 = Gtk.Grid()
    #grid1.set_row_spacing(5)
    grid1.set_border_width(5)
    frame2.add(grid1)

    OpenGLRad = Gtk.RadioButton()
    RadioImg1 = fetchImageFromUrl(Const.OPEN_GL_PNG, 90, 70, True)
    OpenGLRad.set_image(Gtk.Image.new_from_pixbuf(RadioImg1))
    OpenGLRad.connect("clicked", radcall, 1)
    grid1.add(OpenGLRad)
    OpenGLRadES = Gtk.RadioButton.new_from_widget(OpenGLRad)
    RadioImg2 = fetchImageFromUrl(Const.OPEN_GL_ES_PNG, 100, 70, True)
    OpenGLRadES.set_image(Gtk.Image.new_from_pixbuf(RadioImg2))
    OpenGLRadES.connect("clicked", radcall, 2)
    eglRad = Gtk.RadioButton.new_from_widget(OpenGLRadES)
    eglRad.connect("clicked", radcall, 3)
    RadioImg3 = fetchImageFromUrl(Const.EGL_PNG, 70, 70, True)
    eglRad.set_image(Gtk.Image.new_from_pixbuf(RadioImg3))
    with open("/tmp/gpu-viewer/OpenGLLHS.txt", "r") as file1:
        for line in file1:
            if "OpenGL ES" in line:
                grid1.attach_next_to(OpenGLRadES, OpenGLRad,
                                     Gtk.PositionType.RIGHT, 1, 1)
                continue
            elif "EGL_VERSION" in line:
                grid1.attach_next_to(eglRad, OpenGLRadES,
                                     Gtk.PositionType.RIGHT, 1, 1)
                break
            else:
                OpenGLRadES.set_visible(False)
                eglRad.set_visible(False)

    OpenGLRad.set_active(False)

    # OpenGLRadES.set_active(True)
    # os.system("rm /tmp/gpu-viewer/OpenGL*.txt")
    # End of Frame 2 and grid 1
    # Start of Frame 3

    def searchTree(model, iter, data=None):
        search_query = entry.get_text().lower()
        for i in range(TreeGLExt.get_n_columns()):
            value = model.get_value(iter, i).lower()
            if search_query in value:
                return True

    def switchCall(self, value):
        if switch.get_active():
            os.system(
                "cat /tmp/gpu-viewer/glxinfo.txt | awk '/OpenGL extensions/{flag=1;next}/OpenGL ES profile/{flag=0} flag' | grep GL_ | sort > /tmp/gpu-viewer/extensions.txt"
            )
            os.system(
                "cat /tmp/gpu-viewer/glxinfo.txt  | awk '/client glx extensions/{flag=1; next}/GLX version/{flag=0} flag' | grep GLX_ | sort >> /tmp/gpu-viewer/extensions.txt"
            )
        else:
            os.system(
                "cat /tmp/gpu-viewer/glxinfo.txt | awk '/OpenGL core profile extensions:/{flag=1;next}/OpenGL version*/{flag=0} flag' | grep GL_ | sort > /tmp/gpu-viewer/extensions.txt"
            )
            os.system(
                "cat /tmp/gpu-viewer/glxinfo.txt  | awk '/client glx extensions/{flag=1; next}/GLX version/{flag=0} flag' | grep GLX_ | sort >> /tmp/gpu-viewer/extensions.txt"
            )
        Radio(1)
        Vendor_Combo.set_active(0)

    Vendor_Combo = Gtk.ComboBox.new_with_model(Vendor_Store)
    Vendor_Combo.connect("changed", radcall2)
    Vendor_renderer = Gtk.CellRendererText()
    Vendor_Combo.pack_start(Vendor_renderer, True)
    Vendor_Combo.add_attribute(Vendor_renderer, "text", 0)
    # Vendor_Combo.set_entry_text_column(0)
    Vendor_Combo.set_active(0)
    grid1.attach_next_to(Vendor_Combo, OpenGLRad, Gtk.PositionType.BOTTOM, 1,
                         1)

    switch = Gtk.Switch()
    switch.connect("notify::active", switchCall)
    switch.set_active(True)

    coreLabel = Gtk.Label("Core")
    comptLabel = Gtk.Label("\t\tCompat.")

    grid1.attach_next_to(coreLabel, Vendor_Combo, Gtk.PositionType.RIGHT, 1, 1)

    grid1.attach_next_to(switch, coreLabel, Gtk.PositionType.RIGHT, 1, 1)
    grid1.attach_next_to(comptLabel, switch, Gtk.PositionType.RIGHT, 4, 1)
    TreeGLExt.set_enable_search(True)
    TreeGLExt.set_headers_visible(True)
    setColumns(TreeGLExt, Title1, Const.MWIDTH, 0.0)

    grid.attach(frame4, 0, 3, 12, 1)
    grid3 = Gtk.Grid()
    #grid3.set_row_spacing(2)
    frame4.add(grid3)
    frameSearch = Gtk.Frame()
    entry = Gtk.SearchEntry()
    entry.set_placeholder_text("Type here to filter extensions.....")
    entry.connect("search-changed", refresh_filter, OpenGLExt_list_filter)
    entry.grab_focus()
    frameSearch.add(entry)
    scrollable_treelist2 = createScrollbar(TreeGLExt)
    grid3.attach(frameSearch, 0, 0, 1, 1)
    grid3.attach_next_to(scrollable_treelist2, frameSearch,
                         Gtk.PositionType.BOTTOM, 1, 1)

    OpenGLExt_list_filter.set_visible_func(searchTree)

    tab1.show_all()
Esempio n. 23
0
    def getDeviceDetails(value):

        value2 = platform_combo.get_active()

        oclPlatformslocal = []
        oclPlatformslocal = oclPlatformslocal + oclPlatforms
        oclPlatformslocal.append("BLANK")

        for i in range(len(oclPlatformslocal)):
            oclPlatformslocal[i] = [
                j.replace("(", "\(") for j in oclPlatformslocal[i]
            ]
            oclPlatformslocal[i] = [
                j.replace(")", "\)") for j in oclPlatformslocal[i]
            ]
            oclPlatformslocal[i] = ''.join(oclPlatformslocal[i])

        os.system(
            "cat /tmp/gpu-viewer/clinfo.txt | awk '/%s/&& ++n == 2,/%s*/' | awk '/Device Name.*/&& ++n == %d,/Preferred \/.*/' | grep -v Preferred | grep -v Available > /tmp/gpu-viewer/oclDeviceDetails.txt"
            % (oclPlatformslocal[value2], oclPlatformslocal[value2 + 1],
               value + 1))
        os.system(
            "cat /tmp/gpu-viewer/clinfo.txt |  awk '/%s/&& ++n == 2,/%s/' | awk '/Device Name.*/&& ++n == %d,/Extensions.*/'| awk '/Extensions|Available/' >> /tmp/gpu-viewer/oclDeviceDetails.txt"
            % (oclPlatformslocal[value2], oclPlatformslocal[value2 + 1],
               value + 1))
        os.system(
            "cat /tmp/gpu-viewer/oclDeviceDetails.txt | awk '{gsub(/     .*/,'True');print}' > /tmp/gpu-viewer/oclDeviceDetailsLHS.txt"
        )
        os.system(
            "cat /tmp/gpu-viewer/oclDeviceDetails.txt | awk '{gsub(/^ .*        /,'True');print}' > /tmp/gpu-viewer/oclDeviceDetailsRHS.txt"
        )

        oclDeviceDetailsLHS = copyContentsFromFile(
            "/tmp/gpu-viewer/oclDeviceDetailsLHS.txt")
        oclDeviceDetailsRHS = copyContentsFromFile(
            "/tmp/gpu-viewer/oclDeviceDetailsRHS.txt")

        DeviceDetails_Store.clear()
        DeviceDetailsTreeView.set_model(DeviceDetails_Store)
        fgcolor = []

        for i in range(len(oclDeviceDetailsRHS)):
            if "Yes" in oclDeviceDetailsRHS[i]:
                fgcolor.append("GREEN")
            elif "No" in oclDeviceDetailsRHS[
                    i] and "None" not in oclDeviceDetailsRHS[i]:
                fgcolor.append("RED")
            else:
                fgcolor.append("BLACK")

        for i in range(len(oclDeviceDetailsLHS)):
            DeviceDetailsTreeView.expand_all()
            if "    " in oclDeviceDetailsLHS[i]:
                oclDeviceDetailsLHS[i] = oclDeviceDetailsLHS[i].strip("  ")
                DeviceDetails_Store.append(iter, [
                    oclDeviceDetailsLHS[i].strip('\n'),
                    oclDeviceDetailsRHS[i].strip('\n'),
                    setBackgroundColor(i), fgcolor[i]
                ])
            else:
                if "Number of devices" in oclDeviceDetailsLHS[i]:
                    oclDeviceDetailsLHS[i] = "  Number of devices"
                    oclDeviceDetailsRHS[i] = oclDeviceDetailsRHS[i][
                        len(oclDeviceDetailsLHS[i]):].strip(' ')
                if "Extensions" in oclDeviceDetailsLHS[i]:
                    oclDeviceExtenstions = oclDeviceDetailsRHS[i].split(' ')
                    iter = DeviceDetails_Store.append(None, [
                        oclDeviceDetailsLHS[i].strip('\n'),
                        str(len(oclDeviceExtenstions)).strip('\n'),
                        setBackgroundColor(i), fgcolor[i]
                    ])
                    for j in range(len(oclDeviceExtenstions)):
                        DeviceDetailsTreeView.expand_all()
                        DeviceDetails_Store.append(iter, [
                            oclDeviceExtenstions[j].strip('\n'), " ",
                            setBackgroundColor(j), '#fff'
                        ])
                else:
                    iter = DeviceDetails_Store.append(None, [
                        oclDeviceDetailsLHS[i].strip('\n'),
                        oclDeviceDetailsRHS[i].strip('\n'),
                        setBackgroundColor(i), fgcolor[i]
                    ])
Esempio n. 24
0
def FrameBuffer(button):
    FBWin = Gtk.Window()
    FBWin.set_border_width(10)
    FBWin.set_title("GLX Frame Buffer Configuration")
    #   FBWin.set_size_request(1000, 500)
    setScreenSize(FBWin, Const.WIDTH_RATIO, Const.HEIGHT_RATIO2)

    FBNotebook = Gtk.Notebook()
    FBWin.add(FBNotebook)

    FBGLX_Store = Gtk.ListStore(str, str, str, str, str, str, str, str, str,
                                str, str, str, str, str, str, str, str, str,
                                str, str, str, str, str, str, str, str)
    TreeFBGLX = Gtk.TreeView(FBGLX_Store, expand=True)
    TreeFBGLX.set_enable_search(True)
    TreeFBGLX.set_property("enable-grid-lines", 3)

    FBGLXTab = Gtk.Box(spacing=10)
    FBGLXGrid = createSubTab(FBGLXTab, FBNotebook, "GLX Visuals")
    FBConfigTab = Gtk.Box(spacing=10)
    FBConfigGrid = createSubTab(FBConfigTab, FBNotebook, "GLX FBConfigs")

    button.set_sensitive(False)

    os.system(
        "cat /tmp/gpu-viewer/glxinfo.txt  | awk '/GLX Visuals.*/{flag=1;next}/GLXFBConfigs.*/{flag=0}flag' | awk '/----.*/{flag=1;next}flag' > /tmp/gpu-viewer/FrameBufferGLXVisual.txt"
    )

    list = []
    with open("/tmp/gpu-viewer/FrameBufferGLXVisual.txt", "r") as file1:
        for line in file1:
            list.append(line.split())

    for i in range(len(list) - 1):
        background_color = setBackgroundColor(i)
        FBGLX_Store.append(list[i] + [background_color])
    label1 = "%d GLX Visuals" % (len(list) - 1)
    FBNotebook.set_tab_label(FBGLXTab, Gtk.Label(label1))

    FBConfig_Store = Gtk.ListStore(str, str, str, str, str, str, str, str, str,
                                   str, str, str, str, str, str, str, str, str,
                                   str, str, str, str, str, str, str, str)
    TreeFBConfig = Gtk.TreeView(FBConfig_Store, expand=True)
    TreeFBConfig.set_enable_search(True)
    TreeFBConfig.set_property("enable-grid-lines", 3)

    os.system(
        "cat /tmp/gpu-viewer/glxinfo.txt | awk '/GLXFBConfigs.*/{flag=1;next}flag' | awk '/----.*/{flag=1;next}flag' > /tmp/gpu-viewer/FrameBufferGLXFBconfigs.txt"
    )

    list = []
    with open("/tmp/gpu-viewer/FrameBufferGLXFBconfigs.txt", "r") as file1:
        for line in file1:
            list.append(line.split())

    for i in range(len(list) - 1):
        background_color = setBackgroundColor(i)
        if list[i][6] == "r" or list[i][6] == "c":
            pass
        else:
            list[i].insert(6, ".")
        FBConfig_Store.append(list[i] + [background_color])
    label2 = "%d  GLX FBConfigs" % (len(list) - 1)
    FBNotebook.set_tab_label(FBConfigTab, Gtk.Label(label2))

    setColumnFrameBuffer(TreeFBGLX, Const.FRAMEBUFFERLIST)

    FBGLXScrollbar = createScrollbar(TreeFBGLX)
    FBGLXGrid.add(FBGLXScrollbar)

    setColumnFrameBuffer(TreeFBConfig, Const.FRAMEBUFFERLIST)

    FBConfigScrollbar = createScrollbar(TreeFBConfig)
    FBConfigGrid.add(FBConfigScrollbar)

    def button_enable(win, value):
        button.set_sensitive(True)

    FBWin.connect("delete-event", button_enable)

    FBWin.show_all()
Esempio n. 25
0
    def getDeviceQueueExecutionCapabilities(value):

        value2 = platform_combo.get_active()

        oclPlatformslocal = []
        oclPlatformslocal = oclPlatformslocal + oclPlatforms
        oclPlatformslocal.append("BLANK")

        for i in range(len(oclPlatformslocal)):
            oclPlatformslocal[i] = [
                j.replace("(", "\(") for j in oclPlatformslocal[i]
            ]
            oclPlatformslocal[i] = [
                j.replace(")", "\)") for j in oclPlatformslocal[i]
            ]
            oclPlatformslocal[i] = ''.join(oclPlatformslocal[i])

        os.system(
            "cat /tmp/gpu-viewer/clinfo.txt |  awk '/%s/&& ++n == 2,/%s/' | awk '/Device Name.*/&& ++n == %d,/Extensions.*/' | awk '/Queue.*/{flag=1;print}/Extensions.*/{flag=0}flag' | grep -v Available | uniq > /tmp/gpu-viewer/oclDeviceQueueExecutionDetails.txt"
            % (oclPlatformslocal[value2], oclPlatformslocal[value2 + 1],
               value + 1))
        os.system(
            "cat /tmp/gpu-viewer/oclDeviceQueueExecutionDetails.txt | awk '{gsub(/     .*/,'True');print}' > /tmp/gpu-viewer/oclDeviceQueueExecutionDetailsLHS.txt"
        )
        os.system(
            "cat /tmp/gpu-viewer/oclDeviceQueueExecutionDetails.txt | awk '{gsub(/^ .*        /,'True');print}' > /tmp/gpu-viewer/oclDeviceQueueExecutionDetailsRHS.txt"
        )

        oclDeviceQueueExecutionDetailsLHS = copyContentsFromFile(
            "/tmp/gpu-viewer/oclDeviceQueueExecutionDetailsLHS.txt")
        oclDeviceQueueExecutionDetailsRHS = copyContentsFromFile(
            "/tmp/gpu-viewer/oclDeviceQueueExecutionDetailsRHS.txt")

        oclDeviceQueueExecutionDetailsLHS = [
            i.strip('\n') for i in oclDeviceQueueExecutionDetailsLHS
        ]
        oclDeviceQueueExecutionDetailsRHS = [
            i.strip('\n') for i in oclDeviceQueueExecutionDetailsRHS
        ]

        DeviceQueueExecution_store.clear()
        DeviceQueueExecutionTreeView.set_model(DeviceQueueExecution_store)
        fgcolor = []

        for i in range(len(oclDeviceQueueExecutionDetailsRHS)):
            if "Yes" in oclDeviceQueueExecutionDetailsRHS[i]:
                fgcolor.append("GREEN")
            elif "No" in oclDeviceQueueExecutionDetailsRHS[
                    i] and "None" not in oclDeviceQueueExecutionDetailsRHS[i]:
                fgcolor.append("RED")
            else:
                fgcolor.append("BLACK")

        for i in range(len(oclDeviceQueueExecutionDetailsLHS)):
            DeviceQueueExecutionTreeView.expand_all()
            if "    " in oclDeviceQueueExecutionDetailsLHS[i]:
                oclDeviceQueueExecutionDetailsLHS[
                    i] = oclDeviceQueueExecutionDetailsLHS[i].strip("  ")
                DeviceQueueExecution_store.append(iter, [
                    oclDeviceQueueExecutionDetailsLHS[i].strip('\n'),
                    oclDeviceQueueExecutionDetailsRHS[i].strip('\n'),
                    setBackgroundColor(i), fgcolor[i]
                ])
            else:
                if oclDeviceQueueExecutionDetailsLHS[
                        i] in oclDeviceQueueExecutionDetailsRHS[i]:
                    oclDeviceQueueExecutionDetailsRHS[
                        i] = oclDeviceQueueExecutionDetailsRHS[i][len(
                            oclDeviceQueueExecutionDetailsLHS[i]):].strip(' ')
                    iter = DeviceQueueExecution_store.append(
                        None, [
                            oclDeviceQueueExecutionDetailsLHS[i].strip('\n'),
                            oclDeviceQueueExecutionDetailsRHS[i].strip('\n'),
                            setBackgroundColor(i), fgcolor[i]
                        ])
                elif "Built-in" in oclDeviceQueueExecutionDetailsLHS[i]:
                    oclDeviceKernels = oclDeviceQueueExecutionDetailsRHS[
                        i].split(';')
                    iter = DeviceQueueExecution_store.append(
                        None, [
                            oclDeviceQueueExecutionDetailsLHS[i].strip('\n'),
                            str(len(oclDeviceKernels) - 1).strip('\n'),
                            setBackgroundColor(i), fgcolor[i]
                        ])
                    for j in range(len(oclDeviceKernels) - 1):
                        DeviceQueueExecutionTreeView.expand_all()
                        DeviceQueueExecution_store.append(
                            iter, [
                                oclDeviceKernels[j].strip('\n'), " ",
                                setBackgroundColor(j), '#fff'
                            ])
                else:
                    iter = DeviceQueueExecution_store.append(
                        None, [
                            oclDeviceQueueExecutionDetailsLHS[i].strip('\n'),
                            oclDeviceQueueExecutionDetailsRHS[i].strip('\n'),
                            setBackgroundColor(i), fgcolor[i]
                        ])
Esempio n. 26
0
    def getDeviceVectorDetails(value):

        value2 = platform_combo.get_active()

        oclPlatformslocal = []
        oclPlatformslocal = oclPlatformslocal + oclPlatforms
        oclPlatformslocal.append("BLANK")

        for i in range(len(oclPlatformslocal)):
            oclPlatformslocal[i] = [
                j.replace("(", "\(") for j in oclPlatformslocal[i]
            ]
            oclPlatformslocal[i] = [
                j.replace(")", "\)") for j in oclPlatformslocal[i]
            ]
            oclPlatformslocal[i] = ''.join(oclPlatformslocal[i])

        os.system(
            "cat /tmp/gpu-viewer/clinfo.txt | awk '/%s/&& ++n == 2,/%s/' | awk '/Device Name.*/&& ++n == %d,/Extensions.*/'| awk '/Preferred \/.*/{flag=1;print}/Address.*/{flag=0}flag' | uniq > /tmp/gpu-viewer/oclDeviceVectorDetails.txt"
            % (oclPlatformslocal[value2], oclPlatformslocal[value2 + 1],
               value + 1))
        os.system(
            "cat /tmp/gpu-viewer/oclDeviceVectorDetails.txt | awk '{gsub(/     .*/,'True');print}' > /tmp/gpu-viewer/oclDeviceVectorDetailsLHS.txt"
        )
        os.system(
            "cat /tmp/gpu-viewer/oclDeviceVectorDetails.txt | awk '{gsub(/.*          /,'True');print}' > /tmp/gpu-viewer/oclDeviceVectorDetailsRHS.txt"
        )

        oclDeviceVectorDetailsLHS = copyContentsFromFile(
            "/tmp/gpu-viewer/oclDeviceVectorDetailsLHS.txt")
        oclDeviceVectorDetailsRHS = copyContentsFromFile(
            "/tmp/gpu-viewer/oclDeviceVectorDetailsRHS.txt")

        oclDeviceVectorDetailsLHS = [
            i.strip('\n') for i in oclDeviceVectorDetailsLHS
        ]
        oclDeviceVectorDetailsRHS = [
            i.strip('\n') for i in oclDeviceVectorDetailsRHS
        ]
        DeviceVector_store.clear()
        DeviceVectorTreeview.set_model(DeviceVector_store)
        fgcolor = []

        for i in range(len(oclDeviceVectorDetailsRHS)):
            if "Yes" in oclDeviceVectorDetailsRHS[i]:
                fgcolor.append("GREEN")
            elif "No" in oclDeviceVectorDetailsRHS[
                    i] and "None" not in oclDeviceVectorDetailsRHS[i]:
                fgcolor.append("RED")
            else:
                fgcolor.append("BLACK")

        for i in range(len(oclDeviceVectorDetailsLHS)):
            DeviceVectorTreeview.expand_all()
            if "    " in oclDeviceVectorDetailsLHS[i]:
                DeviceVectorTreeview.expand_all()
                if "Correctly-rounded divide and sqrt operations" in oclDeviceVectorDetailsLHS[
                        i]:
                    oclDeviceVectorDetailsLHS[
                        i] = "    Correctly-rounded divide and sqrt operations"
                    oclDeviceVectorDetailsRHS[i] = oclDeviceVectorDetailsRHS[
                        i][len(oclDeviceVectorDetailsLHS[i]):].strip(' ')
                oclDeviceVectorDetailsLHS[i] = oclDeviceVectorDetailsLHS[
                    i].strip("  ")
                DeviceVector_store.append(iter, [
                    oclDeviceVectorDetailsLHS[i].strip('\n'),
                    oclDeviceVectorDetailsRHS[i],
                    setBackgroundColor(i), fgcolor[i]
                ])
            else:
                if oclDeviceVectorDetailsLHS[i] in oclDeviceVectorDetailsRHS[
                        i]:
                    oclDeviceVectorDetailsRHS[i] = oclDeviceVectorDetailsRHS[
                        i].strip(oclDeviceVectorDetailsLHS[i])
                iter = DeviceVector_store.append(None, [
                    oclDeviceVectorDetailsLHS[i].strip('\n'),
                    oclDeviceVectorDetailsRHS[i].strip('\n'),
                    setBackgroundColor(i), fgcolor[i]
                ])