modularml / max

A collection of sample programs, notebooks, and tools which highlight the power of the MAX Platform
https://www.modular.com
Other
322 stars 41 forks source link

[BUG]: Ubuntu install fails for both MAX and MOJO #134

Closed mxsur closed 5 months ago

mxsur commented 6 months ago

Bug description

Installing both max and mojo fails with the same error

❯ modular install max

# Found release for https://packages.modular.com/max @ 24.2.0
# Downloading archive: packages/24.2.0/max-x86_64-unknown-linux-gnu-24.2.0-3-0.tar.gz
Done         [ ███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ ] 100%   1.39GiB/1.39GiB @  9.55MiB/s
# Extracting downloaded archives. 
# Extraction complete, setting configs...
# Configs complete, running post-install hooks...
Traceback (most recent call last):
  File "/home/maksym/.local/share/modular/pkg/packages.modular.com_max/scripts/post-install/self-test.py", line 529, in <module>
    main()
  File "/home/maksym/.local/share/modular/pkg/packages.modular.com_max/scripts/post-install/self-test.py", line 518, in main
    tester = Tester(
             ^^^^^^^
  File "/home/maksym/.local/share/modular/pkg/packages.modular.com_max/scripts/post-install/self-test.py", line 94, in __init__
    mojo_python_library = config.get(
                          ^^^^^^^^^^^
  File "/home/maksym/miniconda3/lib/python3.12/configparser.py", line 759, in get
    d = self._unify_values(section, vars)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maksym/miniconda3/lib/python3.12/configparser.py", line 1130, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'mojo-max'
modular: error: failed to run script
==========================
Failure Information:
        - Script: `PATH=/home/maksym/miniconda3/bin:/home/maksym/miniconda3/condabin:/home/maksym/.wasmedge/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/maksym/.cabal/bin:/home/maksym/.ghcup/bin:/home/maksym/.krew/bin:/home/maksym/.wasmer/bin:/home/maksym/.wasmtime/bin:/home/maksym/.juliaup/bin:/home/maksym/.local/bin:/home/maksym/.cargo/bin:/home/maksym/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/maksym/go/bin:/home/maksym/.temporalio/bin HOME=/home/maksym PYTHONPATH=/home/maksym/.local/share/modular/pkg/packages.modular.com_max/venv/lib/home/maksym/.local/share/modular/pkg/packages.modular.com_max/venv/bin/python /home/maksym/.local/share/modular/pkg/packages.modular.com_max/scripts/post-install/self-test.py --modular-home /home/maksym/.local/share/modular --package-path /home/maksym/.local/share/modular/pkg/packages.modular.com_max --mojo-config-section mojo-max`
        - Result: 1
        - Stderr:
Traceback (most recent call last):
  File "/home/maksym/.local/share/modular/pkg/packages.modular.com_max/scripts/post-install/self-test.py", line 529, in <module>
    main()
  File "/home/maksym/.local/share/modular/pkg/packages.modular.com_max/scripts/post-install/self-test.py", line 518, in main
    tester = Tester(
             ^^^^^^^                                                                                                                                                                         
  File "/home/maksym/.local/share/modular/pkg/packages.modular.com_max/scripts/post-install/self-test.py", line 94, in __init__                                                              
    mojo_python_library = config.get(                                                                                                                                                        
                          ^^^^^^^^^^^                                                                                                                                                        
  File "/home/maksym/miniconda3/lib/python3.12/configparser.py", line 759, in get                                                                                                            
    d = self._unify_values(section, vars)                                                                                                                                                    
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maksym/miniconda3/lib/python3.12/configparser.py", line 1130, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'mojo-max'

==========================

Steps to reproduce

modular install max && modular install mojo

System information

- What OS did you do install MAX on ?
❯ neofetch
           `-mddhhhhhhhhhddmss`              
        ./mdhhhhhhhhhhhhhhhhhhhhhh.         ----------                                                                                                                                       
     :mdhhhhhhhhhhhhhhhhhhhhhhhhhhhm`       OS: Lubuntu 22.04.4 LTS x86_64                                                                                                                   
   :ymhhhhhhhhhhhhhhhyyyyyyhhhhhhhhhy:      Host: VivoBook_ASUSLaptop X521FL_S533FL 1.0                                                                                                      
  `odhyyyhhhhhhhhhy+-`./syhhhhhhhho`     Kernel: 6.2.0-1009-lowlatency                                                                                                                    
 `hhy..:oyhhhhhhhy-`:osso/..:/++oosyyyh`    Uptime: 4 hours, 6 mins                                                                                                                          
 dhhs   .-/syhhhhs`shhhhhhyyyyyyyyyyyyhs    Packages: 2714 (dpkg), 18 (flatpak), 16 (snap)                                                                                                   
:hhhy`  yso/:+syhy/yhhhhhshhhhhhhhhhhhhh:   Shell: bash 5.1.16                                                                                                                               
hhhhho. +hhhys++oyyyhhhhh-yhhhhhhhhhhhhhs   Resolution: 1920x1080, 1920x1080                                                                                                                 
hhhhhhs-`/syhhhhyssyyhhhh:-yhhhhhhhhhhhhh   DE: LXQt 1.4.0                                                                                                                                   
hhhhhhs  `:/+ossyyhyyhhhhs -yhhhhhhhhhhhh   WM: Openbox                                                                                                                                      
hhhhhhy/ `syyyssyyyyhhhhhh: :yhhhhhhhhhhs   Theme: Arc-Dark [GTK2/3]                                                                                                                         
:hhhhhhyo:-/osyhhhhhhhhhhho  ohhhhhhhhhh:   Icons: ePapirus [GTK2/3]                                                                                                                         
 sdhhhhhhhyyssyyhhhhhhhhhhh+  +hhhhhhhhs    Terminal: qterminal                                                                                                                              
 `shhhhhhhhhhhhhhhhhhhhhhy+` .yhhhhhhhh`    Terminal Font: Fira Code 13                                                                                                                      
  +sdhhhhhhhhhhhhhhhhhyo/. `/yhhhhhhhd`     CPU: Intel i5-10210U (8) @ 4.200GHz                                                                                                              
   `:shhhhhhhhhh+---..``.:+yyhhhhhhh:       GPU: NVIDIA GeForce MX250                                                                                                                        
     `:mdhhhhhh/.syssyyyyhhhhhhhd:`         GPU: Intel CometLake-U GT2 [UHD Graphics]                                                                                                        
        `+smdhhh+shhhhhhhhhhhhdm`           Memory: 3970MiB / 7741MiB                                                                                                                        
           `sNmdddhhhhhhhddm-`                                                                                                                                                               

- Provide version information for MAX by pasting the output of `max -v`
`NA`
- Provide version information for Mojo by pasting the output of `mojo -v`
`NA`
- Provide Modular CLI version by pasting the output of `modular -v`
`modular 0.6.0 (04c05243)`
ehsanmok commented 6 months ago

Thanks for trying out MAX and Mojo! As of today, Ubuntu is officially supported for MAX. Please check out the getting started guide.

mxsur commented 6 months ago

@ehsanmok thanks for a prompt reply. Actually I followed it and used curl -s https://get.modular.com | sh - . As the result - see the error above. Modular is installed successfully but modular install max fails

sparadiso commented 6 months ago

@mxsur we're digging into this a bit -- would you be willing to send over the result of modular config-list?

mxsur commented 6 months ago

@sparadiso pls see below

❯ modular config-list

  max.cache_dir = /home/maksym/.local/share/modular/.max_cache
  max.enable_compile_progress = true
  max.enable_model_ir_cache = true
  max.engine_lib = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/libmodular-framework-common.so.19.0git
  max.graph_lib = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/libmof.so.19.0git
  max.name = MAX Platform
  max.path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max
  max.torch_ext_lib = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/libmodular-framework-torch-ext.so.19.0git
  max.version = 24.2.0
  mojo-max.compilerrt_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/libKGENCompilerRTShared.so.19.0git
  mojo-max.compilerrt_static_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/libKGENCompilerRT-static.a
  mojo-max.driver_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/bin/mojo
  mojo-max.import_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/mojo,/home/maksym/.local/share/modular/pkg/packages.modular.com_max/pkg
  mojo-max.jupyter_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/libMojoJupyter.so.19.0git
  mojo-max.lldb_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/bin/mojo-lldb
  mojo-max.lldb_plugin_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/libMojoLLDB.so.19.0git
  mojo-max.lldb_visualizers_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/lldb-visualizers
  mojo-max.lldb_vscode_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/bin/mojo-lldb-dap
  mojo-max.lsp_server_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/bin/mojo-lsp-server
  mojo-max.mblack_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/mblack/mblack
  mojo-max.orcrt_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/liborc_rt.a
  mojo-max.python_lib = /home/maksym/miniconda3/lib/libpython3.12.so.1.0
  mojo-max.repl_entry_point = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib/mojo-repl-entry-point
  mojo-max.system_libs = -lrt,-ldl,-lpthread,-lm,-lz,-ltinfo
  mojo-max.test_executor_path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max/lib//__w/modular/modular/.derived/build-release/bin/mojo-test-executor
  package_packages_modular_com_max.package_name = MAX Platform
  package_packages_modular_com_max.path = /home/maksym/.local/share/modular/pkg/packages.modular.com_max
  package_packages_modular_com_max.short_name = max
  package_packages_modular_com_max.state = installing
  package_packages_modular_com_max.version = 24.2.0
runbikeswim commented 6 months ago

modular install mojo loc("#M.target":1:50): error: duplicate or unknown struct parameter name: cpu [2426:2426:20240330,115425.961693:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2) [2426:2426:20240330,115425.961732:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2) Please submit a bug report to https://github.com/modularml/max/issues and include the crash backtrace along with all the relevant source codes. Stack dump:

  1. Program arguments: modular install mojo

    0 0x000055b0fd644427 (/usr/bin/modular+0x1544427)

    1 0x000055b0fd6420de (/usr/bin/modular+0x15420de)

    2 0x000055b0fd644aaf (/usr/bin/modular+0x1544aaf)

    3 0x00007f47423d8520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)

    4 0x000055b0fda68914 (/usr/bin/modular+0x1968914)

    5 0x000055b0fda67e3c (/usr/bin/modular+0x1967e3c)

    6 0x000055b0fda5381c (/usr/bin/modular+0x195381c)

    7 0x000055b0fda51fa0 (/usr/bin/modular+0x1951fa0)

    8 0x000055b0fd58c55d (/usr/bin/modular+0x148c55d)

    9 0x000055b0fd589ff2 (/usr/bin/modular+0x1489ff2)

    10 0x00007f47423bfd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)

    11 0x00007f47423bfe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)

    12 0x000055b0fd5896ae (/usr/bin/modular+0x14896ae)

    Segmentation fault uname --all Linux xxxxxxxx 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

zbowling commented 5 months ago

Hi @mxsur, can you check that MODULAR_HOME is set in your shell? In your case since you are on distro with XDG User Directories it should be set to something like:

export MODULAR_HOME=/home/maksym/.local/share/modular/

You have to do modular auth again after it's set. Then try to run modular clean and modular install max again.

Little background, some of our recent docs changes now tell users to set MODULAR_HOME later when installing mojo or max and not before doing modular auth which is a mistake (https://docs.modular.com/engine/get-started/). If you are on a distro that has adopted the XDG Base Directories specification (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) things will not probably work right now since we don't fully support XDG Base Dir just yet. To overcome that you have to explicitly set MODULAR_HOME before interacting with with modular tool.

In your case for you what is likely happening is that /home/maksym/.local/share/modular/ contains part of your modular files and /home/maksym/.config/modular/ contains the other part of your install (like your modular config), and since they are not the same directory later Mojo and MAX package scripts still expect all the files in one folder like they are on older distros that don't use XDG yet. We are working towards eventually supporting XDG Base Directory spec support in new packages but for now MODULAR_HOME has to be set to keep all your modular related files in the same directory together.

mxsur commented 5 months ago

Hi @zbowling , thanks! That solved my issue.

@runbikeswim I'm closing this ticket. Pls reopen a new one if your issue is still unaddressed.