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

[Installation]: Cannot find CUDA_TOOLKIT_ROOT_DIR while trying to build for ROCm #815

Open
RuntimeRacer opened this issue Nov 14, 2024 · 1 comment

Comments

@RuntimeRacer
Copy link

Your current environment

Collecting environment information...
WARNING:  Failed to import from aphrodite._C with No module named 'aphrodite._C'
PyTorch version: 2.4.0a0+gitee1b680
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 6.2.41134-65d174c3e

OS: Ubuntu 22.04.5 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.31.0
Libc version: glibc-2.35

Python version: 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-6.8.0-48-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: AMD Radeon (TM) Pro WX 7100 Graphics (gfx803)
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: 6.2.41134
MIOpen runtime version: 3.2.0
Is XNNPACK available: True

CPU:
Architecture:                         x86_64
CPU op-mode(s):                       32-bit, 64-bit
Address sizes:                        46 bits physical, 48 bits virtual
Byte Order:                           Little Endian
CPU(s):                               56
On-line CPU(s) list:                  0-55
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) CPU E5-2690 v4 @ 2.60GHz
CPU family:                           6
Model:                                79
Thread(s) per core:                   2
Core(s) per socket:                   14
Socket(s):                            2
Stepping:                             1
CPU max MHz:                          3500.0000
CPU min MHz:                          1200.0000
BogoMIPS:                             5187.95
Flags:                                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts vnmi md_clear flush_l1d
Virtualization:                       VT-x
L1d cache:                            896 KiB (28 instances)
L1i cache:                            896 KiB (28 instances)
L2 cache:                             7 MiB (28 instances)
L3 cache:                             70 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0-13,28-41
NUMA node1 CPU(s):                    14-27,42-55
Vulnerability Gather data sampling:   Not affected
Vulnerability Itlb multihit:          KVM: Mitigation: VMX disabled
Vulnerability L1tf:                   Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:                    Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:               Mitigation; PTI
Vulnerability Mmio stale data:        Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Not affected
Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Mitigation; Clear CPU buffers; SMT vulnerable

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] optree==0.13.1
[pip3] pyzmq==26.2.0
[pip3] torch==2.4.0a0+gitee1b680
[pip3] torchvision==0.19.1a0+6194369
[pip3] transformers==4.45.2
[pip3] triton==3.0.0
[conda] Could not collect
ROCM Version: 6.2.41134-65d174c3e
Neuron SDK Version: N/A
Aphrodite Version: 0.6.3.post1
Aphrodite Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
Could not collect

How did you install Aphrodite?

Hi all, I am currently playing around with an older AMD Workstation card and wanted to see whether it's possible to serve Models using aphrodite engine on it.

Driver building and Installation with ROCm worked rather smoothly, despite I had to research a few things.

Then I tried to install the normal aphrodite-engine via pip after building PyTorch manually. This showed some CUDA-Errors, so I checked the documentation and figured that I'd require to build aphrodite myself and followied the guide here: https://aphrodite.pygmalion.chat/pages/installation/installation-rocm.html#installation-with-rocm

Unfortunately, I am getting an unexpected Error for a CUDA_TOOLKIT_ROOT_DIR, which seems a little weird since I have no Nvidia drivers or CUDA installed on the machine. Pointing that directory to the ROCm dir also didn't solve it:

 python setup.py develop
running develop
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running egg_info
writing aphrodite_engine.egg-info/PKG-INFO
writing dependency_links to aphrodite_engine.egg-info/dependency_links.txt
writing entry points to aphrodite_engine.egg-info/entry_points.txt
writing requirements to aphrodite_engine.egg-info/requires.txt
writing top-level names to aphrodite_engine.egg-info/top_level.txt
reading manifest file 'aphrodite_engine.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'aphrodite_engine.egg-info/SOURCES.txt'
running build_ext
-- Build type: RelWithDebInfo
-- Target device: cuda
-- Found python matching: /usr/bin/python.
Building PyTorch for GPU arch: gfx803
HIP VERSION: 6.2.41134-65d174c3e
-- Caffe2: Header version is: 6.2.4

***** ROCm version from rocm_version.h ****

ROCM_VERSION_DEV: 6.2.4
ROCM_VERSION_DEV_MAJOR: 6
ROCM_VERSION_DEV_MINOR: 2
ROCM_VERSION_DEV_PATCH: 4
ROCM_VERSION_DEV_INT:   60204
HIP_VERSION_MAJOR: 6
HIP_VERSION_MINOR: 2
TORCH_HIP_VERSION: 602

***** Library versions from dpkg *****

rocm-dev VERSION: 6.2.4.60204-139~22.04
rocm-developer-tools VERSION: 6.2.4.60204-139~22.04
rocm-device-libs VERSION: 1.0.0.60204-139~22.04
hsakmt-roct-dev VERSION: 20240607.5.7.60204-139~22.04
hsa-rocr-dev VERSION: 1.14.0.60204-139~22.04

***** Library versions from cmake find_package *****

hip VERSION: 6.2.41134
hsa-runtime64 VERSION: 1.14.60204
amd_comgr VERSION: 2.8.0
rocrand VERSION: 3.1.1
hiprand VERSION: 2.11.1
rocblas VERSION: 4.2.4
hipblas VERSION: 2.2.0
hipblaslt VERSION: 0.8.0
miopen VERSION: 3.2.0
hipfft VERSION: 1.0.16
hipsparse VERSION: 3.1.1
rccl VERSION: 2.20.5
rocprim VERSION: 3.2.2
hipcub VERSION: 3.2.1
rocthrust VERSION: 3.1.1
hipsolver VERSION: 2.2.0
HIP is using new type enums
-- Found OpenCL headers: /usr/include
CMake Warning at /home/runtimeracer/.local/lib/python3.10/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:22 (message):
  static library kineto_LIBRARY-NOTFOUND not found.
Call Stack (most recent call first):
  /home/runtimeracer/.local/lib/python3.10/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:120 (append_torchlib_if_found)
  CMakeLists.txt:67 (find_package)


CMake Warning (dev) at CMakeLists.txt:68 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/local/lib/python3.10/dist-packages/cmake/data/share/cmake-3.31/Modules/FindCUDA.cmake:883 (message):
  Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
  CMakeLists.txt:68 (find_package)


-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "/home/runtimeracer/aphrodite/setup.py", line 474, in <module>
    setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 114, in install_for_development
    self.run_command('build_ext')
  File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/usr/lib/python3.10/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/runtimeracer/aphrodite/setup.py", line 219, in build_extensions
    self.configure(ext)
  File "/home/runtimeracer/aphrodite/setup.py", line 202, in configure
    subprocess.check_call(
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/runtimeracer/aphrodite', '-G', 'Ninja', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/runtimeracer/aphrodite/build/lib.linux-x86_64-3.10/aphrodite', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=build/temp.linux-x86_64-3.10', '-DAPHRODITE_TARGET_DEVICE=cuda', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache', '-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache', '-DAPHRODITE_PYTHON_EXECUTABLE=/usr/bin/python', '-DCMAKE_JOB_POOL_COMPILE:STRING=compile', '-DCMAKE_JOB_POOLS:STRING=compile=56']' returned non-zero exit status 1.

I feel like I'm super close to get things working, but this seems like some kind of bug to me.
Any help and Ideas would be appreciated.

@RuntimeRacer
Copy link
Author

UPDATE: I was able to get past this Problem by commenting out the following lines in CMakeLists.txt:

find_package(CUDA REQUIRED)
find_package(CUDAToolkit REQUIRED)
list(APPEND LIBS CUDA::cublas)

And adding gfx803 to the list of supported architectures:

set(HIP_SUPPORTED_ARCHS "gfx803;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100")

However, it turned out that I can't compile the Kernels currently, because some fp16 operations in the hip kernels are not supported by gfx803.
I'll have a look at that later once I find the time for it.

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

1 participant