]> vilimpoc.org git repositories - dotfiles/commitdiff
dotfiles: report Intel VTune rather than installing it
authorMax Vilimpoc <max@vilimpoc.org>
Sat, 29 Aug 2026 17:46:46 +0000 (19:46 +0200)
committerMax Vilimpoc <max@vilimpoc.org>
Tue, 1 Sep 2026 10:53:41 +0000 (12:53 +0200)
The elevated half now prints whether VTune is on the box, its version and the
path to vtune.exe, and prints the download page when it is not -- adding that
the CPU is not Intel, when it is not.

Not automated on purpose.  The offline installer is a ~750 MB download from
registrationcenter-download.intel.com/akdlm/IRC_NAS/<guid>/, and that GUID is
per-release with no "latest" redirect behind it, so every new build would mean
editing a hard-coded link in a script whose whole point is running unattended on
a fresh box.  It also only earns its place on Intel silicon, since hardware
event-based sampling reads Intel PMU counters.  The unattended incantation is
recorded in the comment and the README for anyone who does want to script it:
-a --silent --cli --eula accept

Detection reads the two Uninstall hives rather than probing a path, so it
follows the install wherever it went, and the CLI path goes through the oneAPI
`latest` junction so it stays right across upgrades.  Exercised against the
2026.2.0 install on this box: reports the version and a vtune.exe that exists.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMh8i2QzkHNdE3MkKfcaT6

README.md
setup-windows-with-uac.ps1

index 9615defe39c8ea04d48933b99551275328671610..e0ef7448f859dff7eab6d24cfd958452896b292b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -137,6 +137,20 @@ throwaway VM reachable from a Linux host.
   msstore`); it is not installed here because the Store source needs an
   interactive, signed-in session, which the unattended elevated half does not
   have.
+- **Intel VTune Profiler is reported, not installed.** The elevated half prints
+  whether it is on the box, its version, and the path to `vtune.exe`; if it is
+  missing it prints the download page instead (and says so if the CPU is not
+  Intel). Automating the install is not worth it here: the offline installer is a
+  ~750 MB download from a URL carrying a per-release GUID with no "latest"
+  redirect behind it, so every new build would mean editing a hard-coded link,
+  and it is only worth having on Intel silicon since hardware event-based
+  sampling reads Intel PMU counters. It does install unattended if you want it
+  scripted elsewhere:
+
+  ```powershell
+  intel-vtune-<version>_offline.exe -a --silent --cli --eula accept
+  ```
+
 - **Tracing without a UAC prompt.** `xperf` and `wpr` fail for a standard user in
   two different ways, because two different things are missing:
 
index 8e8e7977ec8ff3b35cc3d1513f1c9d3de1d889b4..34bfa8b4cd7a272fad50c837c78bec4b7de8f799 100644 (file)
@@ -946,6 +946,46 @@ if ($WptDir) {
 }\r
 \r
 \r
+# ---------------------------------------------------------------------------\r
+# Intel VTune Profiler - reported, not installed\r
+#\r
+# Deliberately NOT automated, unlike everything above. The offline installer is\r
+# a ~750 MB download from a URL carrying a per-release GUID\r
+# (registrationcenter-download.intel.com/akdlm/IRC_NAS/<guid>/intel-vtune-<ver>_offline.exe)\r
+# with no "latest" redirect behind it, so every new build means editing a\r
+# hard-coded link in here - and it is only worth having on Intel silicon, since\r
+# hardware event-based sampling reads Intel PMU counters. Not a good trade for a\r
+# script that has to keep working unattended on any box.\r
+#\r
+# So this step only reports. To install it, take the Windows offline installer\r
+# from\r
+#     https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler-download.html\r
+# and run it elevated; it installs unattended with\r
+#     intel-vtune-<version>_offline.exe -a --silent --cli --eula accept\r
+# ---------------------------------------------------------------------------\r
+Write-Step 'Intel VTune Profiler (status only)'\r
+$UninstallKeys = @(\r
+    'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'\r
+    'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'\r
+)\r
+$vtune = Get-ItemProperty $UninstallKeys -ErrorAction SilentlyContinue |\r
+         Where-Object { $_.DisplayName -match 'VTune' } |\r
+         Select-Object -First 1\r
+if ($vtune) {\r
+    Write-Host "    Installed: $($vtune.DisplayName.Trim()) $($vtune.DisplayVersion)" -ForegroundColor Green\r
+    # The oneAPI layout keeps a `latest` junction beside the versioned directory,\r
+    # so this path stays right across upgrades.\r
+    $VTuneCli = Join-Path $vtune.InstallLocation 'vtune\latest\bin64\vtune.exe'\r
+    if (Test-Path $VTuneCli) { Write-Host "    CLI: $VTuneCli" }\r
+} else {\r
+    Write-Host '    Not installed.' -ForegroundColor Yellow\r
+    Write-Host '    https://www.intel.com/content/www/us/en/developer/tools/oneapi/vtune-profiler-download.html' -ForegroundColor Yellow\r
+    $cpu = (Get-CimInstance Win32_Processor -ErrorAction SilentlyContinue | Select-Object -First 1).Manufacturer\r
+    if ($cpu -and $cpu -notmatch 'Intel') {\r
+        Write-Host "    (This CPU reports itself as '$cpu' - VTune's hardware event-based sampling wants Intel silicon.)" -ForegroundColor Yellow\r
+    }\r
+}\r
+\r
 # ---------------------------------------------------------------------------\r
 Write-Host "`nAll done." -ForegroundColor Green\r
 Write-Host 'If a reboot was flagged above, restart before opening VS or building drivers.'\r