Amrvis icon indicating copy to clipboard operation
Amrvis copied to clipboard

Is Palette selected when installing Amrvis with spack?

Open elleryames opened this issue 4 years ago • 10 comments

According to the Amrvis documentation (step 2 here), after cloning the amrvis repository one should point the palette variable in ~/.amrvis.defaults to the appropriate file within your local amrvis repo. How is this resolved when Amrvis is installed via spack?

I was able to install amrvis, for example with

spack install amrvis dims=2

However, attempting to visualize a plot file results in a warning

Can't open colormap file: Palette

elleryames avatar May 19 '21 18:05 elleryames

amrvis searches several places, in a given order, for a defaults file, and the palette should be set in the first that it finds. In order, it looks for:

  1. ./amrvis.defaults
  2. ~/amrvis.defaults
  3. ~/.amrvis.defaults If none of these are found, a standard greyscale palette is used, I believe.

So, I believe that you would need to find the amrvis source folder in the Spack install and grab a sample amrvis.defaults from there, or pull one from the GitHub repo. Then you can put this into your home folder with reasonable default settings, as well as putting a modified version in the pwd of a folder you are working where you want to set specific settings for a particular setup. In any of these, you can set the palette that it will use for that case (or by default for you).

I hope that makes sense. Tough to write this out.... :)

drummerdoc avatar May 19 '21 18:05 drummerdoc

Thanks for the reply @drummerdoc. I was able to find a gzipped git repo for Amrvis that spack caches. Rather than messing with spack's management system I simply pulled another copy of the repo to something like ~/amrex-project/Amrvis. I then copied amrvis.defaults to ~/.amrvis.defaults, and edited the palette variable to point to ~/amrex-project/Amrvis/Palette. Now Amrvis does not complain about a lack of Palette, but no color or greyscale palette/color bar or image of the solution is visible: amrvis_screenshot

Amrvis appears to recognize the plot file since solution values appear on the right, and when I click-around the domain with the mouse. Perhaps I do not understand Palette? Am I supposed to set something like 'greyscale' or 'blackbody'?

elleryames avatar May 19 '21 19:05 elleryames

Ahh, the ole 8bit visual problem! @ajnonaka or @asalmgren should have the best-guess fix for that.

At the risk of speaking far outside anything I understand, Xwindows is weird and involves a lot of black magic about how it decides to paint the screen. Amrvis requires a specific bit depth support, and there are tricks to make your system aware that it can provide that support. I don't have those laying around, but surely one of those listed above does...

drummerdoc avatar May 19 '21 19:05 drummerdoc

########################### Fix 8-bit visual problem so Amrvis isn't black on many machines you can add the Option "Dac8Bit" "True" line to the local machine's /etc/X11/xorg.conf similar to below. to create an xorg.conf, run "sudo nvidia-xconfig" (not sure if this totally works)

Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" Option "Dac8Bit" "True" EndSection

Then restart the x server or reboot.

ajnonaka avatar May 19 '21 21:05 ajnonaka

Well, @ajnonaka, this looked promising but I still get an all-black view of the solution.

Tried: I checked for xorg.config: not there. Created xorg.config with sudo nvidia-xconfig. Added Option "Dac8Bit" "True" in the (existing) section like the one you mention above. Reboot.

Here is a naive question. To use the Palette in my ~/amrex-project/Amrvis repo, (not the spack installed one) do I have to build Amrvis there? So far, I just point the spack installed Amrvis to the Palette in ~/amrex-project/Amrvis but I have not actually run make DIM=2 there.

elleryames avatar May 20 '21 00:05 elleryames

#14 might be the long-awaited answer to this issue.

wyphan avatar Aug 31 '21 21:08 wyphan

#14 fixes the palette but does not solve that Spack does not yet install the default config and palette files.

Action items:

  • Amrvis repo: control to add more search paths for config path and Palette file:
    • current locations: https://github.com/AMReX-Codes/Amrvis/issues/13#issuecomment-844377003
    • a typical location to add (last) would be <install_prefix>/etc/ for configs
  • Spack repo:
    • copy config and palette file to <install_prefix>/etc in the spack package
    • this could also be done in GNUmake directly in its install logic, avoiding any change to the package logic

ax3l avatar Mar 18 '22 18:03 ax3l

Does someone like to take this on? Maybe @wyphan or @etpalmer63? :)

ax3l avatar Mar 21 '22 18:03 ax3l

I'll add it to my list but I will likely need to bother you with questions, as usual :smile:

etpalmer63 avatar Mar 21 '22 19:03 etpalmer63

A fix is in the process: https://github.com/spack/spack/pull/30942

etpalmer63 avatar Jun 01 '22 01:06 etpalmer63