diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b06532cce..e7a7f6c1b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,9 +3,9 @@ on: push: tags: - v[0-9]+.[0-9]+.[0-9]+ - branches: [master,dev-vgpu-1219] + branches: [master] pull_request: - branches: [master,dev-vgpu-1219] + branches: [master] jobs: build: diff --git a/docker/amd64/Dockerfile.vgpu-ubuntu20.04 b/docker/amd64/Dockerfile.vgpu-ubuntu20.04 index 2a45c337e..4d3e216e4 100644 --- a/docker/amd64/Dockerfile.vgpu-ubuntu20.04 +++ b/docker/amd64/Dockerfile.vgpu-ubuntu20.04 @@ -39,6 +39,5 @@ ENV NVIDIA_DRIVER_CAPABILITIES=utility COPY --from=build /go/src/volcano.sh/devices/volcano-vgpu-device-plugin /usr/bin/volcano-vgpu-device-plugin RUN mkdir -p /k8s-vgpu/lib/nvidia -COPY --from=build /go/src/volcano.sh/devices/lib/* /k8s-vgpu/lib/nvidia/ ENTRYPOINT ["volcano-vgpu-device-plugin"] diff --git a/lib/ld.so.preload b/lib/ld.so.preload deleted file mode 100644 index c6aef5926..000000000 --- a/lib/ld.so.preload +++ /dev/null @@ -1 +0,0 @@ -/usr/local/vgpu/libvgpu.so \ No newline at end of file diff --git a/lib/libvgpu.so b/lib/libvgpu.so deleted file mode 100755 index c6c3e24b5..000000000 Binary files a/lib/libvgpu.so and /dev/null differ diff --git a/pkg/plugin/vgpu/plugin.go b/pkg/plugin/vgpu/plugin.go index 52298de08..dbe3b6ab5 100644 --- a/pkg/plugin/vgpu/plugin.go +++ b/pkg/plugin/vgpu/plugin.go @@ -26,7 +26,6 @@ import ( "strings" "time" - "k8s.io/apimachinery/pkg/util/uuid" "k8s.io/klog/v2" "volcano.sh/k8s-device-plugin/pkg/lock" "volcano.sh/k8s-device-plugin/pkg/plugin/vgpu/config" @@ -310,7 +309,7 @@ func (m *NvidiaDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.Alloc } for idx := range reqs.ContainerRequests { - currentCtr, devreq, err := util.GetNextDeviceRequest(util.NvidiaGPUDevice, *current) + _, devreq, err := util.GetNextDeviceRequest(util.NvidiaGPUDevice, *current) klog.Infoln("deviceAllocateFromAnnotation=", devreq) if err != nil { klog.Errorln("get device from annotation failed", err.Error()) @@ -342,29 +341,6 @@ func (m *NvidiaDevicePlugin) Allocate(ctx context.Context, reqs *pluginapi.Alloc response.Envs["NVIDIA_VISIBLE_DEVICES"] = dev.UUID } } - response.Envs["CUDA_DEVICE_MEMORY_SHARED_CACHE"] = fmt.Sprintf("/tmp/vgpu/%v.cache", uuid.NewUUID()) - - cacheFileHostDirectory := "/tmp/vgpu/containers/" + string(current.UID) + "_" + currentCtr.Name - os.MkdirAll(cacheFileHostDirectory, 0777) - os.Chmod(cacheFileHostDirectory, 0777) - os.MkdirAll("/tmp/vgpulock", 0777) - os.Chmod("/tmp/vgpulock", 0777) - hostHookPath := os.Getenv("HOOK_PATH") - response.Mounts = append(response.Mounts, - &pluginapi.Mount{ContainerPath: "/usr/local/vgpu/libvgpu.so", - HostPath: hostHookPath + "/libvgpu.so", - ReadOnly: true}, - &pluginapi.Mount{ContainerPath: "/etc/ld.so.preload", - HostPath: hostHookPath + "/ld.so.preload", - ReadOnly: true}, - &pluginapi.Mount{ContainerPath: "/tmp/vgpu", - HostPath: cacheFileHostDirectory, - ReadOnly: false}, - &pluginapi.Mount{ContainerPath: "/tmp/vgpulock", - HostPath: "/tmp/vgpulock", - ReadOnly: false}, - ) - responses.ContainerResponses = append(responses.ContainerResponses, &response) } klog.Infoln("Allocate Response", responses.ContainerResponses) util.PodAllocationTrySuccess(nodename, current)