forked from w-okada/voice-changer
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from deiteris/fixes
Try force GPU clocks for NVIDIA
- Loading branch information
Showing
16 changed files
with
184 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@echo off | ||
nvidia-smi --query-supported-clocks=graphics,memory --format=csv,noheader,nounits > temp.txt | ||
|
||
REM Read the first line from the temporary file | ||
set /p firstLine=<temp.txt | ||
|
||
REM Extract the first comma-separated string | ||
for /f "tokens=1,2 delims=, " %%a in ("%firstLine%") do ( | ||
set gpu_clock=%%a | ||
set memory_clock=%%b | ||
) | ||
|
||
REM Print the extracted string | ||
echo GPU Clock: %gpu_clock% | ||
echo Memory Clock: %memory_clock% | ||
|
||
REM Clean up the temporary file | ||
del temp.txt | ||
|
||
:force_clocks | ||
nvidia-smi --lock-gpu-clocks=%gpu_clock% | ||
nvidia-smi --lock-memory-clocks=%memory_clock% | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@echo off | ||
nvidia-smi --reset-gpu-clocks | ||
nvidia-smi --reset-memory-clocks | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# From https://stackoverflow.com/a/43172958 | ||
import os | ||
import ctypes | ||
|
||
class AdminStateUnknownError(Exception): | ||
"""Cannot determine whether the user is an admin.""" | ||
pass | ||
|
||
|
||
def is_user_admin(): | ||
# type: () -> bool | ||
"""Return True if user has admin privileges. | ||
Raises: | ||
AdminStateUnknownError if user privileges cannot be determined. | ||
""" | ||
try: | ||
return os.getuid() == 0 | ||
except AttributeError: | ||
pass | ||
try: | ||
return ctypes.windll.shell32.IsUserAnAdmin() == 1 | ||
except AttributeError: | ||
raise AdminStateUnknownError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.