dgl icon indicating copy to clipboard operation
dgl copied to clipboard

GraphBolt

Open a1941409241 opened this issue 11 months ago • 7 comments

When I using the new feature GraphBolt. I meet this question: can't find c++ library graphbolt This is my environment: pytorch(2.2 + cu118)

a1941409241 avatar Feb 27 '24 02:02 a1941409241

Hi, could you please follow the bug report template to provide more information? Such as your DGL version, install methods, OS, etc?

jermainewang avatar Feb 29 '24 01:02 jermainewang

I replace my pytorch version with 2.1and it worked. Thank you

发自我的iPhone

------------------ Original ------------------ From: Minjie Wang @.> Date: Thu,Feb 29,2024 9:52 AM To: dmlc/dgl @.> Cc: twdream @.>, Author @.> Subject: Re: [dmlc/dgl] GraphBolt (Issue #7157)

Hi, could you please follow the bug report template to provide more information? Such as your DGL version, install methods, OS, etc?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

a1941409241 avatar Feb 29 '24 01:02 a1941409241

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

github-actions[bot] avatar Mar 31 '24 01:03 github-actions[bot]

Hi, @a1941409241 @jermainewang I find the reason. This issue is due to the libgraphbolt_pytorch_2.2.2.so file does not exist at all. Could you developers add the newest .so files to the dgl library? If not, you can just change your version of libgraphbolt_pytorch in the dgl/graphbolt/__init__.py , like what I have done in the following:

def load_graphbolt():
    """Load Graphbolt C++ library"""
    vers = torch.__version__.split("+", maxsplit=1)[0]

    if sys.platform.startswith("linux"):
        basename = f"libgraphbolt_pytorch_2.2.1.so"
    elif sys.platform.startswith("darwin"):
        basename = f"libgraphbolt_pytorch_{vers}.dylib"
    elif sys.platform.startswith("win"):
        basename = f"graphbolt_pytorch_{vers}.dll"
    else:
        raise NotImplementedError("Unsupported system: %s" % sys.platform)

    dirname = os.path.dirname(libinfo.find_lib_path()[0])
    path = os.path.join(dirname, "graphbolt", basename)
    if not os.path.exists(path):
        raise FileNotFoundError(
            f"Cannot find DGL C++ graphbolt library at {path}"
        )

    try:
        torch.classes.load_library(path)
    except Exception:  # pylint: disable=W0703
        raise ImportError("Cannot load Graphbolt C++ library")

This can fix your error.

BraveDrXuTF avatar Apr 21 '24 03:04 BraveDrXuTF

Hi, @a1941409241 @jermainewang I find the reason. This issue is due to the libgraphbolt_pytorch_2.2.2.so file does not exist at all. Could you developers add the newest .so files to the dgl library? If not, you can just change your version of libgraphbolt_pytorch in the dgl/graphbolt/__init__.py , like what I have done in the following:

Is this solution safe? It is basically mixing GraphBolt compiled for an older torch version with a newer torch installation.

mfbalin avatar Apr 21 '24 05:04 mfbalin

Hi, @a1941409241 @jermainewang I find the reason. This issue is due to the libgraphbolt_pytorch_2.2.2.so file does not exist at all. Could you developers add the newest .so files to the dgl library? If not, you can just change your version of libgraphbolt_pytorch in the dgl/graphbolt/__init__.py , like what I have done in the following:

Is this solution safe? It is basically mixing GraphBolt compiled for an older torch version with a newer torch installation.

I guess changing the version is just an expedient solution. Of course it works.

BraveDrXuTF avatar Apr 21 '24 07:04 BraveDrXuTF

We will release a DGL 2.2 which supports Pytorch 2.2.2 and 2.3 in early May.

frozenbugs avatar Apr 25 '24 02:04 frozenbugs

This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you

github-actions[bot] avatar May 26 '24 01:05 github-actions[bot]