Skip to content

gpuinfo ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourceAmber log
idgpuinfo
nameGPU device info
pattern\s*\|-{10,}\s*GPU\sDEVICE\sINFO.*
endPattern\s*\|-{20,}
endOffset1
xml:basegpuinfo.xml

Input ​

|------------------- GPU DEVICE INFO --------------------
|
|            CUDA_VISIBLE_DEVICES: 0
|   CUDA Capable Devices Detected:      1
|           CUDA Device ID in use:      0
|                CUDA Device Name: Tesla V100-SXM2-16GB
|     CUDA Device Global Mem Size:  16128 MB
| CUDA Device Num Multiprocessors:     80
|           CUDA Device Core Freq:   1.53 GHz
|
|--------------------------------------------------------

Output text ​

xml
<comment class="example.output" id="gpuinfo">
         <module cmlx:templateRef="gpuinfo">
              <list cmlx:templateRef="gpu">
                 <list>
                    <scalar dataType="xsd:string" dictRef="cc:parameter">CUDA_VISIBLE_DEVICES</scalar>
                    <scalar dataType="xsd:string" dictRef="cc:value">0</scalar>
                 </list>
                 <list>
                    <scalar dataType="xsd:string" dictRef="cc:parameter">CUDA Capable Devices Detected</scalar>
                    <scalar dataType="xsd:string" dictRef="cc:value">1</scalar>
                 </list>
                 <list>
                    <scalar dataType="xsd:string" dictRef="cc:parameter">CUDA Device ID in use</scalar>
                    <scalar dataType="xsd:string" dictRef="cc:value">0</scalar>
                 </list>
                 <list>
                    <scalar dataType="xsd:string" dictRef="cc:parameter">CUDA Device Name</scalar>
                    <scalar dataType="xsd:string" dictRef="cc:value">Tesla V100-SXM2-16GB</scalar>
                 </list>
                 <list>
                    <scalar dataType="xsd:string" dictRef="cc:parameter">CUDA Device Global Mem Size</scalar>
                    <scalar dataType="xsd:string" dictRef="cc:value">16128 MB</scalar>
                 </list>
                 <list>
                    <scalar dataType="xsd:string" dictRef="cc:parameter">CUDA Device Num Multiprocessors</scalar>
                    <scalar dataType="xsd:string" dictRef="cc:value">80</scalar>
                 </list>
                 <list>
                    <scalar dataType="xsd:string" dictRef="cc:parameter">CUDA Device Core Freq</scalar>
                    <scalar dataType="xsd:string" dictRef="cc:value">1.53 GHz</scalar>
                 </list>
              </list>
        </module>
    </comment>

Template definition ​

xml
<templateList>  <template pattern="\s*\|.*:.*" endPattern="\s*\|\s+\S.*$\s*\|\s*" endPattern2="~" endOffset="1" repeat="*">    <record id="gpu" repeat="*">\s*\|&#123;X,cc:parameter&#125;:&#123;X,cc:value&#125;</record>
        </template>
    </templateList>
<transform process="pullup" xpath=".//cml:list[@cmlx:templateRef='gpu']" />