upgraded utils

This commit is contained in:
Saifeddine ALOUI 2024-01-31 21:44:53 +01:00
parent 2c60c8f47c
commit 19118cfe6e

View File

@ -338,18 +338,19 @@ def check_torch_version(min_version, min_cuda_versio=12):
def reinstall_pytorch_with_cuda():
try:
import conda.cli
ASCIIColors.info("Installing cuda 12.1.1") # -c nvidia/label/cuda-12.1.1 -c nvidia -c conda-forge
result = subprocess.run(["conda", "install", "-c", "nvidia/label/cuda-12.1.1", "-c", "nvidia", "-c", "conda-forge", "cuda-toolkit","-y"])
result = conda.cli.main(["conda", "install", "-c", "nvidia/label/cuda-12.1.1", "-c", "nvidia", "-c", "conda-forge", "cuda-toolkit","-y"])
except Exception as ex:
ASCIIColors.error(ex)
try:
ASCIIColors.info("Installing ninja") # -c nvidia/label/cuda-12.1.1 -c nvidia -c conda-forge
result = subprocess.run(["conda", "install", "-c", "nvidia/label/cuda-12.1.1", "-c", "nvidia", "-c", "conda-forge", "ninja", "-y"])
result = conda.cli.main(["conda", "install", "-c", "nvidia/label/cuda-12.1.1", "-c", "nvidia", "-c", "conda-forge", "ninja", "-y"])
except Exception as ex:
ASCIIColors.error(ex)
try:
ASCIIColors.info("Installing cuda compiler") # -c nvidia/label/cuda-12.1.1 -c nvidia -c conda-forge
result = subprocess.run(["conda", "install", "-c", "nvidia/label/cuda-12.1.1", "-c", "nvidia", "-c", "conda-forge", "cuda-compiler", "-y"])
result = conda.cli.main(["conda", "install", "-c", "nvidia/label/cuda-12.1.1", "-c", "nvidia", "-c", "conda-forge", "cuda-compiler", "-y"])
except Exception as ex:
ASCIIColors.error(ex)
try: