Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

remove hardcoded kver value from nv-peer-mem entrypoint #12

Open
adrianchiris opened this issue Sep 29, 2020 · 0 comments
Open

remove hardcoded kver value from nv-peer-mem entrypoint #12

adrianchiris opened this issue Sep 29, 2020 · 0 comments

Comments

@adrianchiris
Copy link
Collaborator

in inject_nvidia_driver() function ${KERNEL_VERSION} should be used instead.

function inject_nvidia_driver() {
    # NVIDIA driver may be installed either with/out DKMs which affects the module location
    # always inject the modules under dkms as thats where nv_peer_mem is looking for the modules
    # alternative is to modify nv_peer_mem/create_nv_symvers.sh to support both locations
    has_files_matching ${NVIDIA}/usr/src/ nvidia-*
    if  [[ $? -eq 0 ]]; then
        ln -sf ${NVIDIA}/usr/src/nvidia-* /usr/src/.
    else
        echo "ERROR: Nvidia GPU driver sources not found."
        return 1
    fi

    has_files_matching ${NVIDIA}/lib/modules/${KERNEL_VERSION}/updates/dkms nvidia
    if [[ $? -eq 0 ]]; then
        ln -sf ${NVIDIA}/lib/modules/${KERNEL_VERSION}/updates/dkms/* /lib/modules/${KERNEL_VERSION}/updates/dkms/
    else
        has_files_matching ${NVIDIA}/lib/modules/4.15.0-109-generic/kernel/drivers/video/ nvidia
        if [[ $? -eq 0 ]]; then
            # Driver installed as non dkms kernel module
            ln -sf ${NVIDIA}/lib/modules/4.15.0-109-generic/kernel/drivers/video/nvidia* /lib/modules/4.15.0-109-generic/updates/dkms/
        else
            echo "ERROR: Failed to locate Nvidia GPU drivers in mount: ${NVIDIA}"
            return 1
        fi
    fi
    # ln -sf ${NVIDIA}/var/lib/dkms/nvidia /var/lib/dkms/nvidia
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant