mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-24 08:36:10 +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
|
#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 python \
|
||||||
RUN python3 -m venv --copies python \
|
|
||||||
&& . python/bin/activate \
|
&& . python/bin/activate \
|
||||||
&& pip install -r requirements-without-poetry.txt
|
&& pip install -r requirements-without-poetry.txt
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,25 @@ from rich.logging import RichHandler
|
|||||||
print("Env vars:")
|
print("Env vars:")
|
||||||
print(os.environ)
|
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:
|
def init_logger() -> None:
|
||||||
IN_COLAB = os.getenv("COLAB_RELEASE_TAG")
|
IN_COLAB = os.getenv("COLAB_RELEASE_TAG")
|
||||||
IS_TEST = "test" in Path(__file__).parent.stem
|
IS_TEST = "test" in Path(__file__).parent.stem
|
||||||
|
|||||||
Reference in New Issue
Block a user