• PowerShell to detect NPU – Testers Needed

    Home » Forums » Artificial Intelligence » All other AI » PowerShell to detect NPU – Testers Needed

    Author
    Topic
    #2773424

    Hey y’all,

    I’ve been trying to cobble together some PowerShell code to detect the presence of NPU/GPU processors in a computer. Unfortunately, I don’t own one!!! YET.

    Any one out there what to test this?

    # Query Device Manager for known NPU device names or categories
    $npus = Get-PnpDevice | Where-Object {
        ($_.Class -eq 'Processor' -or $_.Class -eq 'Display') -and (
        ($_.FriendlyName -match 'NPU') -or
        ($_.FriendlyName -match 'Neural Processor') -or
        ($_.FriendlyName -match 'Intel AI Boost') -or
        ($_.FriendlyName -match 'AMD IPU Device') -or
        ($_.Class -eq 'NeuralProcessors'))
    }
    
    if ($npus) {
        Write-Output "NPU detected:"
        $npus | Select-Object -Property FriendlyName, Manufacturer, Status | Format-Table -AutoSize
    } else {
        Write-Output "No NPU detected on this system."
    }
    

    Please run in the PowerShell ISE and post your results.

    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!
    Computer Specs

    • This topic was modified 3 weeks, 4 days ago by RetiredGeek.
    Viewing 1 reply thread
    Author
    Replies
    • #2773445

      Not working as expected.

      Screenresults

      This is an ASUS Vivobook S15 S5507QA_S5507QAD

      And it’s definitely able to run Microsoft Recall.

      Susan Bradley Patch Lady/Prudent patcher

      1 user thanked author for this post.
      • #2773451

        Holler if you need me to test again.

        Susan Bradley Patch Lady/Prudent patcher

        • #2773479

          Susan,

          Let’s give this a try. It should list every processor in your system.
          This may show what your NPU’s “Friendly Name” is.

          Clear-Host
          
          # Query Device Manager for known NPU device names or categories
          $npus = Get-PnpDevice | Where-Object {
              ($_.Class -eq 'Processor' -or 
               $_.Class -eq 'Display'   -or
               $_.Class -eq 'NeuralProcessors')
          }
          
          $npus | Select-Object -Property FriendlyName, Manufacturer, Status | 
                  Format-Table -AutoSize
          

          Thanks for testing!

          May the Forces of good computing be with you!

          RG

          PowerShell & VBA Rule!
          Computer Specs

          • #2773604

            Current result

            psscreen

            Susan Bradley Patch Lady/Prudent patcher

            • #2773662

              Susan,

              Thanks! Here’s updated code which should provide the proper output.

              Clear-Host
              
              # Query Device Manager for known NPU device names or 
              # categories
              $npus = Get-PnpDevice | Where-Object {
                  ($_.Class -eq 'Processor' -or 
                   $_.Class -eq 'Display') -and (
                  ($_.FriendlyName -match 'NPU') -or
                  ($_.FriendlyName -match 'Neural Processor')      -or
                  ($_.FriendlyName -match 'Intel AI Boost')        -or
                  ($_.FriendlyName -match 'AMD IPU Device')        -or
                  ($_.FriendlyName -match 'SnapDragon(R) X Elite') -or
                  ($_.Class -eq 'NeuralProcessors'))
              }
              
              if ($npus) {
                  Write-Output "NPU detected:"
                  $npus | Select-Object -Property FriendlyName, Manufacturer, Status | Format-Table -AutoSize
              } else {
                  Write-Output "No NPU detected on this system."
              }
              

              May the Forces of good computing be with you!

              RG

              PowerShell & VBA Rule!
              Computer Specs

            • #2773700

              Still not working (sorry)

              notcorrectoutput

              Susan Bradley Patch Lady/Prudent patcher

            • #2773714

              Susan,

              Let’s try this?
              Change:

              ($_.FriendlyName -match 'SnapDragon(R) X Elite'
              

              To:

              ($_.FriendlyName -Like "*SnapDragon(R) X Elite*"
              

              May the Forces of good computing be with you!

              RG

              PowerShell & VBA Rule!
              Computer Specs

            • #2774119

              Hmm did I copy something wrong?

              didIcopysomethingwrong

              Susan Bradley Patch Lady/Prudent patcher

            • #2774129

              You didn’t include the closing ) for the “*SnapDragon(R) X Elite*” line.

              What you ran was:

              ($_.FriendlyName -like "*SnapDragon(R) X Elite*" -or

              It should’ve been:

              ($_.FriendlyName -like "*SnapDragon(R) X Elite*") -or
              1 user thanked author for this post.
            • #2774398

              Result:

              result

               

              Susan Bradley Patch Lady/Prudent patcher

              1 user thanked author for this post.
    • #2773663

      Susan,

      If you wouldn’t mind try this code to see if it just shows the last item on your previous output?

      Clear-Host
      
      # Query Device Manager for known NPU device names or categories
      $npus = Get-PnpDevice | Where-Object {
          ($_.Class -eq 'NeuralProcessors')
      }
      
      $npus | Select-Object -Property Class, FriendlyName, Manufacturer, Status | 
              Format-Table -AutoSize
      

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #2773698

        That’s not coming back with anything for the result

        noresponse

        Susan Bradley Patch Lady/Prudent patcher

        1 user thanked author for this post.
        • #2774162

          Susan,

          Thanks for testing! n0ads thanks for the correction.

          Looks like I’ll have to find a way to get my hands on some of these machines for a day or so to sus out what the Classes report on them.

          Thanks Again Y’all!

          RG

          May the Forces of good computing be with you!

          RG

          PowerShell & VBA Rule!
          Computer Specs

    Viewing 1 reply thread
    Reply To: Reply #2774119 in PowerShell to detect NPU – Testers Needed

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel