Skip to content

Tensorflow pollutes the console output with missing GPU library warnings. #1

@ITmaze

Description

@ITmaze

My VM doesn't have GPU acceleration. When I run a test command, the console has warnings like this:

2023-02-10 10:02:02.669259: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-02-10 10:02:02.864146: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-02-10 10:02:02.864303: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. 2023-02-10 10:02:03.882298: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory 2023-02-10 10:02:03.882433: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory 2023-02-10 10:02:03.882446: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.

It appears that adding TF_CPP_MIN_LOG_LEVEL=3 on the command line suppresses this behaviour. An alternative is to import os and to add os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3', but that kills the idea of just importing numpy.

Perhaps updating README.md to add the following before executing picoGPT for the first time is the quickest way to deal with this. It will also provide a point to discuss acceleration. Perhaps this is also the place to describe disabling the progress bar for generation if that's something that is desirable.

export TF_CPP_MIN_LOG_LEVEL=3

On a personal note, this is a sensational introduction to GPT and it's given me the incentive to start experimenting, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions