Skip to content

Instantly share code, notes, and snippets.

@asuna
Created June 7, 2023 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asuna/1c92bb69e8b1556afefed4e506ec1313 to your computer and use it in GitHub Desktop.
Save asuna/1c92bb69e8b1556afefed4e506ec1313 to your computer and use it in GitHub Desktop.
@echo off
REM Get the list of GPU devices
for /f "skip=1 tokens=1" %%i in ('nvidia-smi --query-gpu=index --format=csv,noheader,nounits') do (
set GPU_INDEX=%%i
echo Setting GPU !GPU_INDEX! to TCC mode
nvidia-smi --id=!GPU_INDEX! --compute-mode=exclusive_process
)
echo All GPUs have been set to TCC mode
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment