CHIP-SPV / chipStar

chipStar is a tool for compiling and running HIP/CUDA on SPIR-V via OpenCL or Level Zero APIs.
Other
166 stars 27 forks source link

hipconfig -v prints version twice, -n does not work #818

Closed linehill closed 2 months ago

linehill commented 3 months ago

E.g.

$ ./install/bin/hipconfig -v
5.1.0-05.1.0-0$ 

-n should add a newline at the end but instead a lot of other stuff gets printed instead.

$ ./install/bin/hipconfig -v -n
5.1.0-0HIP version: 5.1.0-0

==hipconfig
HIP_PATH           :/mnt/md0/linehill/ws-chip-spv-3/install
HIP_COMPILER       :clang
HIP_PLATFORM       :intel
HIP_RUNTIME        :spirv
(...)

ROCm's output as reference:

$ /opt/rocm/bin/hipconfig -v -n
6.0.32830-d62f6a171
$ 
karlwessel commented 3 months ago

I get the same problem: version is printed twice and -n prints a lot of stuff.

I think the duplication of the version in my case is caused by having two platforms available: cuda and intel. See hipBin.cpp:152

The same duplication happens for hipconfig --rocmpath and this further causes CMake to not be able to find the ROCm root directory when enabling HIP as language in cmake:

CMake Error at /usr/share/cmake/Modules/CMakeDetermineHIPCompiler.cmake:174 (message):
  Failed to find ROCm root directory.
Call Stack (most recent call first):
  hip/CMakeLists.txt:8 (enable_language)
pvelesko commented 3 months ago

@linehill does the PR resolve your issue?

linehill commented 3 months ago

-n works but the version is still printed twice:

$ ../install/bin/hipconfig -v -n
6.0.0-b3f39165
6.0.0-b3f39165
$
pvelesko commented 3 months ago

Can't reproduce your behavior:

╭─pvelesko@cupcake /space/pvelesko/chipStar/main/build ‹hipcc-fix-verbose› 
╰─$ ./install/bin/hipconfig -v -n                                                                                                                                               130 ↵
6.0.0-b3f39165
linehill commented 3 months ago

Can't reproduce your behavior:

It might be reproduced if you have CUDA SDK installed (it can be installed without a NVidia GPU).