Skip to content

importing nvmath beta 5 freezes system logger #36

@yangcal

Description

@yangcal

With nvmath-python==0.5.0, importing nvmath will initialize the system logger with default setting and kinda locks the configuration.

Reproducer:

import nvmath
import logging

# Turn on logging and set the level to DEBUG to print memory management messages.
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)-8s %(message)s", datefmt="%m-%d %H:%M:%S")

logger = logging.getLogger()
logger.info("This is an INFO message") # this will not print out

The bug is identified to come from cudss loading during import, specifically https://github.com/NVIDIA/nvmath-python/blob/main/nvmath/_utils.py#L296-L298.

The issue will be resolved in the next nvmath-python release, for a WAR, please set force=True for setting global system logger, e.g,

logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)-8s %(message)s", datefmt="%m-%d %H:%M:%S", force=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions