From 2b5037bc07a90e3aed9054769b21e131c4b2a57c Mon Sep 17 00:00:00 2001 From: wangxiaopeng Date: Fri, 30 Oct 2015 08:31:32 -0400 Subject: [PATCH] Change the cuda install doc for rh Make it follow the otherpkgs.pkglist rule to add cuda and dkms --- .../advanced/gpu/nvidia/osimage/rhels.rst | 97 +++++++++++++++---- .../source/advanced/gpu/nvidia/repo/rhels.rst | 14 +-- 2 files changed, 86 insertions(+), 25 deletions(-) diff --git a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst index c109fddc0..582f9c8b4 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/rhels.rst @@ -24,12 +24,13 @@ cudafull #. Add the CUDA repo created in the previous step to the ``pkgdir`` attribute: :: - chdef -t osimage -o rhels7.2-ppc64le-install-cudafull -p pkgdir=/install/cuda-repo + chdef -t osimage -o rhels7.2-ppc64le-install-cudafull -p \ + pkgdir=/install/cuda-7.5/ppc64le/cuda-core,/install/cuda-7.5/ppc64le/cuda-deps #. Use the provided ``cudafull`` pkglist to install the CUDA packages: :: chdef -t osimage -o rhels7.2-ppc64le-install-cudafull \ - pkglist=/opt/xcat/share/xcat/instal/rh/cudafull.rhels7.ppc64le.pkglist + pkglist=/opt/xcat/share/xcat/install/rh/cudafull.rhels7.ppc64le.pkglist cudaruntime ^^^^^^^^^^^ @@ -42,23 +43,19 @@ cudaruntime #. Add the CUDA repo created in the previous step to the ``pkgdir`` attribute: :: - chdef -t osimage -o rhels7.2-ppc64le-install-cudaruntime -p pkgdir=/install/cuda-repo + chdef -t osimage -o rhels7.2-ppc64le-install-cudaruntime -p \ + pkgdir=/install/cuda-7.5/ppc64le/cuda-core,/install/cuda-7.5/ppc64le/cuda-deps #. Use the provided ``cudaruntime`` pkglist to install the CUDA packages: :: chdef -t osimage -o rhels7.2-ppc64le-install-cudaruntime \ - pkglist=/opt/xcat/share/xcat/instal/rh/cudaruntime.rhels7.ppc64le.pkglist + pkglist=/opt/xcat/share/xcat/instal/rh/cudaruntime.rhels7.ppc64le.pkglist Diskless images --------------- The following examples will create diskless images for ``cudafull`` and ``cudaruntime``. The osimage definitions will be created from the base ``rhels7.2-ppc64le-netboot-compute`` osimage. -xCAT provides a sample package list files for CUDA. You can find them at: - - * ``/opt/xcat/share/xcat/netboot/rh/cudafull.rhels7.ppc64le.otherpkgs.pkglist`` - * ``/opt/xcat/share/xcat/netboot/rh/cudaruntime.rhels7.ppc64le.otherpkgs.pkglist`` - **[diskless note]**: For diskless images, the requirement for rebooting the machine is not applicable because the images is loaded on each reboot. The install of the CUDA packages is required to be done in the ``otherpkglist`` **NOT** the ``pkglist``. cudafull @@ -70,14 +67,46 @@ cudafull | sed 's/netboot-compute:/netboot-cudafull:/' \ | mkdef -z -#. Add the CUDA repo created in the previous step to the ``otherpkgdir`` attribute: :: +#. Add the CUDA repo created in the previous step to the ``otherpkgdir`` attribute: - chdef -t osimage -o rhels7.2-ppc64le-netboot-cudafull otherpkgdir=/install/cuda-repo + The default ``otherpkgdir`` should be **/install/post/otherpkgs/rhels7.2/ppc64le** :: -#. Add the provided ``cudafull`` otherpkglist.pkglist file to install the CUDA packages: :: + # lsdef -t osimage rhels7.2-ppc64le-netboot-cudafull -i otherpkgdir + Object name: rhels7.2-ppc64le-netboot-compute + otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + Symbol link your CUDA repo which was created in the previous step to this ``otherpkgdir`` :: + + ln -s /install/cuda-7.5 /install/post/otherpkgs/rhels7.2/ppc64le/cuda-7.5 + +#. Generate a customized ``pkglist`` file to install the CUDA dependency packages: :: + + # copy a pkglist file from /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist + mkdir -p /install/custom/netboot/rh/ + cp /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist \ + /install/custom/netboot/rh/cudafull.rhels7.ppc64le.pkglist + + # append the dependency packages for cuda + vi /install/custom/netboot/rh/cudafull.rhels7.ppc64le.pkglist + ... + kernel-devel + gcc + pciutils + + # set the pkglist file to pkglist attribute chdef -t osimage -o rhels7.2-ppc64le-netboot-cudafull \ - otherpkglist=/opt/xcat/share/xcat/netboot/rh/cudafull.rhels7.ppc64le.otherpkgs.pkglist + pkglist=/install/custom/netboot/rh/cudafull.rhels7.ppc64le.pkglist + +#. Generate ``cudafull`` ``otherpkglist.pkglist`` file to install the CUDA packages: :: + + # generate the otherpkgs.pkglist for cudafull osimage + vi /install/custom/netboot/rh/cudafull.rhels7.ppc64le.otherpkgs.pkglist + cuda-7.5/ppc64le/cuda-deps/dkms + cuda-7.5/ppc64le/cuda-core/cuda + + # set the pkglist file to otherpkglist attribute + chdef -t osimage -o rhels7.2-ppc64le-netboot-cudafull \ + otherpkglist=/install/custom/netboot/rh/cudafull.rhels7.ppc64le.otherpkgs.pkglist #. Generate the image: :: @@ -94,16 +123,48 @@ cudaruntime lsdef -t osimage -z rhels7.2-ppc64le-netboot-compute \ | sed 's/netboot-compute:/netboot-cudaruntime:/' \ - | mkdef -z + | mkdef -z -#. Add the CUDA repo created in the previous step to the ``otherpkgdir`` attribute: :: +#. Add the CUDA repo created in the previous step to the ``otherpkgdir`` attribute: - chdef -t osimage -o rhels7.2-ppc64le-netboot-cudaruntime otherpkgdir=/install/cuda-repo + The default ``otherpkgdir`` should be **/install/post/otherpkgs/rhels7.2/ppc64le** :: -#. Add the provided ``cudaruntime`` otherpkglist.pkglist file to install the CUDA packages: :: + # lsdef -t osimage rhels7.2-ppc64le-netboot-cudaruntime -i otherpkgdir + Object name: rhels7.2-ppc64le-netboot-compute + otherpkgdir=/install/post/otherpkgs/rhels7.2/ppc64le + Symbol link your CUDA repo which was created in the previous step to this ``otherpkgdir`` :: + + ln -s /install/cuda-7.5 /install/post/otherpkgs/rhels7.2/ppc64le/cuda-7.5 + +#. Generate a customized ``pkglist`` file to install the CUDA dependency packages: :: + + # copy a pkglist file from /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist + mkdir -p /install/custom/netboot/rh/ + cp /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist \ + /install/custom/netboot/rh/cudaruntime.rhels7.ppc64le.pkglist + + # append the dependency packages for cuda + vi /install/custom/netboot/rh/cudaruntime.rhels7.ppc64le.pkglist + ... + kernel-devel + gcc + pciutils + + # set the pkglist file to pkglist attribute chdef -t osimage -o rhels7.2-ppc64le-netboot-cudaruntime \ - otherpkglist=/opt/xcat/share/xcat/netboot/rh/cudaruntime.rhels7.ppc64le.otherpkgs.pkglist + pkglist=/install/custom/netboot/rh/cudaruntime.rhels7.ppc64le.pkglist + +#. Generate ``cudaruntime`` ``otherpkglist.pkglist`` file to install the CUDA packages: :: + + # generate the otherpkgs.pkglist for cudaruntime osimage + vi /install/custom/netboot/rh/cudaruntime.rhels7.ppc64le.otherpkgs.pkglist + cuda-7.5/ppc64le/cuda-deps/dkms + cuda-7.5/ppc64le/cuda-core/cuda-runtime-7-5 + + # set the pkglist file to otherpkglist attribute + chdef -t osimage -o rhels7.2-ppc64le-netboot-cudaruntime \ + otherpkglist=/install/custom/netboot/rh/cudaruntime.rhels7.ppc64le.otherpkgs.pkglist #. Generate the image: :: diff --git a/docs/source/advanced/gpu/nvidia/repo/rhels.rst b/docs/source/advanced/gpu/nvidia/repo/rhels.rst index 2eb451af9..7cedc2701 100644 --- a/docs/source/advanced/gpu/nvidia/repo/rhels.rst +++ b/docs/source/advanced/gpu/nvidia/repo/rhels.rst @@ -10,22 +10,22 @@ RHEL 7.2 LE cd /tmp/cuda rpm2cpio /root/cuda-repo-rhel7-7-5-local-7.5-18.ppc64le.rpm | cpio -i -d - # Create the repo directory under xCAT /install dir - mkdir -p /install/cuda-repo/ppc64le - cp -r /tmp/cuda/var/cuda-repo-7-5-local /install/cuda-repo/ppc64le/ + # Create the repo directory under xCAT /install dir for cuda 7.5 + mkdir -p /install/cuda-7.5/ppc64le/cuda-core + cp -r /tmp/cuda/var/cuda-repo-7-5-local/* /install/cuda-7.5/ppc64le/cuda-core # Create the yum repo files - createrepo /install/cuda-repo/ppc64le + createrepo /install/cuda-7.5/ppc64le/cuda-core #. The NVIDIA CUDA Toolkit contains rpms that have dependencies on other external packages (such as ``DKMS``). These are provided by EPEL. It's up to the system administrator to obtain the dependency packages and add those to the ``cuda-deps`` directory: :: - mkdir -p /install/cuda-repo/cuda-deps - cd /install/cuda-repo/cuda-deps + mkdir -p /install/cuda-7.5/ppc64le/cuda-deps + cd /install/cuda-7.5/ppc64le/cuda-deps # Copy the DKMS rpm to this directory ls dkms-2.2.0.3-30.git.7c3e7c5.el7.noarch.rpm # Execute createrepo in this directory - createrepo . + createrepo /install/cuda-7.5/ppc64le/cuda-deps