Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Missing IUSE
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
rsnfunky
Tux's lil' helper
Tux's lil' helper


Joined: 30 Dec 2007
Posts: 77

PostPosted: Sat Sep 28, 2024 2:47 am    Post subject: Missing IUSE Reply with quote

Hi, When installing pytorch[rocm] I get an error:

sci-libs/pytorch-2.4.1::gentoo (Missing IUSE: rocm)


This is on following Gentoo ROCm guide.
Back to top
View user's profile Send private message
Nowa
Developer
Developer


Joined: 25 Jun 2014
Posts: 429
Location: Nijmegen

PostPosted: Sat Sep 28, 2024 9:20 am    Post subject: Reply with quote

We're going to have to see a complete log, emerge --info sci-libs/pytorch, and the emerge environment. This ebuild should not have this flag, so something is probably adding it in incorrectly via environment.
_________________
OS: Gentoo 6.10.12-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
wjb
l33t
l33t


Joined: 10 Jul 2005
Posts: 631
Location: Fife, Scotland

PostPosted: Sat Sep 28, 2024 9:41 am    Post subject: Reply with quote

The wiki appears to be incorrect as none of the versions of pytorch in the Gentoo repository currently has a rocm use flag. The wiki may possibly have been correct when written, I don't know. I tend to assume the wiki is correct if things work as described, otherwise it can be a mixture of incomplete, incorrect, or out of date information - in which case a little research is required, and then you can add to the wiki for the next person.

A good place to ask is on the Discussion tab of the Wiki page where you found the information.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2437

PostPosted: Sat Sep 28, 2024 1:38 pm    Post subject: Reply with quote

AndrewAmmerlaan wrote:
We're going to have to see a complete log, emerge --info sci-libs/pytorch, and the emerge environment. This ebuild should not have this flag, so something is probably adding it in incorrectly via environment.


OP most probably run this:

Code:
emerge pytorch[rocm]


which resulted in this:

Code:
emerge: there are no ebuilds built with USE flags to satisfy "pytorch[rocm]".
!!! One of the following packages is required to complete your request:
- sci-libs/pytorch-2.4.1::gentoo (Missing IUSE: rocm)
- sci-libs/pytorch-2.4.0::gentoo (Missing IUSE: rocm)
- sci-libs/pytorch-2.3.1::gentoo (Missing IUSE: rocm)
- sci-libs/pytorch-2.3.0::gentoo (Missing IUSE: rocm)


I didn't know this syntax even existed.

However I doubt there ever was such a use flag, because the few commits for that package I inspected didn't contain it. Maybe the author of the wiki page was also the maintainer and intended to introduce it, but never did.

Best Regards,
Georgi
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2730
Location: Here and Away Again

PostPosted: Sat Sep 28, 2024 4:53 pm    Post subject: Reply with quote

The package did have USE="rocm" in the 'sci' overlay at least (perhaps others too).

See for example:

https://gitweb.gentoo.org/proj/sci.git/diff/sci-libs/pytorch/metadata.xml?id=c6c1ae168e2

As for the 'atom[use]' syntax, it has some interesting effects when used like that, and it certainly doesn't seem like something intended for use like that.

For example, with existing flags:

Code:
$ USE="-pulseaudio" emerge -p obs-studio::gentoo[pulseaudio]

These are the packages that would be merged:

Calculating dependencies              ... done!
Dependency resolution took 1.07 s (backtrack: 0/20).


emerge: there are no ebuilds built with USE flags to satisfy "obs-studio[pulseaudio]".
!!! One of the following packages is required to complete your request:
- media-video/obs-studio-9999::roookaru (Change USE: +pulseaudio)

So it seems to effectively override whatever is allowed to be USEd.

Indeed, I also see 'pytorch[rocm]' in our wikki article, though it doesn't seem like the writer was guiding it to be emerged at all, but rather just mention that it exists with that flag (assuming the 'Gentoo ROCm guide' here refers to our wiki article on ROCm).

That said, I don't see the Gentoo repository having had that flag either, and there are no mentions of overlays in the article, and the article was first created after the package was already in the Gentoo repository so... not sure what happened there.
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
rsnfunky
Tux's lil' helper
Tux's lil' helper


Joined: 30 Dec 2007
Posts: 77

PostPosted: Sun Sep 29, 2024 4:37 am    Post subject: Reply with quote

AndrewAmmerlaan wrote:
We're going to have to see a complete log, emerge --info sci-libs/pytorch, and the emerge environment. This ebuild should not have this flag, so something is probably adding it in incorrectly via environment.


Code:
emerge --info sci-libs/pytorch
Portage 3.0.65 (python 3.12.3-final-0, default/linux/amd64/23.0/desktop/gnome, gcc-13, glibc-2.39-r6, 6.6.38-gentoo-gentoo-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.6.38-gentoo-gentoo-dist-x86_64-AMD_Ryzen_7_8700G_w-_Radeon_780M_Graphics-with-glibc2.39
KiB Mem:    63305768 total,  54712524 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Sat, 28 Sep 2024 02:00:00 +0000
Head commit of repository gentoo: 60495ef59a53394886aa59c3590494f384ada7a2
Timestamp of repository loatchi: Wed, 25 Sep 2024 04:49:36 +0000
Head commit of repository loatchi: 11c1ef5c6174d38a502d8f84f4446566bd5602cc

sh bash 5.2_p26-r6
ld GNU ld (Gentoo 2.42 p3) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r6::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
dev-build/automake:        1.16.5-r2::gentoo
dev-build/cmake:           3.30.2::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.5.1::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.11.9-r1::gentoo, 3.12.3-r1::gentoo
dev-lang/rust-bin:         1.79.0::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54.2::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/binutils:        2.42-r1::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           18.1.8::gentoo
sys-devel/gcc:             13.3.1_p20240614::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             18.1.8::gentoo
sys-devel/llvm:            18.1.8-r1::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 3
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1

loatchi
    location: /var/db/repos/loatchi
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/loatchi.git
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver4 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-march=znver4 -O2 -pipe"
DISTDIR="/mnt/docker/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=znver4 -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=znver4 -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="-j28 -l279"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl acpi adns alsa amd64 bash-completion blas bluetooth branding brts bzip2 cairo calendar cdda cdr cet clamav colord crypt cups curl dbus dga dracut dri dts dvd dvdr eds efistub egl elogind encode evo exif extra ffmpeg flac fortran ftp gdbm gif gnome gnome-keyring gnome-online-accounts gnome-shell grub gstreamer gtk gtk3 gui gzip handbook hip http2 iconv icu inspector introspection ipv6 jpeg jpeg2k jpegxl keyring kf6compat lcms libnotify libtirpc libwww lm-sensors lz4 lzip lzma lzo mad man minizip mng modules-sign mount mp3 mp4 mpeg mplayer multilib nautilus ncurses networkmanager nls ntfs offload ogg opencl opengl openmp pam pango pcre pdf plasma png policykit ppds profile profiler pulseaudio python qml qt5 qt6 readline rocm sdl seccomp secureboot sound speech speex spell ssl startup-notification svg sysprof test-rust tiff tracker truetype udev udisks uefi unicode upower usb vorbis vulkan wayland wxwidgets x264 xattr xcb xft xml xv xvid zip zlib" ABI_X86="64" ADA_TARGET="gcc_12" AMDGPU_TARGETS="gfx1100 gfx1102" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 avx512_bf16 avx512_bitalg avx512_vbmi2 avx512_vnni avx512_vpopcntdq avx512bw avx512cd avx512dq avx512f avx512ifma avx512vbmi avx512vl f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3 vpclmulqdq" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGETS="AMDGPU BPF X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

sci-libs/pytorch-2.4.1::gentoo was built with the following:
USE="-debug" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11"


What I am trying:

1) To get the vllm working on gentoo (Inference Server).
2) Problem faced: When trying to compile vLLM, I get the following error: No ROCm runtime is found, using ROCM_HOME='/usr'
3) Reinstalling pytorch resolved the above issue but gives no HIP installed error:

https://forums.gentoo.org/viewtopic-t-1171012-highlight-.html


Probable Solution: We need pytorch compiled with ROCm.

Gentoo ROCm Guide: https://wiki.gentoo.org/wiki/ROCm
Back to top
View user's profile Send private message
rsnfunky
Tux's lil' helper
Tux's lil' helper


Joined: 30 Dec 2007
Posts: 77

PostPosted: Wed Oct 02, 2024 1:13 am    Post subject: Reply with quote

Update:

Step 1: I installed docker using the docker guide: https://wiki.gentoo.org/wiki/Docker

Step 2: Got ROCm - Pytorch Image
Code:
docker pull rocm/pytorch:latest


Step 3: Ran the docker image using:
Code:
docker run -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --device=/dev/kfd --device=/dev/dri --group-add video --ipc=host --shm-size 8G rocm/pytorch:latest


Step 3: Install Conda and create vllm environment
Code:
wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh
bash ./Miniconda3-py310_23.1.0-1-Linux-x86_64.sh -b -p $HOME/miniconda3

# Manually adding Conda init to .bashrc
echo '### Conda init ###' >> $HOME/.bashrc
echo 'source $HOME/miniconda3/etc/profile.d/conda.sh' >> $HOME/.bashrc
echo 'conda activate' >> $HOME/.bashrc
source $HOME/.bashrc
conda create -n vllm -y
conda activate vllm
conda install python=3.10 -y


Step 4: Install Flash Attention:
Code:
python3 -m pip install ninja cmake wheel pybind11
pip uninstall -y triton
git clone https://github.com/OpenAI/triton.git
cd triton
git checkout e192dba
cd python
pip3 install .
cd ../..


Step 5: Install vllm:
Code:
pip install --upgrade pip

# Install PyTorch
pip uninstall torch -y
pip install --no-cache-dir --pre torch==2.6.0.dev20240918 --index-url https://download.pytorch.org/whl/nightly/rocm6.2

# Build & install AMD SMI
pip install /opt/rocm/share/amd_smi

# Install dependencies
pip install --upgrade numba scipy huggingface-hub[cli]
pip install "numpy<2"
git clone https://github.com/vllm-project/vllm.git
cd vllm
pip install -r requirements-rocm.txt
pip install setuptools_scm


# Build vLLM for MI210/MI250/MI300.
export PYTORCH_ROCM_ARCH="gfx90a;gfx942;gfx1100"
python3 setup.py develop


Step 4: Rum Inference server
Code:
echo "export HSA_OVERRIDE_GFX_VERSION=11.0.0" >> .profile
echo "export HSA_ENABLE_SDMA=0" >> .profile
python -m vllm.entrypoints.openai.api_server --port=5002 --host=0.0.0.0 --model <Model Name> --seed 1234 --max-num-batched-tokens=65536
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum