BoukeHaarsma23 / WattmanGTK

A Wattman-like GTK3+ GUI
GNU General Public License v2.0
372 stars 61 forks source link

Add a card selection dropdown #4

Open urbenlegend opened 6 years ago

urbenlegend commented 6 years ago

Users can have multiple GPUs in their system.

  1. Add a dropdown in the GUI so that users can choose which card they want to view and modify.
  2. We should do validation on each card* device we find in /sys/class/drm. Perhaps check whether pp_od_clk_voltage file exists in /sys/class/drm/card*/device.
  3. If no cards are found, display message in GUI about no AMD gpus found or feature mask not enabled.
moritz31 commented 6 years ago

Any idea where to place such a dropdown?

BoukeHaarsma23 commented 6 years ago

The multi-gpu branch should make clock switching between GPU's possible. Assuming you don't suffer from issue #27.

No multi-gpu plotting yet, I'm not sure how I want to tackle that, options I see:

To not let the GUI be a confusing mess, I am leaning towards option 1. Let me know what you think

BoukeHaarsma23 commented 5 years ago

For now, I have implemented the first option in the wattmangtk-next branch. See a6ea1a519ed3f842b5f9b102466aaabed2542489

axipher commented 5 years ago

Can you just convert all the saved values to arrays with a number of elements equal to the number of GPU's.

Then just read all available GPU's constantly, but only update the GUI (chart, graph, and selection area) with the array values for the current selected GPU from the drop-down.

That way you only show one GPU at a time, but don't lose the history between graphs, and you can then write your output file with values for all GPU's form your array values that have changed.

Ragebone commented 5 years ago

after switching once: image

after switching thrice image

BoukeHaarsma23 commented 5 years ago

Oh that is nasty, will look into this.

BoukeHaarsma23 commented 5 years ago

@Ragebone Let me know if the current dev branch fixes this for you.

Marco-GG commented 5 years ago

@BoukeHaarsma23 works great to avoid data duplication but the Plot & Scale toggles gets broken (affecting the graphic behavior).

I made this patch:

@@ -164,13 +164,15 @@ class Plot:
         self.normaliserenderer = Gtk.CellRendererToggle()
         self.normaliserenderer.connect("toggled", self.on_normalise_toggled)
         self.tree = self.builder.get_object("Signal Selection")
+        for column in self.tree.get_columns(): #Avoids columns duplication on init_treeview new call
+            self.tree.remove_column(column)
         self.tree.append_column(Gtk.TreeViewColumn("Plot", self.plotrenderer, active=0))
         self.tree.append_column(Gtk.TreeViewColumn("Scale", self.normaliserenderer, active=1, activatable=2))
         columnnames=["Name","Unit","min","mean","max","current"]
         for i,column in enumerate(columnnames):
             tcolumn = Gtk.TreeViewColumn(column,textrenderer,text=i+3,foreground=9)
             self.tree.append_column(tcolumn)
-
+        self.signalstore.clear() # Avoids rows duplication on init_treeview new call
         for plotsignal in self.Plotsignals:
             self.signalstore.append([plotsignal.plotenable, plotsignal.plotnormalise, True, plotsignal.name, convert_to_si(plotsignal.unit)[0], '0', '0', '0', '0', plotsignal.plotcolor])
         self.tree.set_model(self.signalstore)

And seems to do the trick. But I think that you can get the same behavior if you add some re-initialization on the toggles on your current fix.