Comments (27)
Oh wait a second.
This line breaks X11 forwarding:
import os
os.environ["DISPLAY"] = ""
But this line doesn't and also no 'Impossible...' error appear:
import os
del os.environ["DISPLAY"]
It works! Thanks!
You can close it now, or later when you find more permanent solution.
from nocturne.
My understanding is that the package runs on the cluster, and only visualization through XQuartz/X11 forwarding is done on Mac. If I enable X11 forwarding, sf::RenderTexture::getMaximumAntialiasingLevel() returns 16. If I don't enable X11 forwarding nothing gets printed and I get:
Failed to open X11 display; make sure the DISPLAY environment variable is set correctly
Aborted (core dumped)
In nocturne:
I don't need X11 forwarding for tasks without rendering. E.g. imitation learning script works without it.
When I run a script where a scene is rendered (e.g. create_env.py/rendering.py),
- without X11 forwarding it will crash:
Failed to open X11 display; make sure the DISPLAY environment variable is set correctly
Aborted (core dumped)
-
with X11 forwarding but without Eugene's fix, it will run but no scene is rendered (empty output images). And this is returned:
Impossible to create render texture (failed to link the target texture to the frame buffer)
-
with X11 forwarding and with Eugene's fix, it will run just fine.
Hope it helps
from nocturne.
@eugenevinitsky, running on a cluster with: Tesla T4, Driver Version: 470.82.01, CUDA Version: 11.4. Visualizing on Mac with XQuartz.
@nathanlct, on it
from nocturne.
We'll keep looking into this tomorrow but in the meantime if you pull master we've fixed the issues with nocturne_functions.py
If there's any other blocking issues on the repo do let us know!
from nocturne.
Thank you for testing this out! @nathanlct should respond in a bit (though he's in French timezone so I'm not sure when)
I think I have a "hack" that will solve this temporarily while we try to find a permanent solution; I think if you in the code you are running do:
import os del os.environ["DISPLAY"]
that will put things into headless mode and then everything should render properly using pyvirtualdisplay as the renderer
Then display forwarding breaks:
python nocturne_functions.py
Failed to open X11 display; make sure the DISPLAY environment variable is set correctly
Aborted (core dumped)
from nocturne.
Oh yes, this is an issue with your machine I suspect that we haven't seen yet on our machines but I think we should have a solution; the machine appears to support a particular anti-aliasing level that is lower than the machines on our cluster.
@nathanlct is there a way to detect the maximum level of antialiasing and use that? Or make the antialiasing level set in the configs so that users can fix this when they see the issue?
In the meantime, we'll have a PR fixing this open in a few minutes.
from nocturne.
If you want a quick fix you can pull in #30 but we may take a second to merge that while we figure out a prettier solution
from nocturne.
Thanks for the quick reply. It fixed the first error but the second still remains: Impossible to create render texture (failed to link the target texture to the frame buffer)
.
I've run basic example from SFML tutorial (https://www.sfml-dev.org/tutorials/2.5/start-vc.php) and the SFML package
worked fine
from nocturne.
Oof, sorry to hear that. We're looking into this ASAP. Could you tell us what GPU you have or any other information you have about your machine?
from nocturne.
@BenQLange Also, would you be able to try the second example at this link: https://www.sfml-dev.org/tutorials/2.5/graphics-draw.php
ie. the example that creates a render texture, which seems to be the problem here. That should help us locate the issue.
from nocturne.
@nathanlct, I've done a sprite and off-screen drawing tutorials. All worked as advertised.
from nocturne.
Just to confirm, the error is happening on your macbook or on the cluster? If it's the cluster I'll see if I can make a machine with those specs
from nocturne.
Cluster
from nocturne.
kk, this might take a little bit longer as I'm not able to reproduce your issues yet; we will try to reproduce it and get back to you. However, the line that's causing your issue is presumably the rendering line in create_env.py? The rest of Nocturne hopefully should work for you on the cluster besides rendering so if you don't need rendering hopefully you are not
blocked?
If you don't need rendering on the cluster but just need other nocturne functionality, you could test if the other functionality works by running examples/nocturne_functions.py
from nocturne.
@BenQLange We're trying to reproduce the error you're getting. Just confirming since you mentioned rendering on Mac and I'm not sure what effects this might have, is the following correct:
- when you get the error, are you using the same process of running nocturne on the cluster and visualizing on your Mac?
- if you just run the following code on the cluster without any Mac visualization, does it work?
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderTexture renderTexture;
renderTexture.create(500, 500);
renderTexture.clear();
renderTexture.display();
}
from nocturne.
kk, this might take a little bit longer as I'm not able to reproduce your issues yet; we will try to reproduce it and get back to you. However, the line that's causing your issue is presumably the rendering line in create_env.py? The rest of Nocturne hopefully should work for you on the cluster besides rendering so if you don't need rendering hopefully you are not blocked?
If you don't need rendering on the cluster but just need other nocturne functionality, you could test if the other functionality works by running examples/nocturne_functions.py
Ok ok. Thanks for helping. I run examples/nocturne_functions.py. I got the following error at line 128:
/home/bernard.lange/nocturne/examples/rendering/scene_with_peds.png
Error executing job with overrides: []
TypeError: Unregistered type : nocturne::Pedestrian
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "examples/nocturne_functions.py", line 128, in main
pedestrians = scenario.getPedestrians()
TypeError: Unable to convert function return value to a Python type! The signature was
(self: nocturne_cpp.Scenario) -> List[nocturne::Pedestrian]
from nocturne.
Yep, that's on us. We have some missing pedestrian functionality that we just realized, there'll be a PR in shortly to fix it. Otherwise though, that run confirms that everything besides rendering and pedestrian functionality is working for you!
from nocturne.
Yep, that's on us. We have some missing pedestrian functionality that we just realized, there'll be a PR in shortly to fix it. Otherwise though, that run confirms that everything besides rendering and pedestrian functionality is working for you!
Great. Thank you!
from nocturne.
@BenQLange We're trying to reproduce the error you're getting. Just confirming since you mentioned rendering on Mac and I'm not sure what effects this might have, is the following correct:
- when you get the error, are you using the same process of running nocturne on the cluster and visualizing on your Mac?
- if you just run the following code on the cluster without any Mac visualization, does it work?
#include <SFML/Graphics.hpp> int main() { sf::RenderTexture renderTexture; renderTexture.create(500, 500); renderTexture.clear(); renderTexture.display(); }
- Yes, the same.
- The script works.
from nocturne.
@BenQLange Would you be able to try the following (at your convenience!):
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderTexture renderTexture;
renderTexture.create(2000, 2000);
renderTexture.clear(sf::Color::Blue);
renderTexture.display();
const sf::Image image = renderTexture.getTexture().copyToImage();
const unsigned char* pixels = (const unsigned char*)image.getPixelsPtr();
sf::RenderTexture renderTexture2;
sf::ContextSettings texture_settings;
texture_settings.antialiasingLevel = std::min(sf::RenderTexture::getMaximumAntialiasingLevel(), 4u);
renderTexture2.create(2000, 2000, texture_settings);
renderTexture2.clear(sf::Color::Blue);
renderTexture2.display();
}
That would allow us to test a few other differences I'm seeing between our code and the SFML example.
from nocturne.
@nathanlct, I think we are getting closer. This script gives the same error. It also gives additional two new errors:
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Impossible to create render texture (failed to link the target texture to the frame buffer)
The 'Impossible...' error seems to be caused by line 'texture_settings.antialiasingLevel...' . If I comment it out, the output is:
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
The first two errors seems to be XQuartz related: XQuartz/XQuartz#144. Not sure, if it has anything to do with 'Impossible...' error
from nocturne.
Thank you for testing this out! @nathanlct should respond in a bit (though he's in French timezone so I'm not sure when)
I think I have a "hack" that will solve this temporarily while we try to find a permanent solution; I think if you in the code you are running do:
import os
del os.environ["DISPLAY"]
that will put things into headless mode and then everything should render properly using pyvirtualdisplay as the renderer
from nocturne.
Setting the environment variable LIBGL_ALWAYS_INDIRECT to 1 fixes the libGL errors (It's XQuartz related). Now I only have:
Impossible to create render texture (failed to link the target texture to the frame buffer)
from nocturne.
YESSSSSS. Okay, we'll try to find a more permanent solution for you and will ping you on this issue when we do. Thank you for helping us debug this!
from nocturne.
Sounds good. Happy to help!
from nocturne.
Glad the problem is solved @BenQLange! :)
I'm a bit confused though as to what happens on Mac vs. on your cluster, are you saying that it's only working with X11 forwarding, and still erroring if you run it on the cluster, unless we remove the anti-aliasing setters? If so, would you able to print what sf::RenderTexture::getMaximumAntialiasingLevel()
returns (without X11 forwarding)?
from nocturne.
Definitely helps! Also, this'll be much clearer once we upgrade the docs but Nocturne can run on cluster or local machine since the simulator itself runs on CPU; it's just the RL / IL examples that are GPU accelerated
from nocturne.
Related Issues (20)
- Add support for running Nocturne entirely on GPU
- Issues Running MAPPO HOT 11
- [Bug] HOT 9
- [Feature] Scenario method to return all visible vehicles / pedestrians / cyclists
- RuntimeError: DataLoader worker is killed by signal: Floating point exception. HOT 30
- [Question] Need Help Installing HOT 9
- [Feature] Add installation instructions for M1 chips HOT 1
- [Feature] Add support for Argoverse 2
- Will the other cars in the simulation react to the ego agent's actions? HOT 9
- [Bug] Unexpected behavior when setting padding=True in scenario.visible_state() HOT 3
- [Feature] Pretrained agents HOT 2
- [Bug] Dependencies not listed in environment file HOT 1
- [Bug] Problem installing it on Windows 10 HOT 1
- [Bug] Mistake in continuous action space definition HOT 2
- [Question] Optimal hyperparameters and scripts to reach 2000 steps/sec training speed HOT 3
- Comparison of missing driving simulators in the nocturne paper[Question] HOT 3
- [Question] SFML/Graphics.hpp file not found HOT 4
- [Feature] Is it possible to support user-specific map? HOT 1
- [Feature] Don't install `cfgs` module as a top level Python import HOT 4
- [Question] How is the masking achieved? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nocturne.