ray: [core] "Windows fatal exception: access violation" cluttering terminal
What is the problem?
I am using Ray 1.1.0 with Python 3.7.6 to run an ActorPool. Each actor needs access to it’s own copy of a java virtual machine (created using jpype, which is a dependency of another package which is used by the Actors, but it seems to be the root of this issue). Ray seems to handle this just fine, however, it prints many lines of errors to the terminal, all of which are repeats of:
[2m[36m(pid=18064)[0m Windows fatal exception: access violation [2m[36m(pid=18064)[0m [2m[36m(pid=18064)[0m Stack (most recent call first): [2m[36m(pid=18064)[0m File “C:\ProgramData\Anaconda3\lib\site-packages\jpype_core.py”, line 222 in startJVM [2m[36m(pid=18064)[0m File “c:\Users\Kursti\Documents\Python\ray_access_violation.py”, line 15 in init [2m[36m(pid=18064)[0m File “C:\ProgramData\Anaconda3\lib\site-packages\ray\function_manager.py”, line 556 in actor_method_executor [2m[36m(pid=18064)[0m File “C:\ProgramData\Anaconda3\lib\site-packages\ray\worker.py”, line 383 in main_loop [2m[36m(pid=18064)[0m File “C:\ProgramData\Anaconda3\lib\site-packages\ray\workers/default_worker.py”, line 181 in <module> [2m[36m(pid=11676)[0m Windows fatal exception: access violation
Again, the code we’re running seems to work fine, but the terminal clutter makes it challenging to work with our code. This issue has also come up intermittently without using jpype, but is not reproducible. Any idea how we can fix this problem?
Reproduction (REQUIRED)
import psutil
import ray
import jpype
@ray.remote
class ObjectiveFunc(object):
def __init__(self):
self.java = jpype.startJVM()
class RayMap(object):
def __init__(self, num_workers):
self.workers = []
for _ in range(num_workers):
self.workers.append(ObjectiveFunc.remote())
num_cpus = psutil.cpu_count(logical=False)
ray.init(num_cpus=num_cpus, include_dashboard= True)
rm = RayMap(4)
If the code snippet cannot be run by itself, the issue will be closed with “needs-repro-script”.
- [X ] I have verified my script runs in a clean environment and reproduces the issue.
- [X ] I have verified the issue also occurs with the latest wheels.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 16 (9 by maintainers)
Hi Evan,
A partial solution to this problem is to use ray.init(log_to_driver=False) when initializing your ray cluster. This got rid of some of the mess in the terminal due to the particular library I was using (jpype), but the messages still show up sometimes related to other things (seems random). Wish I could help more, and if you find a solution please post to Github!
Thanks, Avi
On Fri, Feb 5, 2021 at 4:26 AM Evan Hu (YiFan Hu) notifications@github.com wrote:
Hmm, I think you might want to look at ray/services.py?