Stack not working with Ansible

I’m trying to convert the follow script into Ansiable

LAMBDA_REPO=$(mktemp) && \
wget -O${LAMBDA_REPO} && \
sudo dpkg -i ${LAMBDA_REPO} && rm -f ${LAMBDA_REPO} && \
sudo apt-get update && \
sudo apt-get --yes upgrade && \
echo "cudnn cudnn/license_preseed select ACCEPT" | sudo debconf-set-selections && \
sudo apt-get install --yes --no-install-recommends lambda-server && \
sudo apt-get install --yes --no-install-recommends nvidia-450 libcuda1-450 nvidia-opencl-icd-450 && \
sudo apt-get install --yes --no-install-recommends lambda-stack-cuda

and here is my lastest attempt which is breaking with the error No package matching 'libcuda1-450' is available?

- name: Install lambda stack repo

- name: Update and upgrade apt packages
    upgrade: "yes"
    update_cache: "yes"

- name: apt-get dist-upgrade
    upgrade: dist

- name: Pre-agree to the CUDA license stuff
  shell: echo "cudnn cudnn/license_preseed select ACCEPT" | debconf-set-selections

- name: Install the Lambda Labs CUDA drivers
    install_recommends: no
      # - lambda-server
      - lambda-stack-cuda
      - nvidia-driver-450
      - libcuda1-450
      - nvidia-opencl-icd-450
    - Reboot the machine

I’ve checked that the package repo is installed

grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/*

which gives me

/etc/apt/sources.list.d/lambda-repository.list:deb focal main
/etc/apt/sources.list.d/lambda-repository.list:# deb-src focal main

and somehow lambda-stack-cuda gets installed (or at least doesn’t err). What am i doing wrong here? Has anyone else got this going with Ansible?

This is a clean install of Ubuntu 20.04 on a quad lambda server


Ahhh! I’ve stopped using this stack and i’m using the Nvidia Ansible role nvidia.nvidia_driver

1 Like