Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

passthrough support in runv #680

@telala

Description

@telala

I am now working on a program that need to passthrough gpu in runv.
Following is my steps:

  1. add "-device", "vfio-pci,host=0000:08:00.0,id=gpu_0,bus=pci.0,addr=0xf" in amd_64.go
  2. start a runv container
  3. in the container run command: insmod nvidia.ko insmod nvidia-modeset.ko insmod nvidia-uvm.ko insmod nvidia-drm.ko
  4. I can get the following dmesg from the container:
    [ 222.610227] nvidia: loading out-of-tree module taints kernel.
    [ 222.610854] nvidia: module license 'NVIDIA' taints kernel.
    [ 222.611461] Disabling lock debugging due to kernel taint
    [ 222.625106] nvidia-nvlink: Nvlink Core is being initialized, major device number 240
    [ 222.656048] chenxg: load driver:nvidia
    [ 222.656435] chenxg: gpu driver loaded
    [ 222.656839] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 390.46 Fri Mar 16 22:24:50 PDT 2018 (using threaded interrupts)
    [ 233.260423] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 239
    [ 239.616160] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 390.46 Fri Mar 16 21:46:30 PDT 2018
    [ 246.169710] [drm] [nvidia-drm] [GPU ID 0x0000000f] Loading driver
    [ 246.170349] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:00:0f.0 on minor 0

I compared these logs with the host which have nvidia gpu installed they are exactly the same.

One issue I suspected is that I insmod the nvidia.ko in the container.
Maybe I should insmod nvidia.ko in the hyperstart. I tried to insmod nvidia.ko in the main function in hyperstart but there's no insmod command.
Then I copied the insmod command to the hyperstart and got another error:
/insmod: error while loading shared libraries: liblzma.so.5: cannot open shared object file: No such file or directory
Can you give me some advice? Thanks very much:)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions