-
Notifications
You must be signed in to change notification settings - Fork 748
Python.NET & TensorFlow & CUDA: Could not load dynamic library 'cublas64_11.dll' #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is not a support forum. |
Support forum? This appears to be an issue with Python.NET not being able to load CUDA Drivers, as they load fine when using native python and not when attempting to load them using Python.NET. Thanks for the help though. |
Python.NET is not the entity loading those drivers. |
Despite the rude response from @lostmsu on a question regarding a configuration issue, this indeed was an issue caused by bad wiki documentation showing how to use Python.Net in a virtual environment. The fix, for others facing this or very similar issues, is to not use the code in the Wiki: var pathToVirtualEnv = @"path\to\env";
Environment.SetEnvironmentVariable("PATH", pathToVirtualEnv, EnvironmentVariableTarget.Process); Doing so will overwrite your Instead, append the path to your python virtual environment to your existing Instead, append the path to your virtual environment to your string pathToVirtualEnv = @"path\to\env";
var path = Environment.GetEnvironmentVariable("PATH");
Environment.SetEnvironmentVariable("PATH", path + ";" + pathToVirtualEnv, EnvironmentVariableTarget.Process); |
I updated the wiki Python.Net in a virtual environment so others don't experience the same issue. Have a nice day! |
Environment
Details
I am current working on using Python.NET to build C# environments for interaction TensorFlow Agents and am receiving a TensorFlow error attempting to load Cuda DLLs.
When I run pure python examples Tensor flow loads the CUDA DLLs without issue:
However, when I run an environment that uses a Python environment that is essentially a wrapper for an environment written in C# using Python.Net is recieve errors the Cuda DLLs were not found:
Minimal code to reproduce the issue:
With TicTacToeSharpEnvironmentWrapper.py
TicTacToeSharpEnvironment is a c# class libary compiled as 64bit dll
And PythonInitiliazer is used to initalize Python.Net
The full code works. The Python Wrapper of the C# environment passes the Tensorflow Agents unit tests for the Tic Tac Toe environment. The C# environment can be wrapped as Python or a Tensor flow environment and the various agents can train against the environment.
I don't think this is a compatibility issue using the x64 .Net DLL because I am using 64 bit python, but I a can't be certain.
The text was updated successfully, but these errors were encountered: