openSUSE / SUSEPrime

Provide nvidia-prime like package for openSUSE
64 stars 11 forks source link

[bug?] Amd offload-set #81

Closed CicadaSeventeen closed 2 years ago

CicadaSeventeen commented 2 years ago

Like at line 600 in rime-select.sh

    offload-set)

        if [ "$2" = "intel2" ]; then
            if ! rpm -q xf86-video-intel > /dev/null; then
                echo "package xf86-video-intel is not installed";
                exit 1
            fi
        fi

        if [ "$2" = "amd" ];then
            if ! rpm -q xf86-video-amdgpu > /dev/null; then
                echo "package xf86-video-amdgpu is not installed";
                exit 1
            fi
        fi

        if ! nv_offload_capable; then
            echo "ERROR: offloading needs nvidia drivers >= 435.xx"
            exit 1
        fi
        case $2 in
            intel|intel2)
                echo $2 > /etc/prime/offload_type
                echo "nvidia-offload is now available with $2 driver"
                echo "use it with \"prime-select offload\""
            ;;
            *)
                echo "Only intel|intel2 driver is available in nvidia-offload!"
            ;;
        esac
    ;;

Look like trying to support AMD but not really work. I think it is a bug. Not on openSUSE these days. I am just reading codes and find this. I do that because I am thinking switch back to openSUSE since leap 15.4 has come out but I am not sure it has enough support for my new Amd+Nvidia device. Thanks

sndirsch commented 2 years ago

Note to myself. This is a follow-up to issue #80

sndirsch commented 2 years ago

What's wrong with these lines around line 600? Could you explain in more details, please? I've seen reports modeset(amd)/nvidia working in offload mode. That's standard setting for offload mode on AMD/NVIDIA hardware and you can't change it by using offload-set mode, that's true.

CicadaSeventeen commented 2 years ago

Looking at lines I copy here. Where $2 can only be intel or intel2, otherwise it cannot pass case at line 607. But above there is a judgement about whether $2 isamd at line 596. If you attend to refuse using prime-select offload-set amd, then if [ "$2" = "amd" ];then is meaningless. So I think here is something wrong.

sndirsch commented 2 years ago

Ok. I see what you mean. The check about intel or intel2 is correct. The combination amdgpu/nvidia has not been implemented for offload mode, so a check for the xf86-video-amdgpu package is not needed there.

sndirsch commented 2 years ago

Fixed this now and made a new release 0.8.8.