Help porting GWE (Nvidia info and overclock app) to Snap

I believe I’m already using it:

  gnome-3-30-1804:
    interface: content
    target: $SNAP/gnome-platform
    default-provider: gnome-3-30-1804

but don’t get why I’m getting this gnome-3-26-1604.

1 Like

The error message? I think this is an oversight somewhere along the stack. Snapd doesn’t know about that so the error message must be coming from one of the helpers included in your snap.

PS: I’m ill so please forgive me if I’m not making sense.

Unfortunately I don’t know what you mean by “these helpers” (are they slots? parts? plugs?). I just started with snapcraft so I am not really familiar with it. (thanks a lot for the help, especially since you are not even feeling well :slight_smile:)

There are two classes of helpers in snaps:

  • explicitly running scripts before your executable <- the old way
  • implicitly running scripts before your executable <- the new way

^ Edited for clarity.

In both cases there are programs running before your application gets to start. They usually look around the filesystem (e.g. is the content plug connected), can print useful messages. They generate various caches so that fonts and icons are okay. They set a bunch of environment variables. Finally they pass control to your application.

Can you please look at the program designated as the starting point of your snap? Do this:

  • run snap run --shell yoursnapname
  • go to the snap directory, cd $SNAP
  • look a the wrapper programs generated, they are all shell so you can inspect them easily

The wrappers are in the main directory of the snap (i.e. $SNAP). By looking at what is executed there you should get the idea about what is causing that message to be printed and, in consequence, where the logic error is.

1 Like

The only wrapper I can see is called command-gwe.wrapper and this is its content:

$ cat command-gwe.wrapper 
#!/bin/sh
exec "desktop-launch" "$SNAP/gwe" "$@"

It’s inside $SNAP together with these other files and folders:
bin command-gwe.wrapper etc flavor-select gnome-platform lib meta snap usr var

desktop-launch is inside bin.
gwe is in ./usr/bin/gwe and when I run it it gives this error:

$ ./gwe
Traceback (most recent call last):
  File "./gwe", line 44, in <module>
    gi.require_version('Gtk', '3.0')
  File "/snap/gwe/x1/usr/lib/python3/dist-packages/gi/__init__.py", line 130, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available

I don’t get what this $SNAP/gwe means since there is no gwe file or folder in $SNAP:
ls $SNAP/gwe
ls: cannot access ‘/snap/gwe/x1/gwe’: No such file or directory

The helper is desktop-launch. This is where the error message is coming from.

I think I should yield to @kenvandine for more advice though. I’m not an expert on this part.

I see, thanks again for the help. Now I have to go bed. I hope to be able to make some progress during this weekend, I have GWE already on Flathub but, as a 12+ years Ubuntu user, I really want to have it also on the Snap Store.

2 Likes

Ok, I’ve decided for now to pause the support of Gnome 3.30 since the app can partially run on 2.28 with the Historical data feature disabled.

Now when I create the snap with 2.28 I get this error:

$ gwe
/snap/gwe/x1/bin/desktop-launch: line 546: /snap/gwe/x1/gwe: No such file or directory

I guess is because

apps:
  gwe:
    command: desktop-launch $SNAP/gwe

is pointing to the wrong position.

If I look inside the snap for gwe I find it here:

/snap/gwe/x1$ find -type f -name gwe
./usr/bin/gwe

but when I try to run it I get this error:

/snap/gwe/x1/usr/bin$ ./gwe 
Traceback (most recent call last):
  File "./gwe", line 44, in <module>
    gi.require_version('Gtk', '3.0')
  File "/snap/gwe/x1/usr/lib/python3/dist-packages/gi/__init__.py", line 130, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available

So, today I made some real progress. I finally managed to start GWE:

Most of the features are there but there are still 3 big issues that prevent me to officially consider Snap supported:

  1. The Historical data dialog is not working at all because requires Gnome 3.30 (specific thread)
  2. Power limit cannot be set because it require executing pkexec nvidia-smi <bunch of attrs> on the host (specific thread). An alternative solution could be running an internal script as root (specific thread)
  3. Profiles are not created on the host XDG_CONFIG_HOME folder (specific thread)

@kenvandine @zyga-snapd any suggestion regarding the point 2 and 3?

1 Like

I replied to thread 2 and 3 individually.

1 Like

There seems to be some interest for GWE: https://www.omgubuntu.co.uk/2019/02/easily-overclock-nvidia-gpu-on-linux-with-this-new-app