Guest User

vulkan-diag.sh

a guest
Apr 10th, 2026
104
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 15.48 KB | Software | 0 0
  1. #!/usr/bin/env bash
  2. # vulkan-diag.sh — Vulkan / VA-API diagnostic tool for Fedora
  3. # Usage: bash vulkan-diag.sh
  4.  
  5. set -euo pipefail
  6.  
  7. RED='\033[0;31m'
  8. YEL='\033[0;33m'
  9. GRN='\033[0;32m'
  10. BLU='\033[0;34m'
  11. BOLD='\033[1m'
  12. RST='\033[0m'
  13.  
  14. ok()   { echo -e "  ${GRN}[OK]${RST}    $*"; }
  15. warn() { echo -e "  ${YEL}[WARN]${RST}  $*"; }
  16. err()  { echo -e "  ${RED}[ERROR]${RST} $*"; }
  17. info() { echo -e "  ${BLU}[INFO]${RST}  $*"; }
  18. hdr()  { echo -e "\n${BOLD}$*${RST}"; echo "  $(printf '─%.0s' {1..60})"; }
  19.  
  20. # ── summary state ─────────────────────────────────────────────
  21. declare -A SUMMARY
  22. SUMMARY[gpu]="unknown"
  23. SUMMARY[vulkan]="not checked"
  24. SUMMARY[vkvideo]="not checked"
  25. SUMMARY[vaapi]="not checked"
  26. SUMMARY[pkgs]="not checked"
  27. SUMMARY[browser]="not checked"
  28.  
  29. # ── helpers ───────────────────────────────────────────────────
  30. need_cmd() {
  31.     if ! command -v "$1" &>/dev/null; then
  32.         warn "'$1' not found. Install with: sudo dnf install $2"
  33.         return 1
  34.     fi
  35.     return 0
  36. }
  37.  
  38. # ──────────────────────────────────────────────────────────────
  39. echo -e "\n${BOLD}╔══════════════════════════════════════════════════╗${RST}"
  40. echo -e "${BOLD}║   Vulkan / VA-API diagnostic tool for Fedora     ║${RST}"
  41. echo -e "${BOLD}╚══════════════════════════════════════════════════╝${RST}"
  42.  
  43. # ── Step 0: detect GPU ───────────────────────────────────────
  44. hdr "Step 0 — Detecting GPU"
  45.  
  46. GPU_INFO=$(lspci 2>/dev/null | grep -iE "vga|3d|display" || true)
  47. if [ -z "$GPU_INFO" ]; then
  48.     warn "Could not detect GPU via lspci."
  49. else
  50.     echo "$GPU_INFO" | while IFS= read -r line; do info "$line"; done
  51. fi
  52.  
  53. HAS_INTEL=false
  54. HAS_AMD=false
  55. HAS_NVIDIA=false
  56. echo "$GPU_INFO" | grep -qi "intel"                      && HAS_INTEL=true
  57. echo "$GPU_INFO" | grep -qi "amd\|radeon\|advanced micro" && HAS_AMD=true
  58. echo "$GPU_INFO" | grep -qi "nvidia"                      && HAS_NVIDIA=true
  59.  
  60. # Hybrid system detection (e.g. AMD iGPU + NVIDIA dGPU)
  61. HYBRID=false
  62. VENDOR_COUNT=0
  63. $HAS_INTEL  && VENDOR_COUNT=$((VENDOR_COUNT+1))
  64. $HAS_AMD    && VENDOR_COUNT=$((VENDOR_COUNT+1))
  65. $HAS_NVIDIA && VENDOR_COUNT=$((VENDOR_COUNT+1))
  66. [ "$VENDOR_COUNT" -gt 1 ] && HYBRID=true
  67.  
  68. # Primary vendor = discrete GPU wins over integrated
  69. GPU_VENDOR="unknown"
  70. if $HAS_NVIDIA && $HYBRID; then
  71.     GPU_VENDOR="nvidia-hybrid"
  72. elif $HAS_NVIDIA; then
  73.     GPU_VENDOR="nvidia"
  74. elif $HAS_AMD; then
  75.     GPU_VENDOR="amd"
  76. elif $HAS_INTEL; then
  77.     GPU_VENDOR="intel"
  78. fi
  79.  
  80. SUMMARY[gpu]="$GPU_VENDOR"
  81.  
  82. if $HYBRID; then
  83.     warn "Hybrid GPU system detected (multiple GPU vendors found)."
  84.     $HAS_AMD    && info "AMD integrated GPU present (Radeon/Vega)"
  85.     $HAS_NVIDIA && info "NVIDIA discrete GPU present"
  86.     $HAS_INTEL  && info "Intel GPU present"
  87.     info "Vulkan will load ICDs for all GPUs — llvmpipe may also appear as a software fallback, which is normal."
  88.     info "The active GPU for rendering depends on your compositor / prime-run settings."
  89. fi
  90.  
  91. case "$GPU_VENDOR" in
  92.     intel)         ok   "Intel GPU detected — will use ANV_DEBUG flags for video extensions" ;;
  93.     amd)           ok   "AMD GPU detected — will use Mesa RADV driver checks" ;;
  94.     nvidia)        warn "NVIDIA GPU detected — Vulkan video is still TBD on Fedora; VA-API via libva-nvidia-driver is recommended" ;;
  95.     nvidia-hybrid) warn "NVIDIA + AMD/Intel hybrid detected — discrete GPU is NVIDIA. VA-API on the AMD iGPU is usually the most reliable path for video decode." ;;
  96.     *)             warn "GPU vendor unknown — running generic checks" ;;
  97. esac
  98.  
  99. # ── Step 1: Vulkan basic check ────────────────────────────────
  100. hdr "Step 1 — Vulkan support"
  101.  
  102. if ! need_cmd vulkaninfo "vulkan-tools"; then
  103.     err "Install vulkan-tools and re-run: sudo dnf install vulkan-tools"
  104.     SUMMARY[vulkan]="ERROR — vulkaninfo not installed"
  105. else
  106.     VKFLAGS=""
  107.     [ "$GPU_VENDOR" = "intel" ] && VKFLAGS="ANV_DEBUG=video-decode,video-encode"
  108.  
  109.     VK_OUT=$(env $VKFLAGS vulkaninfo --summary 2>&1 || true)
  110.  
  111.     HAS_REAL_GPU=false
  112.     HAS_LLVMPIPE=false
  113.     echo "$VK_OUT" | grep -qiE "radv|anv|nv_|nvidia" && HAS_REAL_GPU=true
  114.     echo "$VK_OUT" | grep -qi "llvmpipe\|lavapipe"   && HAS_LLVMPIPE=true
  115.  
  116.     if echo "$VK_OUT" | grep -qi "error\|cannot open"; then
  117.         err "vulkaninfo returned an error — Vulkan is not initializing."
  118.         info "Try: sudo dnf install mesa-vulkan-drivers"
  119.         SUMMARY[vulkan]="ERROR — failed to initialize"
  120.     elif $HAS_REAL_GPU; then
  121.         ok "Vulkan is working on your real GPU."
  122.         # print each detected driver
  123.         echo "$VK_OUT" | grep -iE "driverName" | while IFS= read -r line; do
  124.             drv=$(echo "$line" | awk -F'=' '{print $2}' | xargs)
  125.             case "${drv,,}" in
  126.                 llvmpipe|lavapipe) info "driverName = $drv  ${YEL}(software fallback — normal on hybrid systems, not your render GPU)${RST}" ;;
  127.                 *)                 info "driverName = $drv" ;;
  128.             esac
  129.         done
  130.         if $HAS_LLVMPIPE && $HYBRID; then
  131.             warn "llvmpipe is listed alongside your real GPU driver — this is normal on hybrid systems. It is a software fallback ICD and will not be used for rendering."
  132.         fi
  133.         SUMMARY[vulkan]="OK"
  134.     elif $HAS_LLVMPIPE; then
  135.         err "Only llvmpipe/Lavapipe (software renderer) detected — real GPU driver not loaded."
  136.         info "Check mesa-vulkan-drivers is installed and your session is using the GPU."
  137.         info "Try: sudo dnf install mesa-vulkan-drivers"
  138.         SUMMARY[vulkan]="ERROR — software renderer only"
  139.     else
  140.         warn "Could not clearly identify GPU driver from vulkaninfo output."
  141.         info "Check manually: vulkaninfo --summary | grep -iE 'GPU|driver'"
  142.         SUMMARY[vulkan]="WARN — unclear"
  143.     fi
  144. fi
  145.  
  146. # ── Step 2: Vulkan video extensions ──────────────────────────
  147. hdr "Step 2 — Vulkan video extensions"
  148.  
  149. if command -v vulkaninfo &>/dev/null; then
  150.     VKFLAGS=""
  151.     [ "$GPU_VENDOR" = "intel" ] && VKFLAGS="ANV_DEBUG=video-decode,video-encode"
  152.  
  153.     VK_VIDEO=$(env $VKFLAGS vulkaninfo 2>/dev/null | grep -i "video" || true)
  154.  
  155.     if echo "$VK_VIDEO" | grep -qi "VK_KHR_video_decode_queue\|VK_KHR_video_queue"; then
  156.         ok "Vulkan video extensions found — VK_KHR_video_decode_queue detected."
  157.         echo "$VK_VIDEO" | grep -iE "VK_KHR_video" | head -6 | while IFS= read -r line; do info "  $line"; done
  158.         SUMMARY[vkvideo]="OK"
  159.     elif [ -n "$VK_VIDEO" ]; then
  160.         warn "Some video-related output found but VK_KHR_video_decode_queue not detected."
  161.         echo "$VK_VIDEO" | head -5 | while IFS= read -r line; do info "  $line"; done
  162.         info "Vulkan video may be partially supported — check the full extension list."
  163.         SUMMARY[vkvideo]="WARN — partial"
  164.     else
  165.         if [ "$GPU_VENDOR" = "nvidia" ]; then
  166.             warn "No Vulkan video extensions found. This is expected for NVIDIA on Fedora — use VA-API instead."
  167.         else
  168.             warn "No Vulkan video extensions found."
  169.             info "For Intel: make sure you used ANV_DEBUG=video-decode,video-encode (this script does it automatically)."
  170.             info "For AMD: install mesa-vulkan-drivers-freeworld from RPM Fusion."
  171.         fi
  172.         SUMMARY[vkvideo]="WARN — not available"
  173.     fi
  174. else
  175.     warn "vulkaninfo not available — skipping Vulkan video check."
  176.     SUMMARY[vkvideo]="SKIPPED"
  177. fi
  178.  
  179. # ── Step 3: VA-API ────────────────────────────────────────────
  180. hdr "Step 3 — VA-API"
  181.  
  182. if ! need_cmd vainfo "libva-utils"; then
  183.     SUMMARY[vaapi]="ERROR — vainfo not installed"
  184. else
  185.     VAINFO=$(vainfo 2>&1 || true)
  186.  
  187.     if echo "$VAINFO" | grep -qi "failed\|cannot open\|error"; then
  188.         err "VA-API initialization failed."
  189.         case "$GPU_VENDOR" in
  190.             intel)  info "Install intel-media-driver: sudo dnf install intel-media-driver" ;;
  191.             amd)    info "Install mesa-va-drivers-freeworld: sudo dnf install mesa-va-drivers-freeworld" ;;
  192.             nvidia) info "Install libva-nvidia-driver: sudo dnf install libva-nvidia-driver" ;;
  193.             *)      info "Check that the correct VA-API driver for your GPU is installed." ;;
  194.         esac
  195.         SUMMARY[vaapi]="ERROR — failed to initialize"
  196.     elif echo "$VAINFO" | grep -qiE "VAEntrypointVLD|h264|hevc|vp9|h265|av1"; then
  197.         ok "VA-API is working and exposes decode profiles."
  198.         PROFILES=$(echo "$VAINFO" | grep -iE "VAProfile" | head -6 || true)
  199.         echo "$PROFILES" | while IFS= read -r line; do info "  $line"; done
  200.         SUMMARY[vaapi]="OK"
  201.     elif echo "$VAINFO" | grep -qi "driver"; then
  202.         warn "VA-API driver loaded but no codec profiles detected."
  203.         info "You may be missing freeworld codec packages."
  204.         case "$GPU_VENDOR" in
  205.             amd|intel) info "Try: sudo dnf install mesa-va-drivers-freeworld" ;;
  206.             nvidia)    info "Try: sudo dnf install libva-nvidia-driver" ;;
  207.         esac
  208.         SUMMARY[vaapi]="WARN — driver found but no codecs"
  209.     else
  210.         warn "VA-API output unclear — check manually with: vainfo"
  211.         SUMMARY[vaapi]="WARN — unclear"
  212.     fi
  213. fi
  214.  
  215. # ── Step 4: Package check ─────────────────────────────────────
  216. hdr "Step 4 — Driver packages"
  217.  
  218. PKG_OUT=$(rpm -qa 2>/dev/null | grep -E "mesa-vulkan|mesa-va|libva-nvidia|nvidia-vaapi|intel-media" || true)
  219.  
  220. if [ -z "$PKG_OUT" ]; then
  221.     err "No relevant driver packages found."
  222.     case "$GPU_VENDOR" in
  223.         intel)  info "Install: sudo dnf install mesa-vulkan-drivers-freeworld intel-media-driver" ;;
  224.         amd)    info "Install: sudo dnf install mesa-vulkan-drivers-freeworld mesa-va-drivers-freeworld" ;;
  225.         nvidia) info "Install: sudo dnf install libva-nvidia-driver" ;;
  226.         *)      info "Install mesa-vulkan-drivers-freeworld (AMD/Intel) or libva-nvidia-driver (NVIDIA)" ;;
  227.     esac
  228.     SUMMARY[pkgs]="ERROR — missing packages"
  229. else
  230.     HAS_FREEWORLD=false
  231.     echo "$PKG_OUT" | while IFS= read -r pkg; do info "$pkg"; done
  232.     echo "$PKG_OUT" | grep -q "freeworld" && HAS_FREEWORLD=true
  233.  
  234.     if echo "$PKG_OUT" | grep -q "freeworld" || echo "$PKG_OUT" | grep -qE "libva-nvidia|intel-media"; then
  235.         ok "Codec packages look good."
  236.         SUMMARY[pkgs]="OK"
  237.     else
  238.         warn "Only standard mesa-vulkan-drivers found — missing freeworld variant."
  239.         info "For H.264/H.265 support, install from RPM Fusion:"
  240.         info "  sudo dnf install mesa-vulkan-drivers-freeworld"
  241.         SUMMARY[pkgs]="WARN — freeworld packages missing"
  242.     fi
  243. fi
  244.  
  245. # ── Step 5: Firefox env check ─────────────────────────────────
  246. hdr "Step 5 — Firefox VA-API environment"
  247.  
  248. if command -v firefox &>/dev/null; then
  249.     WAYLAND_VAL="${MOZ_ENABLE_WAYLAND:-}"
  250.     SESSION="${XDG_SESSION_TYPE:-unknown}"
  251.  
  252.     info "Session type: $SESSION"
  253.  
  254.     if [ "$SESSION" = "wayland" ]; then
  255.         if [ "$WAYLAND_VAL" = "1" ]; then
  256.             ok "MOZ_ENABLE_WAYLAND=1 is set — Firefox will use Wayland and VA-API."
  257.         else
  258.             warn "MOZ_ENABLE_WAYLAND is not set (or not 1). Firefox may not use hardware decode on Wayland."
  259.             info "Add to your shell profile: export MOZ_ENABLE_WAYLAND=1"
  260.         fi
  261.     else
  262.         info "Not running Wayland — MOZ_ENABLE_WAYLAND not required."
  263.     fi
  264.  
  265.     # check about:config equivalents via profile prefs
  266.     FFPROF=$(find ~/.mozilla/firefox -name "prefs.js" 2>/dev/null | head -1 || true)
  267.     if [ -n "$FFPROF" ]; then
  268.         VAAPI_PREF=$(grep "media.ffmpeg.vaapi.enabled" "$FFPROF" 2>/dev/null || true)
  269.         if echo "$VAAPI_PREF" | grep -q "true"; then
  270.             ok "media.ffmpeg.vaapi.enabled = true in Firefox prefs."
  271.             SUMMARY[browser]="OK"
  272.         elif echo "$VAAPI_PREF" | grep -q "false"; then
  273.             warn "media.ffmpeg.vaapi.enabled = false — hardware decode disabled in Firefox."
  274.             info "Enable in about:config: media.ffmpeg.vaapi.enabled = true"
  275.             SUMMARY[browser]="WARN — vaapi disabled in Firefox"
  276.         else
  277.             info "media.ffmpeg.vaapi.enabled not explicitly set (uses default)."
  278.             info "To ensure hardware decode: set media.ffmpeg.vaapi.enabled = true in about:config"
  279.             SUMMARY[browser]="INFO — pref not set"
  280.         fi
  281.     else
  282.         info "No Firefox profile found — skipping prefs check."
  283.         SUMMARY[browser]="SKIPPED"
  284.     fi
  285. else
  286.     info "Firefox not installed — skipping Firefox check."
  287.     SUMMARY[browser]="SKIPPED"
  288. fi
  289.  
  290. # ── Summary ───────────────────────────────────────────────────
  291. echo -e "\n${BOLD}╔══════════════════════════════════════════════════╗${RST}"
  292. echo -e "${BOLD}║   Summary                                        ║${RST}"
  293. echo -e "${BOLD}╚══════════════════════════════════════════════════╝${RST}"
  294.  
  295. print_summary_line() {
  296.     local label="$1"
  297.     local value="$2"
  298.     case "$value" in
  299.         OK*)       echo -e "  ${GRN}${RST}  $(printf '%-18s' "$label") $value" ;;
  300.         WARN*)     echo -e "  ${YEL}!${RST}  $(printf '%-18s' "$label") $value" ;;
  301.         ERROR*)    echo -e "  ${RED}${RST}  $(printf '%-18s' "$label") $value" ;;
  302.         SKIPPED*)  echo -e "  ${BLU}-${RST}  $(printf '%-18s' "$label") $value" ;;
  303.         *)         echo -e "  ${BLU}?${RST}  $(printf '%-18s' "$label") $value" ;;
  304.     esac
  305. }
  306.  
  307. echo ""
  308. print_summary_line "GPU vendor"     "${SUMMARY[gpu]}"
  309. print_summary_line "Vulkan"         "${SUMMARY[vulkan]}"
  310. print_summary_line "Vulkan video"   "${SUMMARY[vkvideo]}"
  311. print_summary_line "VA-API"         "${SUMMARY[vaapi]}"
  312. print_summary_line "Packages"       "${SUMMARY[pkgs]}"
  313. print_summary_line "Firefox"        "${SUMMARY[browser]}"
  314. echo ""
  315.  
  316. # ── install suggestions ───────────────────────────────────────
  317. NEEDS_RPMFUSION=false
  318. echo "$PKG_OUT" | grep -q "freeworld" || NEEDS_RPMFUSION=true
  319.  
  320. if $NEEDS_RPMFUSION; then
  321.     echo -e "${BOLD}RPM Fusion note:${RST}"
  322.     info "Some packages above require RPM Fusion. Enable it with:"
  323.     info "  sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-\$(rpm -E %fedora).noarch.rpm"
  324.     info "  sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-\$(rpm -E %fedora).noarch.rpm"
  325.     echo ""
  326. fi
  327.  
  328. echo -e "${BLU}For more info:${RST} https://fedoraproject.org/wiki/Hardware_Video_Acceleration"
  329. echo ""
Advertisement
Comments
  • Mekfizak
    72 days
    # CSS 0.83 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1S1iTruSLkgEPO8QtTuo2twS4f2FoJ3_l0-p4GKqeAUY/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8.  
    9. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    10.  
    11. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification).
Add Comment
Please, Sign In to add comment