4

I am a linux newcomer trying to set up tensorflow with GPU for Python on Pop!_os 20.04. I tried using the proposed Pop!_os apt packages for this but they didn't work for me.

After a lot of struggle on my own and possible apt pollution, I managed to install Tensorflow with CUDA and cuDNN by following this answer https://askubuntu.com/a/1251052

Although Python's tensorflow seems to properly recognize my GPU, right after importing the library I get this weird message:

Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Invalid MIT-MAGIC-COOKIE-1 key
>>>

Can someone tell me what this means or give me some clue on what should I do (maybe I can take that as a warning and live with it), please?

Not sure if this qualifies as an Ubuntu question but since I followed an Ubuntu guide to reach this point and Pop is Ubuntu-based it just felt right to ask here.

System info (advice on what to include/not include here next time is appreciated):

OS: Pop!_OS 20.04 LTS x86_64
Host: ERAZER X6807 MD61178 Standard 
Kernel: 5.4.0-7634-generic
Packages: 2407 (dpkg)
Shell: bash 5.0.16
Resolution: 1920x1080 
DE: GNOME
WM: Mutter
Terminal: gnome-terminal 
CPU: Intel i7-8750H (12) @ 4.100GHz
GPU: Intel UHD Graphics 630
GPU: NVIDIA GeForce GTX 1060 Mobile
Memory: 15868MiB

Thanks in advance!

5
  • 1
    I think it has nothing to do with TensorFlow. Try: tf.config.list_physical_devices('GPU'), if it does not display any error, it means everything is okay with your installation.
    – singrium
    Jun 25, 2020 at 14:12
  • Does this answer your question? X11: Invalid MIT-MAGIC-COOKIE-1 key
    – singrium
    Jun 25, 2020 at 14:15
  • 1
    @singrium I already tried that line, which returned a bunch of things and a final line of [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')], from which I guess the GPU is okay (I checked and GPU0 is the Nvidia's). About the second comment, I checked that page and I honesty lack the knoweledge to understand it fully: I understood that entering "xhost +local:" would grant the access of the GPU to my monitor so I entered it on the shell, but no change after importing inside python
    – pabsan-0
    Jun 25, 2020 at 14:32
  • 1
    The output you got confirms that TensorFlow can see your GPU and use it. So no problem with the installation. The message you're getting is probably related to the display
    – singrium
    Jun 25, 2020 at 14:44
  • 1
    @singrium I launched a random application (discord) with the dedicated graphics and it worked as always, so the GPU can actually access the display for normal use (in other words I guess I did not break anything important). While I still do not get why the warning pops out or what it means, it seems I can ignore it for now at my own risk. Thanks a lot!
    – pabsan-0
    Jun 25, 2020 at 15:03

0

You must log in to answer this question.

Browse other questions tagged .