Hi everyone! I've had some success setting up my ...
# ask-metaflow
i
Hi everyone! I've had some success setting up my cloud/onprem hybrid multicluster metaflow, but I'm hitting one last thing that seems it should be easy. If I do
docker run -it --rm myimage:latest /usr/bin/nvidia-smi
I get
/usr/bin/nvidia-smi not found
. But, if I run
docker run -it --rm --gpu all myimage:latest /usr/bin/nvidia-smi
I get the proper output. When I run my nvidia-smi from within the step below, I get the
/usr/bin/nvidia-smi no found
message.... how do I influence metaflow to pass the
--gpu
parameter?
Copy code
@kubernetes(
        image="myimage:latest",
        gpu=1,
        tolerations=[{"key": "<http://node-role.kubernetes.io/control-plane|node-role.kubernetes.io/control-plane>", "operator": "Exists", "effect": "NoSchedule"}],
    )
    @resources(gpu=1)
    @step
    def nvidia_smi(self):
        """Make sure that we can run nvidia-smi."""
        subprocess.run(["/usr/bin/nvidia-smi", "-q"])
        self.next(self.end)
✅ 1
a
how is the kubernetes cluster setup? usually we rely on
nvidia-device-plugin-for-gpu
to pass the
gpu
flag
i
I had followed the nvidia-device-plugin instructions, but it never would advertise the GPU's as available so I've added that extended resource manually using the kubectl proxy. Possibly there is an issue at that layer
I've not been able to find logs for it, but it seems to be running:
Ahh sometimes in asking you find the next step of troubleshooting!
hmm... the final step of container toolkit install is to run docker with --gpu all and verify it works... but that is working
Is there a way to to pass command line parameters to the docker command? It seems like all of this autodetection is overkill for our 2 nodes with GPUs [this page](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/1.16.0/docker-specialized.html) mentions setting an environment var
NVIDIA_VISIBLE_DEVICES
, but adding that to
@environment
didn't affect the outcome
Ran across a post that said "Just install nVidia Operator, it does this all for you" and found that to be true just now 🙂
👍 1
a
nice! did it work finally?
i
Yeah, just the install and its working perfectly
among us party 1
a
great!