Skip to content
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

Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed; TypeError: constructor returned NULL #187

Closed
Saneesh opened this issue Jul 30, 2015 · 13 comments

Comments

@Saneesh
Copy link

Saneesh commented Jul 30, 2015

Hello,
I have successfully configured DIGITS in AWS with the supported system like Ubuntu 14.04, CUDA 7.0, GPU etc.

When I trying create the dataset through the browser, the following error is showing:

(parse_folder.py:13268): Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
Default value for log_file "/home/ubuntu/digits/digits/digits.log" invalid:
You do not have write permissions
Traceback (most recent call last):
File "/home/ubuntu/digits/tools/parse_folder.py", line 21, in <module>
digits.config.load_config()
File "/home/ubuntu/digits/digits/config/load.py", line 147, in load_config
option.apply()
File "/home/ubuntu/digits/digits/config/caffe_option.py", line 232, in apply
import caffe
File "/home/ubuntu/caffe/python/caffe/__init__.py", line 1, in <module>
from .pycaffe import Net, SGDSolver
File "/home/ubuntu/caffe/python/caffe/pycaffe.py", line 14, in <module>
import caffe.io
File "/home/ubuntu/caffe/python/caffe/io.py", line 2, in <module>
import skimage.io
File "/usr/local/lib/python2.7/dist-packages/skimage/io/__init__.py", line 15, in <module>
reset_plugins()
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 89, in reset_plugins
_load_preferred_plugins()
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 69, in _load_preferred_plugins
_set_plugin(p_type, preferred_plugins['all'])
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 81, in _set_plugin
use_plugin(plugin, kind=plugin_type)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 251, in use_plugin
_load(name)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 295, in _load
fromlist=[modname])
File "/usr/local/lib/python2.7/dist-packages/skimage/io/_plugins/matplotlib_plugin.py", line 4, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 109, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 11, in <module>
from . import backend_gtk3
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py", line 55, in <module>
cursors.MOVE          : Gdk.Cursor.new(Gdk.CursorType.FLEUR),
TypeError: constructor returned NULL

How can I fix this issue?

@lukeyeager
Copy link
Member

@joyofdata addressed this in his blog post:
http://www.joyofdata.de/blog/gpu-powered-deeplearning-with-nvidia-digits/

I have personally never run into this issue on EC2.

@Saneesh
Copy link
Author

Saneesh commented Jul 31, 2015

Hello Luke,
I'm facing this issue when I create the dataset using DIGITS in the browser. So the solution he mentioned is when I use ssh command I have use like "ssh -Xi ..." but in my case I'm not accessing using ssh. I'm accessing through the browser to create the dataset.

@gheinrich
Copy link
Contributor

Hi Saneesh, are you not using SSH to start the DIGITS server? You may want to have a look at @jashmenn's solution on BVLC/caffe#861 (comment). Can you try adding these two lines at the top of your /home/ubuntu/digits/tools/parse_folder.py:

import matplotlib
matplotlib.use('Agg')

@Saneesh
Copy link
Author

Saneesh commented Aug 3, 2015

Now I could login through ssh and my issue is solved!
These are the steps I have followed
username@local:# sudo -s
root@local:
# ssh -X -v -i /home/username/Downloads/keypair.pem ubuntu@ec2-xx-xx-xx-xx.compute-x.amazonaws.com
ubuntu@amazon:# sudo -s
root@amazon:
# nohup ./digits-devserver &

Now, access the site and create the dataset!

@Saneesh Saneesh closed this as completed Aug 3, 2015
@gheinrich
Copy link
Contributor

Thanks Saneesh, out of curiosity, would you mind trying this:

I am interested to know whether this works. Thanks!

@Saneesh
Copy link
Author

Saneesh commented Aug 3, 2015

Hello gheinrich,
I tried that first but it didn't worked for me, it showed same error.

@nszceta
Copy link

nszceta commented Aug 27, 2015

@gheinrich I did not have luck with modifying parse_folder.py. However, commit 28b7fee should fix the gtk3 backend issue completely.

@nszceta
Copy link

nszceta commented Aug 27, 2015

@Saneesh please try again with commit 28b7fee applied

@nszceta
Copy link

nszceta commented Aug 27, 2015

@lukeyeager I ran into this issue on a fresh Ubuntu 14.04 LTS HVM install on AWS EC2 g2.2xlarge instance

@choosehappy
Copy link

I also had an issue with this; to resolve i simply used a virtual framebuffer, and everything worked without a problem.

On ubuntu:
sudo apt-get install xvfb
xvfb-run ./digits-server

@christopher5106
Copy link

sudo pip uninstall matplotlib
sudo apt-get install python-matplotlib

works for me

@zhengzhang828
Copy link

christopher5106 method works! thank you!

@mikechen66
Copy link

mikechen66 commented May 1, 2020

Solution to 'GDK_IS_DISPLAY (display)' failed

It seems that the error is a minor error during the ssh connection from a computer to another computer. While I run the test application of class_activation_maps.py (keras examples), it shows the same error.

$ python3 class_activation_maps.py /home/nvidia/Downloads/galaxy.jpg
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(image_ocr.py:1257): Gdk-CRITICAL **: 19:44:35.690: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

Using TensorFlow backend.
.........

However, while I run the following both the commands and the application. It can successfully show the splendid galaxy makeup.

$ echo $DISPLAY
:0
$ python3 class_activation_maps.py /home/nvidia/Downloads/galaxy.jpg

Using TensorFlow backend.
2020-05-01 19:45:14.877288: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0

Notes:

Another solution is to describe the above-metioned commands in bashrc.

Cheers,

Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants