Driver for AMD graphic card

Forum Forums General Software Driver for AMD graphic card

  • This topic has 14 replies, 4 voices, and was last updated Apr 17-8:23 am by abc-nix.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #139268
    Member
    francogrex

      Hi, a question about installing an GPU driver. First a few details:
      – My System:
      Kernel: 6.1.42-antix.1-amd64-smp arch: x86_64 bits: 64 compiler: gcc
      v: 13.2.0 Desktop: IceWM v: 3.4.7 Distro: antiX-23_x64-full Arditi del
      Popolo 27 August 2023 base: Debian GNU/Linux 12 (bookworm)
      – And my Graphic card:
      Device-1: AMD Raven Ridge [Radeon Vega Series / Radeon Mobile Series]
      vendor: Hewlett-Packard driver: amdgpu v: kernel arch: GCN-5 bus-ID: 04:00.0

      I therefore cannot install the Nvidia driver that is suggested in the antiX-23_x64 distro because my PC doesn’t have an Nvidia graphic card, and I need to find a GPU driver compatible with AMD Raven Ridge. On the AMD site they have a driver (Rocm) that may do the job – not as good as Nvidia, but they only have a Ubuntu compatible driver software!

      Is anyone aware of a GPU driver software for AMD that we can compatibly install on this antiX distro?

      • This topic was modified 1 month, 2 weeks ago by francogrex.
      #139270
      Member
      PPC

        Dear @francogrex- welcome to the forum!
        I assume you are brand new to Linux, or at least, not that tech savvy, since you seem to be a bit confused:

        I therefore cannot install the Nvidia driver that is suggested in the antiX-23_x64 distro because my PC doesn’t have an Nvidia graphic card

        Installing a Nvidea driver is not recommended to all antiX users, just the ones that, of course, have a Nvidea video card and do want/need that driver to use all the features of their hardware.

        Device-1: AMD Raven Ridge

        Usually AMD drivers are included in the Linux Kernel, and do not require to be installed. As far as I know, and after a quick on-line search, Raven Ridge driver seems to be included in Linux Kernels > 5

        In case you really need to install the official AMD driver: some (most) Ubuntu packages do work on antiX. I would recommend running antiX Live (from a USB flash drive, for example) and installing that driver, so try to check out if it breaks anything…

        P.

        • This reply was modified 1 month, 2 weeks ago by PPC.
        • This reply was modified 1 month, 2 weeks ago by PPC.
        #139293
        Member
        francogrex

          Dear @francogrex- welcome to the forum!
          …Usually AMD drivers are included in the Linux Kernel, and do not require to be installed. As far as I know, and after a quick on-line search, Raven Ridge driver seems to be included in Linux Kernels > 5 …

          Hi. Thank you for your response. I appreciate the information about AMD drivers being included in the Linux kernel, but my question has been off the mark. It should have been clearer that it pertains specifically to installing GPU compute libraries and tools like ROCm (for AMD G card) or CUDA (Nvidia) for machine learning and parallel computing tasks using the existing drivers. These libraries provide APIs and runtime environments optimized for utilizing GPUs for compute-intensive workloads.Ideally it’s CUDA that I want but CUDA is only for Nvidia card which I don’t have.
          Do you know if such GPU computing libraries exist for antiX with an AMD graphic card (and NOT an Nvidia card)?
          Thanks

          #139302
          Member
          PPC

            I never even heard about ROCm until today.
            No package related to it seems to exist in antiX (and the Debian repo antiX uses). When I searched for the packages that are available:

            apt search rocm

            Some ROCm related packages were listed, but from I what I understand, not the required libraries. If they exist and depend on systemd init system, then they won’t be available for antiX.
            Your best bet, if you really want to try it in your antiX installation is to back up your important files and try to install the Ubuntu package. If antiX breaks in the process, all you have to do is reinstall and restore your files from the backup.

            Note: I know from experience that anything AI related is relatively resource intensive – depending on how powerful your computer is, it probably won’t be able to do any useful thing with it, specially if your hardware is so weak that you had to install antiX on it because other OSes were too slow…

            P.

            #139321
            Member
            abc-nix

              For some reason, AMD doesn’t officially support Debian 12. The Debian package team are preparing to give easy support on future Debian releases, but not right now.

              See this issue in ROCm github repo.

              Good news, you can use a non-official method. It needs you to install an older python version (3.10), which is stupid. I haven’t tested this, and I expect you may encounter problems as antiX already brings a python package installed.

              If you are proficient in using anaconda, you could create a conda environment for python 3.10 and use it as the default env. It makes it easy to switch between different python environments to launch different projects with different python dependencies on the same machine without having to use containers.

              I cannot understand all the obsession with python in Machine Learning. I know it makes it “easier” for researchers, with Jupyter notebooks and such, but python dependency hell is a real thing. I hope a more stable alternative is developed in the future.

              #139324
              Member
              techore

                *sigh*

                I went all AMD to avoid the f’ing nvidia install and maintenance challenges (and because I feel their business practices to be reprehensible). Dangit! Cannot win.

                @abc-nix, thank you for the heads up.

                #139326
                Member
                francogrex

                  …Good news, you can use a non-official method. It needs you to install an older python version (3.10), which is stupid. I haven’t tested this, and I expect you may encounter problems as antiX already brings a python package installed…

                  Hi thanks for the reply. Indeed I found the same link while I was searching this morning and I tried to install python 3.10: the only way that was possible for me was to build from source. But When I tried to install ROCm it failed complaining about missing libpython3.10 (or 3.8), although I had set the 3.10 version as the default alternative… even in virtual environment I couldn’t get it to install. Maybe installing python3.10 instead of building it from source would have been better, but that would have been a pain and I was worried about breaking apt and other things if I went that route… so I abandoned it 🙁 I figured it may not be worth the hassle. I can manage (poorly) with CPU without GPU support.

                  #139328
                  Member
                  francogrex

                    …I cannot understand all the obsession with python in Machine Learning. I know it makes it “easier” for researchers, with Jupyter notebooks and such, but python dependency hell is a real thing. I hope a more stable alternative is developed in the future.

                    I know and share your frustration and outrage. I genuinely hate python but it’s become unavoidable especially for AI/ML. The reason is that almost all AI/ML researchers are more mathematicians/statisticians than bona fide programmers and python gives them an easy way to test and implement their ideas without much thought about quality and maintenance and validation… and they fork projects between them… So python cannot be dethroned for now, not for the foreseeable future either….

                    #139337
                    Member
                    abc-nix

                      missing libpython3.10 (or 3.8)

                      Tomorrow I have some free time. I will try to setup python 3.10 on a live USB antiX 23 full. Based on this reddit post for llama.cpp and (newer) Ubuntu, it should work if you install libpython3.10-dev only, no need for replacing all the python stack. If needed, I will build the packages and share them here if it works.

                      #139380
                      Member
                      francogrex

                        missing libpython3.10 (or 3.8)

                        Tomorrow I have some free time. I will try to setup python 3.10 on a live USB antiX 23 full. Based on this reddit post for llama.cpp and (newer) Ubuntu, it should work if you install libpython3.10-dev only, no need for replacing all the python stack. If needed, I will build the packages and share them here if it works.

                        Excellent. The instruction would be good if not the packages themselves.

                        #139447
                        Member
                        abc-nix

                          Steps to install rocm on antiX 23

                          1. Install amdgpu-install from ubuntu

                          wget https://repo.radeon.com/amdgpu-install/5.7.1/ubuntu/jammy/amdgpu-install_5.7.50701-1_all.deb
                          sudo apt install ./amdgpu-install_5.7.50701-1_all.deb

                          2. Build amdgpu propietary graphic support for current kernel:
                          sudo amdgpu-install --usecase=dkms

                          3. Install rocm dependencies (please check if they are needed for your usecase, as they add 18 GBs to your disk):
                          sudo apt install rocm-libs rocm-ocl-icd rocm-hip-sdk rocm-hip-libraries rocm-cmake rocm-clang-ocl

                          4. Install rocm-dev
                          4.1. First, download the packages needed to install python3.10 on antiX 23 (I built them for Debian bullseye because of dependency problems with bookworm).

                          4.2. Edit /etc/apt/sources.list.d/debian.list and temporarily enable the bullseye repo. If not present, copy the repo used for bookworm and change it to bullseye. Example:
                          deb http://ftp.de.debian.org/debian/ bullseye main contrib non-free

                          4.3. Update the package list info
                          sudo apt update

                          4.4. Install the python3.10 packages you downloaded at the same time. You can cd into the folder where you downloaded the packages from step 4.1. and run this command:
                          sudo apt install ./libpython3.10_3.10.12-1~22.04.3_amd64.deb ./libpython3.10-dev_3.10.12-1~22.04.3_amd64.deb ./libpython3.10-minimal_3.10.12-1~22.04.3_amd64.deb ./libpython3.10-stdlib_3.10.12-1~22.04.3_amd64.deb

                          4.5. Restore the Debian repo list /etc/apt/sources.list.d/debian.list so that it looks the same as before the changes done in step 4.2. and then repeat step 4.3. (apt update).

                          4.6. Download and manually install the nosystemd rocprofiler from this link.
                          sudo apt install ./rocprofiler_2.0.0.50701-98~22.04+nosystemd_amd64.deb

                          4.7. Finally, install rocm-dev
                          sudo apt install rocm-dev

                          5. Reboot and check that your AMD GPU is detected
                          sudo rocminfo

                          Note: Except for the last step (I was on a live system and I don’t have AMD gpus) everything else worked on a live USB with antiX 23 full 64-bits. If you get stuck, ask here and I will try again in case I missed a step or did it in the wrong order.
                          You need over 30 GBs of RAM to do all this on live-usb, so it is better you perform the above instructions on an installed system.

                          #139499
                          Member
                          francogrex

                            Steps to install rocm on antiX 23

                            Great I’ll try it out tonight. Do you think it’s safe directly on the hd? I’m just worried that if I do it directly on the hard drive to break things like apt…? And should i keep both python 3.11 and 3.10 or could I remove the 3.10 after having created the rocm? thanks

                            • This reply was modified 1 month, 1 week ago by francogrex.
                            #139501
                            Member
                            abc-nix

                              It is safe to install on the HD.

                              What I would do in your case first is step 1 and 2 and then reboot to see if the amdgpu proprietary module is properly loaded. If you arrive at the graphical interface, then it is safe.

                              When you arrive at step 4, installing libpython3.10(-dev) will only add the libraries needed for other programs to use features of this python version, but not the python3 executable. That means that main python3 will still run python3.11, so they can both live together in your system. Uninstalling any of them could lead to many packages being removed.

                              The most important step in this process is to remove the bullseye repo once libpython3.10 is installed. This way you know that your bookworm repos are safe and no other old packages will creep in to your computer.

                              The final step 5, checking rocminfo, will confirm if everything went well. If it didn’t, and no AMD device is recognized, the system will still work, so you can remove all those rocm related packages and continue using your system as before.

                              Let us know if this worked for you. Right now I am still in the nVidia camp, but may consider switching in the future.

                              • This reply was modified 1 month, 1 week ago by abc-nix.
                              #139661
                              Member
                              francogrex

                                Steps to install rocm on antiX 23

                                Hi so I tried this and it worked well, the instructions that you gave, until the last item rocminfo, however unfortunately it was painful and took a lot of space (but that you know already) and I had to install everything but despite that the AI Python package was refusing to “collaborate” with rocm — failing to load its libraries… (I had to build the python3.10 executable too) but maybe it required different version of rocm and I was really in the end I said okay it’s not worth it, as I already knew that even if all installed and worked well, it won’t be as strong as Nvdia Cuda (as I’ve learned from others who have tried it out). I would advise to stick with NVIDIA if you have a computer capable of supporting Nvidia and Cuda… AMD need to up their game in that field, both from a point of scope and capability. But thanks for the steps and the files, I think they should be useful in general, however for my case use, although installation was fine, it didn’t help me run the AI programs I wanted.

                                #139710
                                Member
                                abc-nix

                                  If you need to run any ML project with python, learn how to set up a conda environment for a specific python version, and install all python dependencies through pip for said environment. This will save you some headaches, as it would make it easy for you to switch between different python versions on the fly. I have two conda environments for Stable Diffusion and for private-gpt (to run LLMs with RAG, though I have now replaced it with other llama.cpp projects). Even though they take up over 50 GBs of space (only the python dependencies), I can easily run two different programs that require two different python versions and dependencies at the same time.

                                  Check again to see if there are any tutorials on the internet for setting up a conda environment for that specific project you want to run.

                                Viewing 15 posts - 1 through 15 (of 15 total)
                                • You must be logged in to reply to this topic.