Giter VIP home page Giter VIP logo

Comments (22)

glenn-jocher avatar glenn-jocher commented on July 24, 2024 2

Hello @xalteropsx,

Thank you for bringing this to our attention. We'll review the code to ensure that the device handling aligns with standard PyTorch practices and doesn't default to HIP unintentionally. Your feedback is invaluable in helping us improve. We'll update you once we have more information or a fix.

Thanks for your patience and for helping us enhance our library! 🚀

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024 1

@xalteropsx hello! Thank you for reporting this issue and providing detailed information. It seems like there might be an initialization problem with the HIP module on your AMD setup.

Could you please ensure that your AMD drivers are up to date and that HIP is correctly installed and configured on your system? Sometimes, such errors can be resolved by updating to the latest drivers or reinstalling the HIP environment.

If the issue persists after checking these, could you provide more details about the steps leading up to this error, or any specific configurations you're using? This will help us further diagnose the problem.

Looking forward to your response!

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024 1

Hello @xalteropsx,

Thank you for sharing the output. It appears that hipconfig --full is failing, which suggests there might be an issue with the HIP installation or its environment configuration on your system.

Could you please try reinstalling HIP to ensure all components are correctly set up? Additionally, verifying that all necessary dependencies are installed might help resolve this issue.

If the problem persists after these steps, it might be beneficial to check the system logs for any errors related to HIP during its execution or initialization.

Thank you for your patience and cooperation as we work through this issue together! 🛠️

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024 1

Hello @xalteropsx,

No worries at all! Take your time to install and set everything up. If you encounter any further issues or have questions during the process, feel free to reach out. We're here to help! 🛠️

Best of luck, and I hope it resolves the issue!

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024 1

Hello @xalteropsx,

Thanks for the update and for sharing the hipconfig --full output. It looks like the HIP installation and environment variables are set correctly now. However, the error indicating "Module not initialized" suggests there might still be an issue with the HIP runtime or its interaction with your specific hardware setup.

Here are a few steps you might consider:

  1. Ensure that the latest drivers for your AMD GPU are installed.
  2. Verify that there are no conflicts with other installed software that might be affecting the HIP runtime.
  3. Try running a simple HIP sample program to isolate whether the issue is with the specific setup of your project or the HIP installation itself.

If these steps do not resolve the issue, it might be helpful to reinstall HIP and ensure all components are correctly configured. If the problem persists, providing detailed logs and system information might help further diagnose the issue.

Thank you for your patience as we work through this together! 🛠️

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024 1

Hello @xalteropsx,

Thank you for your patience and for providing additional details. I understand the frustration with the issues you've encountered. It's certainly not the experience we aim for.

Regarding the HIP dependency, it's primarily used for AMD GPU support to optimize performance. However, if it's causing too much trouble, you might consider running the models on CPU or with CUDA if you have access to an NVIDIA GPU, which should bypass these HIP-related issues.

We appreciate your feedback and are continuously working to improve the ease of use and compatibility of our models. If you decide to give it another try and need further assistance, please don't hesitate to reach out.

Thank you for trying out Ultralytics YOLO, and we hope to see you back! 🙏

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024 1

Hello @xalteropsx,

Thank you for reaching out. To ensure that PyTorch uses CUDA instead of HIP, you can explicitly set the device in your code before running your model. Here's a quick example:

import torch
from ultralytics import YOLO

device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = YOLO('yolov8n.pt', device=device)

This snippet checks for CUDA availability and sets the device accordingly. If you continue to experience issues, please ensure your PyTorch installation is configured correctly for CUDA usage.

Let us know how it goes! 🚀

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024 1

Hello @xalteropsx,

Thank you for pointing this out. It seems there was a misunderstanding in my previous response. The YOLO class from the Ultralytics library indeed does not have a device parameter directly in its constructor. Instead, you can set the device after initializing the model like this:

from ultralytics import YOLO
import torch

model = YOLO('yolov8n.pt')
model.to('cuda' if torch.cuda.is_available() else 'cpu')

This should correctly move the model to the desired device without initializing HIP. I apologize for the confusion earlier. If you encounter any further issues or have more questions, please let us know.

Thank you for your patience and for working with our tools. We're here to help!

from ultralytics.

github-actions avatar github-actions commented on July 24, 2024

👋 Hello @xalteropsx, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

yes i am on latest hip X:\amdgraphic\amd2025\hip\5.7

//updated done

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

:0:C:\constructicon\builds\gfx\two\23.30\drivers\compute\clr\hipamd\ between why it look on c drive i didnt understand u have set it to base on linux?

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024

Hello @xalteropsx,

It looks like the HIP configuration might be defaulting to a path that's typically used in Windows environments. This could be due to how the HIP environment variables are set on your system.

Could you check your HIP environment settings and ensure they point to the correct directories on your system? Specifically, you might want to verify the HIP_PATH and related environment variables to ensure they align with your actual installation paths.

If the issue persists, providing the output of echo %PATH% and echo %HIP_PATH% from your command line might help further diagnose the configuration issue.

Thank you for your cooperation!

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

image
i already set it up bro @glenn-jocher and also set the path of bin as well
image

image

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

image

if needed team viewer or google remote or google meet let me know i will put link invite link here could help to save time

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024

Hello @xalteropsx,

Thank you for the update and for setting up the environment variables correctly. It seems like the issue might be more complex than a simple configuration error.

While we appreciate your offer for a remote session, we typically handle support through this platform to maintain transparency and for the benefit of the community. Could you please provide the output of the following commands? This will help us better understand the environment setup:

  1. echo %PATH%
  2. echo %HIP_PATH%
  3. hipconfig --full

This information will help us further diagnose the issue. Thank you for your cooperation! 🙏

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

image
look like hipconfig --full fail

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

sorry bro fell sleep just woke up in few moment i will fix i know i need to install thnx for showing me i hope it can fix it up

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

@glenn-jocher bro it didnt work after srawberry perl i could able to get hipconfig -full work but it still same error

:0:C:\constructicon\builds\gfx\two\23.30\drivers\compute\clr\hipamd\src\hip_global.cpp:129 : 53194584177 us: [pid:31612 tid:0x6278] Module not initialized

here the logs of hipconfig --full

HIP version  : 5.7.32000-193a0b56e

== hipconfig
HIP_PATH     : X:/amdgraphic/amd2025/hip/5.7
ROCM_PATH    : /opt/rocm
HIP_COMPILER : clang
HIP_PLATFORM : amd
HIP_RUNTIME  : rocclr
CPP_CONFIG   :  -D__HIP_PLATFORM_HCC__= -D__HIP_PLATFORM_AMD__= -I"X:/amdgraphic/amd2025/hip/5.7/include" -I"X:\amdgraphic\amd2025\hip\5.7\lib\clang\17.0.0
"

== hip-clang
HIP_CLANG_PATH   : X:/amdgraphic/amd2025/hip/5.7/bin
clang version 17.0.0 (git@github.amd.com:Compute-Mirrors/llvm-project 6e709f613348e5258188527d11ee8d78376f26b7)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: X:\amdgraphic\amd2025\hip\5.7\bin
AOMP-16.0-45 (http://github.com/ROCm-Developer-Tools/aomp):
 Source ID:16.0-45-6b875fb548b9ded0f07df02bc2af6e12568504a9
  LLVM version 17.0.0git
  Optimized build.
  Default target: x86_64-pc-windows-msvc
  Host CPU: znver1

  Registered Targets:
    amdgcn - AMD GCN GPUs
    r600   - AMD GPUs HD2XXX-HD6XXX
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64
hip-clang-cxxflags :  -isystem "X:/amdgraphic/amd2025/hip/5.7/include" -O3 --hip-path="X:/amdgraphic/amd2025/hip/5.7"
hip-clang-ldflags  : --driver-mode=g++ -fuse-ld=lld --ld-path="X:/amdgraphic/amd2025/hip/5.7/bin/lld-link.exe" -O3 --hip-path="X:/amdgraphic/amd2025/hip/5.7" --hip-link

=== Environment Variables
PATH=Z:\software\python\Scripts\;Z:\software\python\;Z:\software\python11\Scripts\;Z:\software\python11\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Certbot\bin;C:\Program Files\Amazon\AWSCLIV2\;X:\aiall\GIMP\GIMP 2\bin;X:\server\bin\;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\MinGW\bin;X:\server\machine\GTK3\bin;C:\Program Files\Inkscape\bin;C:\Program Files\PowerShell\7\;X:\amdgraphic\amd2025\hip\5.7\bin;X:\server\machine\straw\c\bin;X:\server\machine\straw\perl\site\bin;X:\server\machine\straw\perl\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Certbot\bin;C:\Program Files\Amazon\AWSCLIV2\;X:\aiall\GIMP\GIMP 2\bin;X:\server\bin\;C:\Program Files\dotnet\;C:\Users\haide\AppData\Roaming\npm;C:\MinGW\bin;C:\Program Files\PowerShell\7\;X:\server\machine\GTK3\bin;C:\Program Files\Inkscape\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\haide\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\haide\AppData\Local\Android\Sdk\tools;C:\Users\haide\AppData\Local\Android\Sdk\platform-tools;X:\server\Sublime Text;C:\Users\haide\AppData\Local\GitHubDesktop\bin;X:\server\machine\zluda;
FINDSTR: // ignored
FINDSTR: // ignored
FINDSTR: // ignored
FINDSTR: // ignored
HIPCONFIG="X:\amdgraphic\amd2025\hip\5.7\bin\hipconfig"
HIP_PATH=X:\amdgraphic\amd2025\hip\5.7
HIP_PATH_57=X:\amdgraphic\amd2025\hip\5.7\
HIP_VISIBLE_DEVICES=0

== Windows Display Drivers
Hostname     : HaiderAF
FINDSTR: // ignored
FINDSTR: // ignored
Advanced Micro Devices, Inc.  C:\Windows\System32\DriverStore\FileRepository\u0403196.inf_amd64_d0c41aa30f8bcfb2\B402774\amdxn64.dll,C:\Windows\System32\DriverStore\FileRepository\u0403196.inf_amd64_d0c41aa30f8bcfb2\B402774\amdxx64.dll,C:\Windows\System32\DriverStore\FileRepository\u0403196.inf_amd64_d0c41aa30f8bcfb2\B402774\amdxx64.dll,C:\Windows\System32\DriverStore\FileRepository\u0403196.inf_amd64_d0c41aa30f8bcfb2\B402774\amdxc64.dll  AMD Radeon RX 7900 XTX

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

bro i already at 24.5.1 which is latest
and i already seems to give up doing this more

thanks for ur help if any chances i got mood i get back

but it really odd i never saw any library have so much issue i run many library with torch work fine but urs is strange keep throwing 23.30 driver path which doesnt even existed also why u forcing it to hip in the first place why not we can use torch by default
here is an proof
image

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

@glenn-jocher ur by default device = cuda is calling hip rather torch how can we run it using torch

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

@glenn-jocher .... i really dont know what i can say bro

Z:\testf>py why.py
cuda
Traceback (most recent call last):
File "Z:\testf\why.py", line 316, in
model = YOLO('hand_yolov9c.pt', device=device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: YOLO.init() got an unexpected keyword argument 'device'

from ultralytics import YOLO
from PIL import Image
import torch

img = Image.open("1.jpg")

device = 'cuda' if torch.cuda.is_available() else 'cpu'
print(device)
model = YOLO('yolov8n.pt', device=device)
pred = model(img, conf=0.3)

from ultralytics.

xalteropsx avatar xalteropsx commented on July 24, 2024

@glenn-jocher https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/model.py u dont even have init for device .... and if i call it from model set device ur zzz will throw hip warning without even using the torch it really that much time waste

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.