mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-13 23:53:02 +00:00
Back to "thin" venv, also print cuda stats
This commit is contained in:
@@ -32,8 +32,7 @@ COPY requirements-without-poetry.txt .
|
||||
|
||||
#RUN pip install -r requirements-without-poetry.txt
|
||||
|
||||
# NB: --copies flag creates a "thick" venv that copies the system python binary
|
||||
RUN python3 -m venv --copies python \
|
||||
RUN python3 -m venv python \
|
||||
&& . python/bin/activate \
|
||||
&& pip install -r requirements-without-poetry.txt
|
||||
|
||||
|
||||
@@ -25,6 +25,25 @@ from rich.logging import RichHandler
|
||||
print("Env vars:")
|
||||
print(os.environ)
|
||||
|
||||
|
||||
def print_gpu_info():
|
||||
print('========================================')
|
||||
print('Python interpreter', sys.executable)
|
||||
print('PyTorch version', torch.__version__)
|
||||
print('CUDA Available?', torch.cuda.is_available())
|
||||
print('CUDA Device count', torch.cuda.device_count())
|
||||
print('CUDA architectures library was compiled for', torch.cuda.get_arch_list())
|
||||
|
||||
#try:
|
||||
# from tensorflow.python.client import device_lib
|
||||
# print('local devices', str(device_lib.list_local_devices()).replace("\n", "\n "))
|
||||
#except ImportError:
|
||||
# print('no tensorflow - cannot list devices')
|
||||
# pass
|
||||
print('========================================', flush=True)
|
||||
|
||||
print_gpu_info()
|
||||
|
||||
def init_logger() -> None:
|
||||
IN_COLAB = os.getenv("COLAB_RELEASE_TAG")
|
||||
IS_TEST = "test" in Path(__file__).parent.stem
|
||||
|
||||
Reference in New Issue
Block a user