()
| 134 | |
| 135 | |
| 136 | def stop_mps(): |
| 137 | if is_mps_running(): |
| 138 | result = subprocess.run("echo quit | nvidia-cuda-mps-control", shell=True) |
| 139 | logger.info("Stopping MPS...") |
| 140 | if result.returncode == 0: |
| 141 | logger.info("MPS stopped successfully.") |
| 142 | else: |
| 143 | logger.warning("Failed to stop MPS.") |
| 144 | else: |
| 145 | logger.info("MPS is not running, no need to stop.") |
| 146 | |
| 147 | |
| 148 | def enable_mps(): |
no test coverage detected