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

Is Palette selected when installing Amrvis with spack? #13

Open
elleryames opened this issue May 19, 2021 · 10 comments
Open

Is Palette selected when installing Amrvis with spack? #13

elleryames opened this issue May 19, 2021 · 10 comments

Comments

@elleryames
Copy link

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

@drummerdoc
Copy link
Member

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.... :)

@elleryames
Copy link
Author

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'?

@drummerdoc
Copy link
Member

drummerdoc commented May 19, 2021

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...

@ajnonaka
Copy link
Contributor

###########################
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.

@elleryames
Copy link
Author

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.

@wyphan
Copy link

wyphan commented Aug 31, 2021

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

@ax3l
Copy link
Member

ax3l commented Mar 18, 2022

#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:
  • 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
Copy link
Member

ax3l commented Mar 21, 2022

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

@etpalmer63
Copy link
Contributor

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

@etpalmer63
Copy link
Contributor

A fix is in the process: spack/spack#30942

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

No branches or pull requests

6 participants