Skip to content

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

AMD-SAM-Toggle

Per-game AMD SAM (Smart Access Memory / Resizable BAR) control utility for Windows.

AMD does not provide per-game SAM control — it's a global toggle only. Some games crash when SAM is enabled on certain Radeon GPUs. This tool automatically disables or enables SAM before launching a game and restores it after the game exits.

How It Works

  1. Reads KMD_RebarControlMode from the Windows registry to detect SAM state
  2. Changes the value and restarts the AMD display driver via pnputil (no reboot required)
  3. Launches the game and monitors the process
  4. Restores SAM to its original state after the game exits

Features

  • Auto-detects Radeon discrete GPU registry path
  • Real-time SAM status display
  • Per-game SAM profiles (ON / OFF / Default)
  • Automatic SAM restore on game exit, crash, or utility termination
  • Manual SAM toggle button
  • Safety state file for recovery from abnormal termination

Requirements

  • Windows 10 2004+ or Windows 11
  • AMD Radeon GPU with SAM/Resizable BAR support
  • Administrator privileges
  • Python 3.11+ (for development) or the built executable

Installation

Using the built executable

Download SamOnOff.exe from Releases and run it. It will request administrator privileges automatically.

Building from source

pip install -r requirements.txt
pyinstaller --onefile --uac-admin --name=SamOnOff main.py

The output executable will be at dist/SamOnOff.exe.

Alternatively, run build.bat.

Configuration

Driver Restart Delay

After restarting the AMD driver, the tool waits for the display to stabilize before launching the game. The default delay is 8 seconds.

If your screen takes longer to recover after a driver restart, increase STABILIZATION_DELAY in driver_restart.py:

STABILIZATION_DELAY = 8  # seconds to wait after driver restart

Game Profiles

Game profiles are stored in config.json (auto-created next to the executable). You can also edit this file directly:

{
  "games": [
    {
      "name": "MyGame",
      "exe_name": "MyGame.exe",
      "exe_path": "C:\\path\\to\\MyGame.exe",
      "sam_mode": "off"
    }
  ]
}

sam_mode values:

  • "off" — Disable SAM before launch
  • "on" — Enable SAM before launch
  • "default" — Keep current SAM state (no driver restart)

Tested Environment

Component Version
OS Windows 11 Pro
GPU AMD Radeon RX 7900 XTX
Adrenalin 26.1.1
Driver 32.0.23017.1001

Other Radeon GPUs with SAM support should work, but have not been tested.

Disclaimer

This is an unofficial, third-party utility. It is not affiliated with, endorsed by, or supported by AMD.

This tool modifies Windows registry values and restarts the display driver. Use at your own risk. The author is not responsible for any damage, data loss, system instability, or other issues arising from the use of this software.

Always ensure your important work is saved before using this tool, as driver restarts will briefly interrupt display output.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages