Installation Guide Linux :: CUDA Toolkit Documentation

文章推薦指數: 80 %
投票人數:10人

Ubuntu CUDAToolkit v11.6.1 InstallationGuideLinux 1. Introduction 1.1. SystemRequirements 1.2. AboutThisDocument 2. Pre-installationActions 2.1. VerifyYouHaveaCUDA-CapableGPU 2.2. VerifyYouHaveaSupportedVersionofLinux 2.3. VerifytheSystemHasgccInstalled 2.4. VerifytheSystemhastheCorrectKernelHeadersandDevelopmentPackagesInstalled 2.5. InstallMLNX_OFED 2.6. ChooseanInstallationMethod 2.7. DownloadtheNVIDIACUDAToolkit 2.8. HandleConflictingInstallationMethods 3. PackageManagerInstallation 3.1. Overview 3.2. RHEL7/CentOS7 3.2.1. InstallingaPreviousNVIDIADriverBranchonRHEL7 3.3. RHEL8/CentOS8 3.4. Fedora 3.5. SLES 3.6. OpenSUSE 3.7. WSL 3.8. Ubuntu 3.9. Debian 3.10. AdditionalPackageManagerCapabilities 3.10.1. AvailablePackages 3.10.2. Optional32-bitPackagesforLinuxx86_64.deb/.rpm 3.10.3. PackageUpgrades 3.10.4. MetaPackages 4. DriverInstallation 5. PrecompiledStreams 5.1. PrecompiledStreamsSupportMatrix 5.2. ModularityProfiles 6. KickstartInstallation 6.1. RHEL8/CentOS8 7. RunfileInstallation 7.1. Overview 7.2. Installation 7.3. DisablingNouveau 7.3.1. Fedora 7.3.2. RHEL/CentOS 7.3.3. OpenSUSE 7.3.4. SLES 7.3.5. WSL 7.3.6. Ubuntu 7.3.7. Debian 7.4. DeviceNodeVerification 7.5. AdvancedOptions 7.6. Uninstallation 8. CondaInstallation 8.1. CondaOverview 8.2. Installation 8.3. Uninstallation 8.4. InstallingPreviousCUDAReleases 9. PipWheels 10. TarballandZipArchiveDeliverables 10.1. ParsingRedistribJSON 10.2. ImportingTarballsintoCMake 10.3. ImportingTarballsintoBazel 11. CUDACross-PlatformEnvironment 11.1. CUDACross-PlatformInstallation 11.2. CUDACross-PlatformSamples 12. Post-installationActions 12.1. MandatoryActions 12.1.1. EnvironmentSetup 12.1.2. POWER9Setup 12.2. RecommendedActions 12.2.1. InstallPersistenceDaemon 12.2.2. InstallWritableSamples 12.2.3. VerifytheInstallation 12.2.3.1. VerifytheDriverVersion 12.2.3.2. RunningtheBinaries 12.2.4. InstallNsightEclipsePlugins 12.3. OptionalActions 12.3.1. InstallThird-partyLibraries 12.3.2. InstalltheSourceCodeforcuda-gdb 12.3.3. SelecttheActiveVersionofCUDA 13. AdvancedSetup 14. FrequentlyAskedQuestions 15. AdditionalConsiderations 16. RemovingCUDAToolkitandDriver SearchResults InstallationGuideLinux (PDF) - v11.6.1 (older) - LastupdatedFebruary22,2022 - SendFeedback NVIDIACUDAInstallationGuideforLinux TheinstallationinstructionsfortheCUDAToolkitonLinux. 1. Introduction CUDA®isaparallelcomputingplatformandprogrammingmodelinventedbyNVIDIA®.Itenablesdramaticincreasesincomputingperformancebyharnessingthepowerofthegraphicsprocessingunit(GPU). CUDAwasdevelopedwithseveraldesigngoalsinmind: Provideasmallsetofextensionstostandardprogramminglanguages,likeC,thatenableastraightforwardimplementation ofparallelalgorithms.WithCUDAC/C++,programmerscanfocusonthetaskofparallelizationofthealgorithmsratherthan spendingtimeontheirimplementation. SupportheterogeneouscomputationwhereapplicationsuseboththeCPUandGPU.Serialportionsofapplicationsarerunon theCPU,andparallelportionsareoffloadedtotheGPU.Assuch,CUDAcanbeincrementallyappliedtoexistingapplications. TheCPUandGPUaretreatedasseparatedevicesthathavetheirownmemoryspaces.Thisconfigurationalsoallowssimultaneous computationontheCPUandGPUwithoutcontentionformemoryresources. CUDA-capableGPUshavehundredsofcoresthatcancollectivelyrunthousandsofcomputingthreads.Thesecoreshaveshared resourcesincludingaregisterfileandasharedmemory.Theon-chipsharedmemoryallowsparalleltasksrunningonthese corestosharedatawithoutsendingitoverthesystemmemorybus. ThisguidewillshowyouhowtoinstallandcheckthecorrectoperationoftheCUDAdevelopmenttools. 1.1. SystemRequirements TouseCUDAonyoursystem,youwillneedthefollowinginstalled: CUDA-capableGPU AsupportedversionofLinuxwithagcccompilerandtoolchain NVIDIACUDAToolkit(availableathttps://developer.nvidia.com/cuda-downloads) TheCUDAdevelopmentenvironmentreliesontightintegrationwiththehostdevelopment environment,includingthehostcompilerandCruntimelibraries,andisthereforeonly supportedondistributionversionsthathavebeenqualifiedforthisCUDAToolkitrelease. ThefollowingtableliststhesupportedLinuxdistributions.Pleasereviewthefootnotesassociated withthetable. Table1.NativeLinuxDistributionSupportinCUDA11.6 Distribution Kernel1 DefaultGCC GLIBC GCC2,3 ICC3 NVHPC3 XLC3 CLANG ArmC/C++ x86_64 RHEL8.y(y<=5) 4.18.0-348 8.5.0 2.28 11 2021 21.7 NO 12 NO CentOS8.y(y<=5) 4.18.0-348 8.5.0 2.28 RHEL7.y(y<=9) 3.10.0-1160 6.x 2.17 CentOS7.y(y<=9) 3.10.0-1160 6.x 2.17 OpenSUSELeap15.y(y<=3) 5.3.18-57 7.5.0 2.31 SUSESLES15.y(y<=3) 5.3.18-57 7.5.0 2.31 Ubuntu20.04.z(z<=3) 5.11.0-27 9.3.0 2.31 Ubuntu18.04.z(z<=6) 5.4.0-89 7.5.0 2.27 Debian11.2 5.10.0-10 10.2.1 2.31 Fedora35 5.14.10 11.2.1 2.34 Arm64sbsa RHEL8.y(y<=5) 4.18.0-348 8.5.0 2.28 11 NO 21.9 NO 12 21.0 SUSESLES15.y(y<=3) 5.3.18-57 7.5.0 2.31 Ubuntu20.04.z(z<=3) 5.4.0-86 9.3.0 2.31 Arm64Jetson Ubuntu18.04.z(z<=6) 4.9.253 7.5.0 2.27 10.2 NO 21.7 16.1.x 12 NO POWER9 RHEL8.y(y<=5) 4.18.0-348 8.5.0 2.28 11 NO 21.9 16.1.x 12 NO (1)ThefollowingnotesapplytothekernelversionssupportedbyCUDA: ForspecifickernelversionssupportedonRedHatEnterpriseLinux(RHEL),visithttps://access.redhat.com/articles/3078. ForalistofkernelversionsincludingthereleasedatesforSUSELinuxEnterprise Server(SLES)isavailableathttps://wiki.microfocus.com/index.php/SUSE/SLES/Kernel_versions. ForUbuntuLTSonx86-64,theServerLTSkernel(e.g.4.15.xfor18.04)issupported inCUDA11.6.Visithttps://wiki.ubuntu.com/Kernel/Supportfor moreinformation. (2)NotethatstartingwithCUDA11.0,theminimumrecommendedGCCcompilerisatleastGCC 6duetoC++11requirementsinCUDAlibrariese.g.cuFFTandCUB.Ondistributionssuchas RHEL7orCentOS7thatmayuseanolderGCCtoolchainbydefault,itisrecommendedtousea newerGCCtoolchainwithCUDA11.0.NewerGCCtoolchainsareavailablewiththeRedHatDeveloperToolset.Forplatformsthatshipacompiler versionolderthanGCC6bydefault,linkingtostaticcuBLASandcuDNNusingthedefault compilerisnotsupported. (3)Minorversionsofthefollowingcompilerslisted:ofGCC,ICC,NVHPCandXLC,ashost compilersfornvccaresupported. 1.2. AboutThisDocument ThisdocumentisintendedforreadersfamiliarwiththeLinuxenvironmentandthecompilationofCprogramsfromthecommand line.YoudonotneedpreviousexperiencewithCUDAorexperiencewithparallelcomputation.Note:Thisguidecoversinstallation onlyonsystemswithXWindowsinstalled. Note:Manycommandsinthisdocumentmightrequiresuperuserprivileges.OnmostdistributionsofLinux,thiswillrequireyoutologinasroot.Forsystemsthathaveenabledthesudo package,usethesudoprefixforallnecessarycommands. 2. Pre-installationActions SomeactionsmustbetakenbeforetheCUDAToolkitandDrivercanbeinstalledonLinux: VerifythesystemhasaCUDA-capableGPU. VerifythesystemisrunningasupportedversionofLinux. Verifythesystemhasgccinstalled. Verifythesystemhasthecorrectkernelheadersanddevelopmentpackagesinstalled. DownloadtheNVIDIACUDAToolkit. Handleconflictinginstallationmethods. Note:Youcanoverridetheinstall-timeprerequisitechecksbyrunningtheinstallerwiththe -overrideflag.Rememberthattheprerequisiteswillstillberequiredtouse theNVIDIACUDAToolkit. 2.1. VerifyYouHaveaCUDA-CapableGPU ToverifythatyourGPUisCUDA-capable,gotoyourdistribution'sequivalentofSystemProperties,or,fromthecommandline, enter: lspci|grep-invidiaIfyoudonotseeanysettings,updatethePCIhardwaredatabasethatLinuxmaintainsbyenteringupdate-pciids(generallyfoundin/sbin)atthecommandlineandrerunthepreviouslspcicommand. IfyourgraphicscardisfromNVIDIAanditislistedinhttps://developer.nvidia.com/cuda-gpus,yourGPUisCUDA-capable. TheReleaseNotesfortheCUDAToolkitalsocontainalistofsupportedproducts. 2.2. VerifyYouHaveaSupportedVersionofLinux TheCUDADevelopmentToolsareonlysupportedonsomespecificdistributionsofLinux.ThesearelistedintheCUDAToolkit releasenotes. Todeterminewhichdistributionandreleasenumberyou'rerunning,typethefollowingatthecommandline:uname-m&&cat/etc/*releaseYoushouldseeoutputsimilartothefollowing,modifiedforyourparticularsystem:x86_64 RedHatEnterpriseLinuxWorkstationrelease6.0(Santiago)Thex86_64lineindicatesyouarerunningona64-bitsystem.Theremaindergivesinformationaboutyourdistribution. 2.3. VerifytheSystemHasgccInstalled ThegcccompilerisrequiredfordevelopmentusingtheCUDAToolkit.ItisnotrequiredforrunningCUDAapplications.Itisgenerally installedaspartoftheLinuxinstallation,andinmostcasestheversionofgccinstalledwithasupportedversionofLinux willworkcorrectly. Toverifytheversionofgccinstalledonyoursystem,typethefollowingonthecommandline:gcc--versionIfanerrormessagedisplays,youneedtoinstallthedevelopmenttoolsfromyourLinuxdistributionorobtainaversionofgccanditsaccompanyingtoolchainfromtheWeb. 2.4. VerifytheSystemhastheCorrectKernelHeadersandDevelopmentPackagesInstalled TheCUDADriverrequiresthatthekernelheadersanddevelopmentpackagesfortherunningversionofthekernelbeinstalled atthetimeofthedriverinstallation,aswellwheneverthedriverisrebuilt.Forexample,ifyoursystemisrunningkernel version3.17.4-301,the3.17.4-301kernelheadersanddevelopmentpackagesmustalsobeinstalled. WhiletheRunfileinstallationperformsnopackagevalidation,theRPMandDebinstallationsofthedriverwillmakeanattempt toinstallthekernelheaderanddevelopmentpackagesifnoversionofthesepackagesiscurrentlyinstalled.However,it willinstallthelatestversionofthesepackages,whichmayormaynotmatchtheversionofthekernelyoursystemisusing. Therefore,itisbesttomanuallyensurethecorrectversionofthekernelheadersanddevelopmentpackagesareinstalled priortoinstallingtheCUDADrivers,aswellaswheneveryouchangethekernelversion. Theversionofthekernelyoursystemisrunningcanbefoundbyrunningthefollowing command:uname-rThisistheversionofthekernelheadersand developmentpackagesthatmustbeinstalledpriortoinstallingtheCUDADrivers.This commandwillbeusedmultipletimesbelowtospecifytheversionofthepackagesto install.Notethatbelowarethecommon-casescenariosforkernelusage.Moreadvanced cases,suchascustomkernelbranches,shouldensurethattheirkernelheadersand sourcesmatchthekernelbuildtheyarerunning. Note: Ifyouperformasystemupdatewhichchangestheversionofthelinuxkernelbeingused,makesuretorerunthecommandsbelow toensureyouhavethecorrectkernelheadersandkerneldevelopmentpackagesinstalled.Otherwise,theCUDADriverwillfail toworkwiththenewkernel. RHEL7/CentOS7 Thekernelheadersanddevelopmentpackagesforthecurrentlyrunningkernelcanbe installedwith: sudoyuminstallkernel-devel-$(uname-r)kernel-headers-$(uname-r) Fedora/RHEL8/CentOS8 Thekernelheadersanddevelopmentpackagesforthecurrentlyrunningkernelcanbe installedwith: sudodnfinstallkernel-devel-$(uname-r)kernel-headers-$(uname-r)If matchingkernel-headersandkernel-develpackagesarenotavailableforthe currentlyrunningkernelversion,youmayneedtousethepreviouslyshippedversion ofthesepackages.Seehttps://bugzilla.redhat.com/show_bug.cgi?id=1986132for moreinformation. OpenSUSE/SLES Thekerneldevelopmentpackagesforthecurrently runningkernelcanbeinstalledwith: sudozypperinstall-ykernel--devel=Toruntheabovecommand,youwillneedthevariantandversionofthecurrentlyrunningkernel. Usetheoutputoftheunamecommandtodeterminethecurrently runningkernel'svariantandversion: $uname-r 3.16.6-2-defaultIntheaboveexample,the variantisdefaultandversionis3.16.6-2. Thekerneldevelopmentpackagesforthedefaultkernelvariantcanbeinstalledwith: sudozypperinstall-ykernel-default-devel=$(uname-r|sed's/\-default//') WSLThissectiondoesnotneedtobeperformedforWSL. Ubuntu Thekernelheadersanddevelopmentpackagesforthecurrentlyrunningkernelcanbe installedwith: sudoapt-getinstalllinux-headers-$(uname-r) 2.5. InstallMLNX_OFED IfyouintendtouseGPUDirectStorage(GDS),youmustinstalltheCUDApackage andMLNX_OFEDpackage. GDSpackagescanbeinstalledusingtheCUDApackagingguide.Followtheinstructionsin MLNX_OFEDRequirementsandInstallation. GDSissupportedintwodifferentmodes:GDS(default/fullperfmode)andCompatibility mode.Installationinstructionsforthemdifferslightly.Compatibilitymodeistheonly modethatissupportedoncertaindistributionsduetosoftwaredependency limitations. FullGDSsupportisrestrictedtothefollowingLinuxdistros: Ubuntu18.04,20.04 RHEL8.3,RHEL8.4 2.6. ChooseanInstallationMethod TheCUDAToolkitcanbeinstalledusingeitheroftwodifferentinstallationmechanisms:distribution-specificpackages(RPM andDebpackages),oradistribution-independentpackage(runfilepackages). Thedistribution-independentpackagehastheadvantageofworkingacrossawidersetof Linuxdistributions,butdoesnotupdatethedistribution'snativepackagemanagement system.Thedistribution-specificpackagesinterfacewiththedistribution'snative packagemanagementsystem.Itisrecommendedtousethedistribution-specificpackages, wherepossible. Note: Standaloneinstallersarenotprovidedforarchitecturesotherthanthex86_64release.Forbothnativeaswellascrossdevelopment, thetoolkitmustbeinstalledusingthedistribution-specificinstaller.SeetheCUDACross-PlatformInstallationsectionformoredetails. 2.7. DownloadtheNVIDIACUDAToolkit TheNVIDIACUDAToolkitisavailableathttps://developer.nvidia.com/cuda-downloads. ChoosetheplatformyouareusinganddownloadtheNVIDIACUDAToolkit. TheCUDAToolkitcontainstheCUDAdriverandtoolsneededtocreate,buildandruna CUDAapplicationaswellaslibraries,headerfiles,andotherresources. DownloadVerification ThedownloadcanbeverifiedbycomparingtheMD5checksumpostedathttps://developer.download.nvidia.com/compute/cuda/11.6.1/docs/sidebar/md5sum.txtwiththatofthedownloadedfile.Ifeitherofthechecksumsdiffer,thedownloadedfileiscorruptandneedstobedownloaded again. TocalculatetheMD5checksumofthedownloadedfile,runthefollowing: md5sum 2.8. HandleConflictingInstallationMethods BeforeinstallingCUDA,anypreviousinstallationsthatcouldconflictshouldbe uninstalled.ThiswillnotaffectsystemswhichhavenothadCUDAinstalledpreviously, orsystemswheretheinstallationmethodhasbeenpreserved(RPM/Debvs.Runfile).See thefollowingchartsforspecifics. Table2.CUDAToolkitInstallationCompatibilityMatrix   InstalledToolkitVersion==X.Y InstalledToolkitVersion!=X.Y RPM/Deb run RPM/Deb run InstallingToolkitVersionX.Y RPM/Deb NoAction UninstallRun NoAction NoAction run UninstallRPM/Deb UninstallRun NoAction NoAction Table3.NVIDIADriverInstallationCompatibilityMatrix   InstalledDriverVersion==X.Y InstalledDriverVersion!=X.Y RPM/Deb run RPM/Deb run InstallingDriverVersionX.Y RPM/Deb NoAction UninstallRun NoAction UninstallRun run UninstallRPM/Deb NoAction UninstallRPM/Deb NoAction UsethefollowingcommandtouninstallaToolkitrunfileinstallation:sudo/usr/local/cuda-X.Y/bin/cuda-uninstallerUsethefollowing commandtouninstallaDriverrunfileinstallation: sudo/usr/bin/nvidia-uninstallUsethefollowingcommandsto uninstallanRPM/Debinstallation: sudodnfremove#RHEL8/CentOS8sudoyumremove#RHEL7/CentOS7sudodnfremove#Fedorasudozypperremove#OpenSUSE/SLESsudoapt-get--purgeremove#Ubuntu 3. PackageManagerInstallation BasicinstructionscanbefoundintheQuickStartGuide.Readonformoredetailedinstructions. 3.1. Overview ThePackageManagerinstallationinterfaceswithyoursystem'spackagemanagementsystem.When usingRPMorDeb,thedownloadedpackageisarepositorypackage.Suchapackageonly informsthepackagemanagerwheretofindtheactualinstallationpackages,butwillnot installthem. Ifthosepackagesareavailableinanonlinerepository,theywillbeautomaticallydownloadedin alaterstep.Otherwise,therepositorypackagealsoinstallsalocalrepository containingtheinstallationpackagesonthesystem.Whethertherepositoryisavailable onlineorinstalledlocally,theinstallationprocedureisidenticalandmadeofseveral steps. Distribution-specificinstructionsdetailhowtoinstallCUDA: RHEL7/CentOS7 RHEL8/CentOS8 Fedora SLES OpenSUSE WSL Ubuntu Debian Finally,somehelpfulpackagemanager capabilitiesaredetailed. Theseinstructionsarefornativedevelopmentonly.Forcross-platformdevelopment,seetheCUDACross-PlatformEnvironmentsection. Note:Optionalcomponentssuchasnvidia-fs, libnvidia_nscq,andfabricmanagerarenot installedbydefaultandwillhavetobeinstalledseparatelyasneeded. Note:Thepackagecuda-corehasbeendeprecatedinCUDA9.1.Pleaseuse cuda-compilerinstead. 3.2. RHEL7/CentOS7 Performthepre-installationactions. Satisfythird-partypackagedependency SatisfyDKMSdependency:TheNVIDIAdriverRPMpackagesdependonotherexternal packages,suchasDKMSandlibvdpau.Thosepackagesare onlyavailableonthird-partyrepositories,suchasEPEL.Anysuchthird-partyrepositoriesmust beaddedtothepackagemanagerrepositorydatabasebeforeinstalling theNVIDIAdriverRPMpackages,ormissingdependencieswillpreventthe installationfromproceeding. Toenable EPEL:yuminstallhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm Enableoptionalrepos: OnRHEL7Linuxonly,executethefollowingsteps toenableoptionalrepositories. Onx86_64workstation:subscription-managerrepos--enable=rhel-7-workstation-optional-rpms OnPOWER9system:subscription-managerrepos--enable=rhel-7-for-power-9-optional-rpms Onx86_64server: subscription-managerrepos--enable=rhel-7-server-optional-rpms Addresscustomxorg.conf,ifapplicable Thedriverreliesonanautomaticallygeneratedxorg.conffile at/etc/X11/xorg.conf.Ifacustom-built xorg.conffileispresent,thisfunctionalitywillbe disabledandthedrivermaynotwork.Youcantryremovingtheexisting xorg.conffile,oraddingthecontentsof /etc/X11/xorg.conf.d/00-nvidia.conftothe xorg.conffile.Thexorg.conffilewill mostlikelyneedmanualtweakingforsystemswithanon-trivialGPU configuration. Installrepositorymeta-data Wheninstallingusingthelocalrepo: sudorpm--installcuda-repo--..rpm Wheninstallingusingthenetworkrepo: sudoyum-config-manager--add-repohttps://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo CleanYumrepositorycachesudoyumcleanexpire-cache InstallCUDAsudoyuminstallnvidia-driver-latest-dkms sudoyuminstallcuda sudoyuminstallcuda-drivers Addlibcuda.sosymboliclink,ifnecessary Thelibcuda.solibraryisinstalledinthe/usr/lib{,64}/nvidia directory.Forpre-existingprojectswhichuselibcuda.so,itmaybeusefulto addasymboliclinkfromlibcuda.sointhe/usr/lib{,64} directory. Performthepost-installationactions. 3.2.1. InstallingaPreviousNVIDIADriverBranchonRHEL7 ToperformanetworkinstallofapreviousNVIDIAdriverbranchonRHEL7,usethecommands below: version={DRIVER_VERSION}; stream="latest-dkms"; list=("kmod-nvidia-$stream-$version") list+=("nvidia-driver-$stream-cuda-$version") list+=("nvidia-driver-$stream-cuda-libs-$version") list+=("nvidia-driver-$stream-devel-$version") list+=("nvidia-driver-$stream-$version") list+=("nvidia-driver-$stream-NVML-$version") list+=("nvidia-driver-$stream-NvFBCOpenGL-$version") list+=("nvidia-driver-$stream-libs-$version") list+=("nvidia-fabric-manager-$version") list+=("nvidia-libXNVCtrl-$version") list+=("nvidia-libXNVCtrl-devel-$version") list+=("nvidia-modprobe-$stream-$version") list+=("nvidia-persistenced-$stream-$version") list+=("nvidia-settings-$version") list+=("nvidia-xconfig-$stream-$version" sudoyuminstall${list[@]} sudoyuminstallcuda-drivers-fabricmanager-{DRIVER_BRANCH}WhereDRIVER_VERSIONisthefullversion,forexample,470.82.01,andDRIVER_BRANCH is,forexample,470. 3.3. RHEL8/CentOS8 Performthepre-installationactions. Satisfythird-partypackagedependency SatisfyDKMSdependency:TheNVIDIAdriverRPMpackagesdependon otherexternalpackages,suchasDKMSandlibvdpau. Thosepackagesareonlyavailableonthird-partyrepositories,suchas EPEL.Anysuchthird-partyrepositoriesmust beaddedtothepackagemanagerrepositorydatabasebeforeinstalling theNVIDIAdriverRPMpackages,ormissingdependencieswillpreventthe installationfromproceeding. Toenable EPEL:yuminstallhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm Enableoptionalrepos: OnRHEL8Linuxonly,execute thefollowingstepstoenableoptionalrepositories. Onx86_64systems:subscription-managerrepos--enable=rhel-8-for-x86_64-appstream-rpms subscription-managerrepos--enable=rhel-8-for-x86_64-baseos-rpms subscription-managerrepos--enable=codeready-builder-for-rhel-8-x86_64-rpms OnPOWER9systems: subscription-managerrepos--enable=rhel-8-for-ppc64le-appstream-rpms subscription-managerrepos--enable=rhel-8-for-ppc64le-baseos-rpms subscription-managerrepos--enable=codeready-builder-for-rhel-8-ppc64le-rpms Addresscustomxorg.conf,ifapplicableThedriverreliesonanautomaticallygeneratedxorg.conffile at/etc/X11/xorg.conf.Ifacustom-built xorg.conffileispresent,thisfunctionalitywillbe disabledandthedrivermaynotwork.Youcantryremovingtheexisting xorg.conffile,oraddingthecontentsof /etc/X11/xorg.conf.d/00-nvidia.conftothe xorg.conffile.Thexorg.conffilewill mostlikelyneedmanualtweakingforsystemswithanon-trivialGPU configuration. Installrepositorymeta-dataWheninstallingusingthelocalrepo: sudorpm--installcuda-repo--..rpm Wheninstallingusingthenetwork repo:sudodnfconfig-manager--add-repohttps://developer.download.nvidia.com/compute/cuda/repos/rhel8//cuda-rhel8.repo CleanYumrepositorycachesudoyumcleanexpire-cache ToincludeallGDS packages:sudodnfinstallnvidia-gds InstallCUDAsudodnfcleanexpire-cache sudodnfmoduleinstallnvidia-driver:latest-dkms sudodnfinstallcuda Addlibcuda.sosymboliclink,ifnecessaryThelibcuda.solibraryisinstalledinthe/usr/lib{,64}/nvidia directory.Forpre-existingprojectswhichuselibcuda.so,itmaybeusefulto addasymboliclinkfromlibcuda.sointhe/usr/lib{,64} directory. Performthepost-installationactions. 3.4. Fedora Performthepre-installationactions. Addresscustomxorg.conf,ifapplicableThedriverreliesonanautomaticallygeneratedxorg.conffile at/etc/X11/xorg.conf.Ifacustom-built xorg.conffileispresent,thisfunctionalitywillbe disabledandthedrivermaynotwork.Youcantryremovingtheexisting xorg.conffile,oraddingthecontentsof /etc/X11/xorg.conf.d/00-nvidia.conftothe xorg.conffile.Thexorg.conffilewill mostlikelyneedmanualtweakingforsystemswithanon-trivialGPU configuration. Installrepositorymeta-dataWheninstallingusingthelocalrepo: sudorpm--installcuda-repo-fedora33-.x86_64.rpm Wheninstallingusingthenetwork repo:sudodnfconfig-manager--add-repohttps://developer.download.nvidia.com/compute/cuda/repos/fedora33/x86_64/cuda-fedora33.repo CleanDNFrepositorycachesudodnfcleanexpire-cache InstallCUDAsudodnfmoduleinstallnvidia-driver:latest-dkms sudodnfinstallcudaThe CUDAdriverinstallationmayfailiftheRPMFusionnon-freerepositoryisenabled. Inthiscase,CUDAinstallationsshouldtemporarilydisabletheRPMFusionnon-free repository: sudodnf--disablerepo="rpmfusion-nonfree*"installcudaIt maybenecessarytorebuildthegrubconfigurationfiles,particularlyifyouusea non-defaultpartitionscheme.Ifso,thenrunthisbelowcommand,andrebootthe system: sudogrub2-mkconfig-o/boot/grub2/grub.cfgRemembertorebootthesystem. Addlibcuda.sosymboliclink,ifnecessaryThelibcuda.solibraryisinstalledinthe /usr/lib{,64}/nvidiadirectory.Forpre-existingprojects whichuselibcuda.so,itmaybeusefultoaddasymboliclink fromlibcuda.sointhe/usr/lib{,64} directory. Performthepost-installationactions. 3.5. SLES Performthepre-installationactions. OnSLES12SP4,installtheMesa-libgl-develLinuxpackagesbeforeproceeding.SeeMesa-libGL-devel. Installrepositorymeta-data Wheninstallingusingthelocalrepo: sudorpm--installcuda-repo-sles15-..rpm Wheninstallingusingthenetworkrepo: sudozypperaddrepohttps://developer.download.nvidia.com/compute/cuda/repos/sles15//cuda-sles15.repo RefreshZypperrepositorycachesudoSUSEConnect--productPackageHub/15/ sudozypperrefresh InstallCUDAsudozypperinstallcuda Addtheusertothevideogroupsudousermod-a-Gvideo InstallCUDASamplesGLdependenciesRefertoCUDACross-PlatformSamples. Performthepost-installationactions. 3.6. OpenSUSE Performthepre-installationactions. Installrepositorymeta-data Wheninstallingusingthelocalrepo: sudorpm--installcuda-repo-opensuse15-.x86_64.rpm Wheninstallingusingthenetworkrepo: sudozypperaddrepohttps://developer.download.nvidia.com/compute/cuda/repos/opensuse15/x86_64/cuda-opensuse15.repo RefreshZypperrepositorycache sudozypperrefresh InstallCUDAsudozypperinstallcuda Addtheusertothevideogroupsudousermod-a-Gvideo Performthepost-installationactions. 3.7. WSL TheseinstructionsmustbeusedifyouareinstallinginaWSLenvironment.Donot usetheUbuntuinstructionsinthiscase. Performthepre-installationactions. Installrepositorymeta-data Wheninstallingusingthelocalrepo: sudodpkg-icuda-repo-__x86_64.deb Wheninstallingusingthenetwork repo:sudoadd-apt-repository"debhttps://developer.download.nvidia.com/compute/cuda/repos//x86_64//" InstallingtheCUDApublicGPGkey Wheninstallingusingthelocalrepo: sudoapt-keyadd/var/cuda-repo-/7fa2af80.pub Wheninstallingusingthenetworkrepo: sudoapt-keyadv--fetch-keyshttps://developer.download.nvidia.com/compute/cuda/repos//x86_64/7fa2af80.pub PinfiletoprioritizeCUDA repository: wgethttps://developer.download.nvidia.com/compute/cuda/repos//x86_64/cuda-.pin sudomvcuda-.pin/etc/apt/preferences.d/cuda-repository-pin-600 UpdatetheAptrepositorycachesudoapt-getupdate InstallCUDAsudoapt-getinstallcuda Performthepost-installationactions. 3.8. Ubuntu Performthepre-installationactions. Installrepositorymeta-data sudodpkg-icuda-repo-__.deb InstalltheCUDApublicGPGkey Wheninstallingusingthelocalrepo: sudoapt-keyadd/var/cuda-repo--/7fa2af80.pub WheninstallingusingnetworkrepoonUbuntu20.04/18.04: sudoapt-keyadv--fetch-keyshttps://developer.download.nvidia.com/compute/cuda/repos///7fa2af80.pub WheninstallingusingnetworkrepoonUbuntu16.04: sudoapt-keyadv--fetch-keyshttp://developer.download.nvidia.com/compute/cuda/repos///7fa2af80.pub PinfiletoprioritizeCUDA repository: wgethttps://developer.download.nvidia.com/compute/cuda/repos///cuda-.pin sudomvcuda-.pin/etc/apt/preferences.d/cuda-repository-pin-600 UpdatetheAptrepositorycachesudoapt-getupdate InstallCUDANote:Thesetwocommandsmustbeexecutedseparately. sudoapt-getinstallcuda ToincludeallGDS packages:sudoapt-getinstallnvidia-gds Performthepost-installationactions. 3.9. Debian Performthepre-installation actions. Installrepositorymeta-data Wheninstallingusingthelocalrepo: sudodpkg-icuda-repo-debian10__x86_64.deb Wheninstallingusingthenetwork repo:sudoadd-apt-repository"debhttps://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64//" InstallingtheCUDApublicGPGkey Wheninstallingusingthelocalrepo: sudoapt-keyadd/var/cuda-repo-/7fa2af80.pub Wheninstallingusingthenetworkrepo: sudoapt-keyadv--fetch-keyshttps://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64/7fa2af80.pub Enablethecontrib repository:sudoadd-apt-repositorycontrib UpdatetheAptrepositorycache sudoapt-getupdateNote:IfyouareusingDebian10,youmayinsteadneedto run:sudoapt-get--allow-releaseinfo-changeupdate InstallCUDAsudoapt-get-yinstallcuda Performthepost-installationactions. 3.10. AdditionalPackageManagerCapabilities Belowaresomeadditionalcapabilitiesofthepackagemanagerthatuserscantakeadvantageof. 3.10.1. AvailablePackages Therecommendedinstallationpackageisthecudapackage.Thispackagewill installthefullsetofotherCUDApackagesrequiredfornative developmentandshouldcovermostscenarios. Thecudapackageinstallsalltheavailablepackagesfornativedevelopments. Thatincludesthecompiler,thedebugger,theprofiler,themath libraries,andsoon.Forx86_64patforms,thisalsoinclude NsightEclipseEditionandthevisualprofilers.Italso includestheNVIDIAdriverpackage. Onsupportedplatforms,thecuda-cross-aarch64and cuda-cross-ppc64elpackagesinstall allthepackagesrequiredforcross-platformdevelopmentto ARMv8andPOWER8,respectively.Thelibrariesandheaderfiles ofthetargetarchitecture'sdisplaydriverpackagearealso installedtoenablethecrosscompilationofdriver applications.Thecuda-cross-packages donotinstallthenativedisplaydriver. Thepackagesinstalledbythepackagesabovecanalsobeinstalledindividuallybyspecifyingtheirnamesexplicitly. Thelistofavailablepackagesbecanobtainedwith: yum--disablerepo="*"--enablerepo="cuda*"listavailable#RedHatdnf--disablerepo="*"--enablerepo="cuda*"listavailable#Fedorazypperpackages-rcuda#OpenSUSE&SLEScat/var/lib/apt/lists/*cuda*Packages|grep"Package:"#Ubuntu 3.10.2. Optional32-bitPackagesforLinuxx86_64.deb/.rpm Thesepackagesprovide32-bitdriverlibrariesneededforthingssuchasSteam (populargameappstore/launcher),oldervideogames,andsomecompute applications. ForDebian11: sudodpkg--add-architecturei386 sudoapt-getupdate sudoapt-getinstalllibcuda1-i386nvidia-driver-libs-i386 ForUbuntu: sudodpkg--add-architecturei386 sudoapt-getupdate sudoapt-getinstalllibnvidia-compute-:i386libnvidia-decode-:i386\ libnvidia-encode-:i386libnvidia-extra-:i386libnvidia-fbc1-:i386\ libnvidia-gl-:i386 Whereisthedriverversion,forexample495. ForFedoraandRHEL8: sudodnfinstallnvidia-driver-cuda-libs.i686nvidia-driver-devel.i686\ nvidia-driver-libs.i686nvidia-driver-NvFBCOpenGL.i686nvidia-driver-NVML.i686 Note:Thereisnomodularityprofilesupport. ForopenSUSE/SLES: Noextrainstallationisrequired,thenvidia-glG05packagealready containsthe32-bitlibraries. 3.10.3. PackageUpgrades ThecudapackagepointstothelateststablereleaseoftheCUDAToolkit.Whena newversionisavailable,usethefollowing commandstoupgradethetoolkitanddriver: sudoyuminstallcuda#RHEL7sudodnfupgradecuda#Fedora/RHEL8sudozypperinstallcuda#OpenSUSE&SLESsudoapt-getinstallcuda#Ubuntu Thecuda-cross-packagescanalsobeupgradedinthesamemanner. Thecuda-driverspackagepointstothelatestdriverreleaseavailableintheCUDArepository. Whenanewversionisavailable,usethefollowingcommandstoupgradethedriver: sudoyuminstallnvidia-driver-latest-dkms#RHEL7sudoyuminstallcuda-drivers#RHEL7sudodnfmoduleupdatenvidia-driver:latest-dkms#RHEL8/Fedorasudozypperinstallcuda-driversnvidia-gfxG04-kmp-default#OpenSUSE&SLESsudoapt-getinstallcuda-drivers#UbuntuSomedesktopenvironments,suchasGNOMEorKDE,willdisplayanotificationalertwhennew packagesareavailable. Toavoidanyautomaticupgrade,andlockdownthetoolkitinstallationtotheX.Yrelease, installthecuda-X-Yor cuda-cross--X-Ypackage. Side-by-sideinstallationsaresupported.Forinstance,toinstallboththeX.YCUDAToolkitand theX.Y+1CUDAToolkit,installthe cuda-X.Yand cuda-X.Y+1packages. 3.10.4. MetaPackages MetapackagesareRPM/Deb/Condapackageswhichcontainno(orfew)filesbuthavemultiple dependencies.TheyareusedtoinstallmanyCUDApackageswhenyoumaynotknowthe detailsofthepackagesyouwant.Belowisthelistofmetapackages. Table4.MetaPackagesAvailableforCUDA11.6 MetaPackage Purpose cuda InstallsallCUDAToolkitandDriverpackages.Handlesupgradingtothenextversionofthecudapackagewhenit'sreleased. cuda-11-6 InstallsallCUDAToolkitandDriverpackages.Remainsatversion11.6untilanadditionalversionofCUDAisinstalled. cuda-toolkit-11-6 InstallsallCUDAToolkitpackagesrequiredtodevelopCUDAapplications.Doesnotincludethedriver. cuda-tools-11-6 InstallsallCUDAcommandlineandvisualtools. cuda-runtime-11-6 InstallsallCUDAToolkitpackagesrequiredtorunCUDAapplications,aswellastheDriverpackages. cuda-compiler-11-6 InstallsallCUDAcompilerpackages. cuda-libraries-11-6 InstallsallruntimeCUDALibrarypackages. cuda-libraries-dev-11-6 InstallsalldevelopmentCUDALibrarypackages. cuda-drivers InstallsallDriverpackages.HandlesupgradingtothenextversionoftheDriverpackageswhenthey'rereleased. 4. DriverInstallation Thissectionisforuserswhowanttoinstallaspecificdriverversion. ForDebianandUbuntu: sudoapt-getinstallcuda-drivers- Forexample:sudoapt-getinstallcuda-drivers-418For OpenSUSEandSLES: sudozypperinstallcuda-drivers-Forexample:sudozypperinstallcuda-drivers-450Thisallowsyoutogetthehighestversioninthespecifiedbranch. ForFedoraandRHEL8: sudodnfmoduleinstallnvidia-driver:/where profilebydefaultis"default"anddoesnotneedtobespecified. Exampledkmsstreams:450-dkmsorlatest-dkms Exampleprecompiledstreams:450orlatest Note:PrecompiledstreamsareonlysupportedonRHEL8x86_64. TouninstallorchangestreamsonFedoraandRHEL8: sudodnfremovenvidia-driver sudodnfmoduleresetnvidia-driver 5. PrecompiledStreams Precompiledstreamsofferanoptionalmethodofstreamliningtheinstallation process. Theadvantagesofprecompiledsreams: Precompiled:fasterbootupafterdriverand/orkernelupdates Pre-tested:kernelanddrivercombinationhasbeenvalidated Removesgccdependency:nocompilerinstallationrequired Removesdkmsdependency:enablingEPELrepositorynotrequired Removeskernel-develandkernel-headersdependencies:noblackscreenif matchingpackagesaremissing Whenusingprecompileddrivers,apluginforthednfpackagemanagerisenabledthat cleansupstale.kofiles.Topreventsystembreakages,theNVIDIAdnfpluginalso preventsupgradingtoakernelforwhichnoprecompileddriveryetexists.Thiscan delaytheapplicationofsecurityfixesbutensuresthatatestedkernelanddriver combinationisalwaysused.Awarningisdisplayedbydnfduringthat upgrade situation:NOTE:SkippingkernelinstallationsincenoNVIDIAdriverkernelmodulepackage kmod-nvidia-${driver}-${kernel}...couldbefound PackagingtemplatesandinstructionsareprovidedonGitHubtoallowyoutomaintainyour ownprecompiledkernelmodulepackagesforcustomkernelsandderivativeLinuxdistros: NVIDIA/yum-packaging-precompiled-kmod TousethenewdriverpackagesonRHEL8: First,ensurethattheRedHatrepositoriesare enabled:subscription-managerrepos--enable=rhel-8-for-x86_64-appstream-rpms subscription-managerrepos--enable=rhel-8-for-x86_64-baseos-rpms Chooseoneofthefouroptionsbelowdependingonthedesireddriver: latestalwaysupdatestothehighestversioned driver(precompiled): sudodnfmoduleinstallnvidia-driver:latest locksthedriverupdatestothespecified driverbranch(precompiled): sudodnfmoduleinstallnvidia-driver: Note:Replacewiththeappropriatedriver branchstreams,forexample455,450,440,or418. latest-dkmsalwaysupdatestothehighestversioneddriver (non-precompiled): sudodnfmoduleinstallnvidia-driver:latest-dkms Note:Thisisthedefaultstream. -dkmslocksthedriverupdatestothe specifieddriverbranch(non-precompiled): sudodnfmoduleinstallnvidia-driver:-dkms Note:Validstreamsinclude455-dkms, 450-dkms,440-dkms,and 418-dkms. 5.1. PrecompiledStreamsSupportMatrix ThistableshowthesupportedprecompiledandlegacyDKMSstreamsforeach driver. NVIDIADriver PrecompiledStream LegacyDKMSStream Highestversion latest latest-dkms Lockedat455.x 455 455-dkms Lockedat450.x 450 450-dkms Lockedat440.x 440 440-dkms Lockedat418.x 418 418-dkms 5.2. ModularityProfiles Modularityprofilesworkwithanysupportedmodularitystreamandallowfor additionalusecases.ThesemodularityprofilesareavailableonRHEL8andFedora. Table5.Listofnvidia-driverModuleProfiles Stream Profile UseCase Default /default Installsallthedriverpackagesinastream. Kickstart /ks PerformsunattendedLinuxOSinstallationusingaconfig file. NVSwitchFabric /fm Installsallthedriverpackagespluscomponentsrequiredfor bootstrappinganNVSwitchsystem(includingtheFabricManagerand NSCQtelemetry). Source /src Sourceheadersforcompilation(precompiledstreams only). For example:sudodnfmodulenvidia-driver:/default sudodnfmodulenvidia-driver:/ks sudodnfmodulenvidia-driver:/fm sudodnfmodulenvidia-driver:/src YoucaninstallmultiplemodularityprofilesusingBASHcurlybraceexpansion,for example:sudodnfmoduleinstallnvidia-driver:latest/{default,src} Seehttps://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streamsintheDeveloperBlogandhttps://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/precompiled/formoreinformation. 6. KickstartInstallation 6.1. RHEL8/CentOS8 EnabletheEPEL repository:repo--name=epel--baseurl=http://download.fedoraproject.org/pub/epel/8/Everything/x86_64/ EnabletheCUDA repository:repo--name=cuda-rhel8--baseurl=https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/ Inthepackagessectionoftheks.cfgfile,makesureyouareusingthe /ksprofileand:latest-dkmsstream:@nvidia-driver:latest-dkms/ks Performthepost-installationactions. 7. RunfileInstallation BasicinstructionscanbefoundintheQuickStartGuide.Readonformoredetailedinstructions. ThissectiondescribestheinstallationandconfigurationofCUDAwhenusingthestandaloneinstaller.Thestandaloneinstaller isa".run"fileandiscompletelyself-contained. 7.1. Overview TheRunfileinstallationinstallstheNVIDIADriverandCUDAToolkitviaaninteractive ncurses-basedinterface. Theinstallationstepsarelistedbelow.Distribution-specificinstructionsondisablingtheNouveaudriversaswellasstepsforverifyingdevicenodecreationarealsoprovided. Finally,advancedoptionsfortheinstalleranduninstallationstepsaredetailedbelow. TheRunfileinstallationdoesnotincludesupportforcross-platformdevelopment.Forcross-platformdevelopment,seethe CUDACross-PlatformEnvironmentsection. 7.2. Installation Performthepre-installationactions. DisabletheNouveaudrivers. Rebootintotextmode(runlevel3). Thiscanusuallybeaccomplishedbyaddingthenumber"3"totheendofthesystem'skernelbootparameters. SincetheNVIDIAdriversarenotyetinstalled,thetextterminalsmaynotdisplaycorrectly.Temporarilyadding"nomodeset" tothesystem'skernelbootparametersmayfixthisissue. Consultyoursystem'sbootloaderdocumentationforinformationonhowtomaketheabovebootparameterchanges. TherebootisrequiredtocompletelyunloadtheNouveaudriversandpreventthegraphicalinterfacefromloading.TheCUDA drivercannotbeinstalledwhiletheNouveaudriversareloadedorwhilethegraphicalinterfaceisactive. VerifythattheNouveaudriversarenotloaded. IftheNouveaudriversarestillloaded,consultyourdistribution'sdocumentationtoseeiffurtherstepsareneededtodisable Nouveau. Runtheinstallerandfollowtheon-screenprompts: sudoshcuda__linux.run Theinstallerwillpromptforthefollowing: EULAAcceptance CUDADriverinstallation CUDAToolkitinstallation,location,and/usr/local/cudasymboliclink Thedefaultinstallationlocationforthetoolkitis /usr/local/cuda-11.6: The/usr/local/cudasymboliclinkpointstothelocationwherethe CUDAToolkitwasinstalled.ThislinkallowsprojectstousethelatestCUDA Toolkitwithoutanyconfigurationfileupdate. Theinstallermustbeexecutedwithsufficientprivilegestoperformsomeactions. Whenthecurrentprivilegesareinsufficienttoperformanaction,theinstaller willaskfortheuser'spasswordtoattempttoinstallwithrootprivileges. Actionsthatcausetheinstallertoattempttoinstallwithrootprivilegesare: installingtheCUDADriver installingtheCUDAToolkittoalocationtheuserdoesnothave permissiontowriteto creatingthe/usr/local/cudasymboliclink Runningtheinstallerwithsudo,asshownabove,willgive permissiontoinstalltodirectoriesthatrequirerootpermissions.Directories andfilescreatedwhilerunningtheinstallerwithsudowillhaveroot ownership. Ifinstallingthedriver,theinstallerwillalsoaskiftheopenGLlibrariesshould beinstalled.IftheGPUusedfordisplayisnotanNVIDIAGPU,theNVIDIA openGLlibrariesshouldnotbeinstalled.Otherwise,theopenGLlibrariesused bythegraphicsdriverofthenon-NVIDIAGPUwillbeoverwrittenandtheGUI willnotwork.Ifperformingasilentinstallation,the --no-opengl-libsoptionshouldbeusedtopreventthe openGLlibrariesfrombeinginstalled.SeetheAdvancedOptionssectionformore details. IftheGPUusedfordisplayisanNVIDIAGPU,theXserverconfigurationfile, /etc/X11/xorg.conf,mayneedtobemodified.Insomecases, nvidia-xconfigcanbeusedtoautomaticallygeneratean xorg.conffilethatworksforthesystem.Fornon-standard systems,suchasthosewithmorethanoneGPU,itisrecommendedtomanually editthexorg.conffile.Consultthexorg.conf documentationformoreinformation. Note:InstallingMesamayoverwritethe/usr/lib/libGL.sothatwas previouslyinstalledbytheNVIDIAdriver,soareinstallationoftheNVIDIA drivermightberequiredafterinstallingtheselibraries. Rebootthesystemtoreloadthegraphicalinterface. Verifythedevicenodesarecreatedproperly. Performthepost-installationactions. 7.3. DisablingNouveau ToinstalltheDisplayDriver,theNouveaudriversmustfirstbedisabled.Eachdistributionof LinuxhasadifferentmethodfordisablingNouveau. TheNouveaudriversareloadedifthefollowingcommandprintsanything: lsmod|grepnouveau 7.3.1. Fedora Createafileat/usr/lib/modprobe.d/blacklist-nouveau.confwiththefollowingcontents: blacklistnouveau optionsnouveaumodeset=0 Regeneratethekernelinitramfs:sudodracut--force Runthefollowingcommand: sudogrub2-mkconfig-o/boot/grub2/grub.cfg Rebootthesystem. 7.3.2. RHEL/CentOS Createafileat/etc/modprobe.d/blacklist-nouveau.confwiththefollowingcontents: blacklistnouveau optionsnouveaumodeset=0 Regeneratethekernelinitramfs:sudodracut--force 7.3.3. OpenSUSE Createafileat/etc/modprobe.d/blacklist-nouveau.confwiththefollowingcontents: blacklistnouveau optionsnouveaumodeset=0 Regeneratethekernelinitrd:sudo/sbin/mkinitrd 7.3.4. SLES NoactionstodisableNouveauarerequiredasNouveauisnotinstalledonSLES. 7.3.5. WSL NoactionstodisableNouveauarerequiredasNouveauisnotinstalledonWSL. 7.3.6. Ubuntu Createafileat/etc/modprobe.d/blacklist-nouveau.confwiththefollowingcontents: blacklistnouveau optionsnouveaumodeset=0 Regeneratethekernelinitramfs:sudoupdate-initramfs-u 7.3.7. Debian Createafileat/etc/modprobe.d/blacklist-nouveau.confwiththefollowingcontents: blacklistnouveau optionsnouveaumodeset=0 Regeneratethekernelinitramfs:sudoupdate-initramfs-u 7.4. DeviceNodeVerification Checkthatthedevicefiles/dev/nvidia*existandhavethecorrect(0666)file permissions.ThesefilesareusedbytheCUDADrivertocommunicatewiththekernel-mode portionoftheNVIDIADriver.ApplicationsthatusetheNVIDIAdriver,suchasaCUDA applicationortheXserver(ifany),willnormallyautomaticallycreatethesefilesifthey aremissingusingthesetuidnvidia-modprobetoolthatisbundledwiththeNVIDIADriver.However,some systemsdisallowsetuidbinaries,soifthesefilesdonotexist,youcancreatethemmanually byusingastartupscriptsuchastheonebelow: #!/bin/bash /sbin/modprobenvidia if["$?"-eq0];then #CountthenumberofNVIDIAcontrollersfound. NVDEVS=`lspci|grep-iNVIDIA` N3D=`echo"$NVDEVS"|grep"3Dcontroller"|wc-l` NVGA=`echo"$NVDEVS"|grep"VGAcompatiblecontroller"|wc-l` N=`expr$N3D+$NVGA-1` foriin`seq0$N`;do mknod-m666/dev/nvidia$ic195$i done mknod-m666/dev/nvidiactlc195255 else exit1 fi /sbin/modprobenvidia-uvm if["$?"-eq0];then #Findoutthemajordevicenumberusedbythenvidia-uvmdriver D=`grepnvidia-uvm/proc/devices|awk'{print$1}'` mknod-m666/dev/nvidia-uvmc$D0 else exit1 fi 7.5. AdvancedOptions Action OptionsUsed Explanation SilentInstallation --silent Requiredforanysilentinstallation.Performsaninstallationwithno furtheruser-inputandminimalcommand-lineoutputbasedontheoptions providedbelow.Silentinstallationsareusefulforscriptingthe installationofCUDA.UsingthisoptionimpliesacceptanceoftheEULA. Thefollowingflagscanbeusedtocustomizetheactionstakenduring installation.Atleastoneof--driver, --uninstall,and--toolkitmustbe passedifrunningwithnon-rootpermissions. --driver InstalltheCUDADriver. --toolkit InstalltheCUDAToolkit. --toolkitpath= InstalltheCUDAToolkittothedirectory.Ifnotprovided,thedefaultpathof/usr/local/cuda-11.6isused. --defaultroot= Installlibrariestothedirectory.Iftheisnot provided,thenthedefaultpathofyourdistributionisused.Thisonly appliestothelibrariesinstalledoutsideoftheCUDAToolkit path. Extraction --extract= Extractstothethefollowing:thedriverrunfile,therawfilesofthetoolkit to. Thisisespeciallyusefulwhenonewantstoinstallthedriverusingoneormoreofthecommand-lineoptionsprovidedbythe driverinstallerwhicharenotexposedinthisinstaller. OverridingInstallationChecks --override Ignorescompiler,third-partylibrary,andtoolkitdetectioncheckswhich wouldpreventtheCUDAToolkitfrominstalling. NoOpenGLLibraries --no-opengl-libs PreventsthedriverinstallationfrominstallingNVIDIA'sGLlibraries.Usefulforsystemswherethedisplayisdrivenby anon-NVIDIAGPU.Insuchsystems,NVIDIA'sGLlibrariescouldpreventXfromloadingproperly. Nomanpages --no-man-page Donotinstallthemanpagesunder /usr/share/man. OverridingKernelSource --kernel-source-path= TellsthedriverinstallationtouseasthekernelsourcedirectorywhenbuildingtheNVIDIAkernelmodule.Required forsystemswherethekernelsourceisinstalledtoanon-standardlocation. Runningnvidia-xconfig --run-nvidia-xconfig Tellsthedriverinstallationtorunnvidia-xconfigtoupdatethesystemXconfigurationfilesothattheNVIDIAXdriver isused.Thepre-existingXconfigurationfilewillbebackedup. Nonvidia-drmkernelmodule --no-drm Donotinstallthenvidia-drmkernelmodule.Thisoptionshouldonlybeusedtoworkaroundfailurestobuildorinstallthe nvidia-drmkernelmoduleonsystemsthatdonotneedtheprovidedfeatures. CustomTemporaryDirectorySelection --tmpdir= Performsanytemporaryactionswithininsteadof /tmp.Usefulincaseswhere/tmp cannotbeused(doesn'texist,isfull,ismountedwith'noexec', etc.). ShowInstallerOptions --help Printsthelistofcommand-lineoptionstostdout. 7.6. Uninstallation TouninstalltheCUDAToolkit,runtheuninstallationscriptprovidedinthebindirectoryofthe toolkit.Bydefault,itislocatedin/usr/local/cuda-11.6/bin: sudo/usr/local/cuda-11.6/bin/cuda-uninstaller TouninstalltheNVIDIADriver,runnvidia-uninstall: sudo/usr/bin/nvidia-uninstallToenabletheNouveau drivers,removetheblacklistfilecreatedintheDisablingNouveausection,and regeneratethekernelinitramfs/initrdagainasdescribedinthatsection. 8. CondaInstallation ThissectiondescribestheinstallationandconfigurationofCUDAwhen usingtheCondainstaller. TheCondapackagesareavailableathttps://anaconda.org/nvidia. 8.1. CondaOverview TheCondainstallationinstallstheCUDAToolkit.Theinstallationstepsarelisted below. 8.2. Installation ToperformabasicinstallofallCUDAToolkitcomponentsusingConda,runthe followingcommand: condainstallcuda-cnvidia 8.3. Uninstallation TouninstalltheCUDAToolkitusingConda,runthefollowingcommand:condaremovecuda 8.4. InstallingPreviousCUDAReleases AllCondapackagesreleasedunderaspecificCUDAversionarelabeledwiththat releaseversion.Toinstallapreviousversion,includethatlabelinthe installcommandsuchas: condainstallcuda-cnvidia/label/cuda-11.3.0Note:SomeCUDAreleasesdonotmovetonewversionsofallinstallable components.Whenthisisthecasethesecomponentswillbemovedto thenewlabel,andyoumayneedtomodifytheinstallcommandto includebothlabelssuchas: condainstallcuda-cnvidia/label/cuda-11.3.0-cnvidia/label/cuda-11.3.1ThisexamplewillinstallallpackagesreleasedaspartofCUDA11.3.0. 9. PipWheels NVIDIAprovidesPythonWheelsforinstallingCUDAthroughpip,primarilyforusingCUDA withPython.Thesepackagesareintendedforruntimeuseanddonotcurrentlyinclude developertools(thesecanbeinstalledseparately). Pleasenotethatwiththisinstallationmethod,CUDAinstallationenvironmentismanaged viapipandadditionalcaremustbetakentosetupyourhostenvironmenttouseCUDA outsidethepipenvironment. Prerequisites ToinstallWheels,youmustfirstinstallthenvidia-pyindexpackage, whichisrequiredinordertosetupyourpipinstallationtofetchadditionalPython modulesfromtheNVIDIANGCPyPIrepo.IfyourpipandsetuptoolsPythonmodulesarenot up-to-date,thenusethefollowingcommandtoupgradethesePythonmodules.Ifthese Pythonmodulesareout-of-datethenthecommandswhichfollowlaterinthissectionmay fail.python3-mpipinstall--upgradesetuptoolspipwheelYou shouldnowbeabletoinstallthenvidia-pyindex module.python3-mpipinstallnvidia-pyindexIfyourprojectis usingarequirements.txtfile,thenyoucanaddthefollowinglineto yourrequirements.txtfileasanalternativetoinstallingthe nvidia-pyindex package:--extra-index-urlhttps://pypi.ngc.nvidia.comProcedure InstalltheCUDAruntimepackage: python3-mpipinstallnvidia-cuda-runtime-cu11 Optionally,installadditionalpackagesaslistedbelowusingthefollowing command:python3-mpipinstallnvidia- Metapackages Thefollowingmetapackageswillinstallthelatestversionofthenamedcomponenton LinuxfortheindicatedCUDAversion."cu11"shouldbereadas"cuda11". nvidia-cuda-runtime-cu11 nvidia-cuda-cupti-cu11 nvidia-cuda-nvcc-cu11 nvidia-nvml-dev-cu11 nvidia-cuda-nvrtc-cu11 nvidia-nvtx-cu11 nvidia-cuda-sanitizer-api-cu11 nvidia-cublas-cu11 nvidia-cufft-cu11 nvidia-curand-cu11 nvidia-cusolver-cu11 nvidia-cusparse-cu11 nvidia-npp-cu11 nvidia-nvjpeg-cu11 Thesemetapackagesinstallthefollowingpackages: nvidia-nvml-dev-cu114 nvidia-cuda-nvcc-cu114 nvidia-cuda-runtime-cu114 nvidia-cuda-cupti-cu114 nvidia-cublas-cu114 nvidia-cuda-sanitizer-api-cu114 nvidia-nvtx-cu114 nvidia-cuda-nvrtc-cu114 nvidia-npp-cu114 nvidia-cusparse-cu114 nvidia-cusolver-cu114 nvidia-curand-cu114 nvidia-cufft-cu114 nvidia-nvjpeg-cu114 10. TarballandZipArchiveDeliverables Inanefforttomeettheneedsofagrowingcustomerbaserequiring alternativeinstallerpackagingformats,aswellasameansofinputintocommunity CI/CDsystems,tarballandziparchivesforeachcomponent. Thesetarball andziparchivesareprovidedathttps://developer.download.nvidia.com/compute/cuda/redist/. These.tar.xzand.ziparchivesdonotreplaceexistingpackagessuchas.deb,.rpm, runfile,conda,etc.andarenotmeantforgeneralconsumption,astheyarenot installers.Howeverthisstandardizedapproachwillreplaceexisting.txzarchives. Foreachrelease,aJSONmanifestisprovidedsuchas redistrib_11.4.2.json,whichcorrespondstotheCUDA11.4.2releaselabel (CUDA11.4update2)whichincludesthereleasedate,thenameofeachcomponent, licensename,relativeURLforeachplatformandchecksums. PackagemaintainersareadvisedtochecktheprovidedLICENSEforeachcomponentpriorto redistribution.InstructionsfordevelopersusingCMakeandBazelbuildsystemsareprovidedinthenextsections. 10.1. ParsingRedistribJSON ThefollowingexampleofaJSONmanifestcontainskeysforeachcomponent:name, license,version,andaplatformarraywhichincludesrelative_path,sha256,md5,and size(bytes)foreacharchive. { "release_date":"2021-09-07", "cuda_cudart":{ "name":"CUDARuntime(cudart)", "license":"CUDAToolkit", "version":"11.4.108", "linux-x86_64":{ "relative_path":"cuda_cudart/linux-x86_64/cuda_cudart-linux-x86_64-11.4.108-archive.tar.xz", "sha256":"d08a1b731e5175aa3ae06a6d1c6b3059dd9ea13836d947018ea5e3ec2ca3d62b", "md5":"da198656b27a3559004c3b7f20e5d074", "size":"828300" }, "linux-ppc64le":{ "relative_path":"cuda_cudart/linux-ppc64le/cuda_cudart-linux-ppc64le-11.4.108-archive.tar.xz", "sha256":"831dffe062ae3ebda3d3c4010d0ee4e40a01fd5e6358098a87bb318ea7c79e0c", "md5":"ca73328e3f8e2bb5b1f2184c98c3a510", "size":"776840" }, "linux-sbsa":{ "relative_path":"cuda_cudart/linux-sbsa/cuda_cudart-linux-sbsa-11.4.108-archive.tar.xz", "sha256":"2ab9599bbaebdcf59add73d1f1a352ae619f8cb5ccec254093c98efd4c14553c", "md5":"aeb5c19661f06b6398741015ba368102", "size":"782372" }, "windows-x86_64":{ "relative_path":"cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-11.4.108-archive.zip", "sha256":"b59756c27658d1ea87a17c06d064d1336576431cd64da5d1790d909e455d06d3", "md5":"7f6837a46b78198402429a3760ab28fc", "size":"2897751" } } } AJSONschemaisprovidedathttps://developer.download.nvidia.com/compute/redist/redistrib-v2.schema.json. AsamplescriptthatparsestheseJSONmanifestsisavailableonGitHub: Downloadseacharchive ValidatesSHA256checksums Extractsarchives Flattensintoacollapseddirectorystructure 10.2. ImportingTarballsintoCMake TherecommendedmoduleforimportingthesetarballsintotheCMakebuildsystemisvia FindCUDAToolkit(3.17andnewer). Note:TheFindCUDAmoduleisdeprecated. Thepathtotheextractionlocationcanbespecifiedwiththe CUDAToolkit_ROOTenvironmentalvariable.Forexample CMakeLists.txtandcommands,seecmake/1_FindCUDAToolkit/. ForolderversionsofCMake,theExternalProject_Addmoduleisanalternativemethod. ForexampleCMakeLists.txtfileandcommands,seecmake/2_ExternalProject/. 10.3. ImportingTarballsintoBazel TherecommendedmethodofimportingthesetarballsintotheBazelbuildsystemisusing http_archiveandpkg_tar. Foranexample,seebazel/1_pkg_tar/. 11. CUDACross-PlatformEnvironment Cross-platformdevelopmentisonlysupportedonUbuntusystems,andisonlyprovidedviathe PackageManagerinstallationprocess. WerecommendselectingUbuntu18.04asyourcross-platformdevelopmentenvironment.This selectionhelpspreventhost/targetincompatibilities,suchas GCCorGLIBCversionmismatches. 11.1. CUDACross-PlatformInstallation SomeofthefollowingstepsmayhavealreadybeenperformedaspartofthenativeUbuntuinstallation.Suchstepscan safelybeskipped. Thesestepsshouldbeperformedonthex86_64hostsystem,ratherthanthetargetsystem.To installthenativeCUDAToolkitonthetargetsystem,refertothenativeUbuntuinstallationsection. Performthepre-installationactions. Installrepositorymeta-datapackagewith: sudodpkg-icuda-repo-cross-_all.debwhere indicatestheoperatingsystem, architecture,and/ortheversionofthepackage. UpdatetheAptrepositorycache: sudoapt-getupdate Installtheappropriatecross-platformCUDAToolkit: Foraarch64: sudoapt-getinstallcuda-cross-aarch64 ForQNX:sudoapt-getinstallcuda-cross-qnx Performthepost-installationactions. 11.2. CUDACross-PlatformSamples CUDASamplesarenowlocatedinhttps://github.com/nvidia/cuda-samples,whichincludesinstructionsforobtaining, building,andrunningthesamples. 12. Post-installationActions Thepost-installationactionsmustbemanuallyperformed.Theseactionsaresplitinto mandatory,recommended,andoptionalsections. 12.1. MandatoryActions SomeactionsmustbetakenaftertheinstallationbeforetheCUDAToolkitandDrivercan beused. 12.1.1. EnvironmentSetup ThePATHvariableneedstoincludeexport PATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}}.NsightComputehasmovedto /opt/nvidia/nsight-compute/onlyinrpm/debinstallationmethod. Whenusing.runinstalleritisstilllocatedunder /usr/local/cuda-11.6/. ToaddthispathtothePATHvariable: exportPATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}}Inaddition,whenusingtherunfileinstallationmethod,theLD_LIBRARY_PATHvariableneedstocontain/usr/local/cuda-11.6/lib64ona64-bitsystem,or/usr/local/cuda-11.6/libona32-bitsystem Tochangetheenvironmentvariablesfor64-bitoperatingsystems:exportLD_LIBRARY_PATH=/usr/local/cuda-11.6/lib64\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} Tochangetheenvironmentvariablesfor32-bitoperatingsystems:exportLD_LIBRARY_PATH=/usr/local/cuda-11.6/lib\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} Notethattheabovepathschangewhenusingacustominstallpathwiththerunfileinstallationmethod. 12.1.2. POWER9Setup BecauseoftheadditionofnewfeaturesspecifictotheNVIDIAPOWER9CUDAdriver,there aresomeadditionalsetuprequirementsinorderforthedrivertofunctionproperly. TheseadditionalstepsarenothandledbytheinstallationofCUDApackages,andfailure toensuretheseextrarequirementsaremetwillresultinanon-functionalCUDAdriver installation. TherearetwochangesthatneedtobemademanuallyafterinstallingtheNVIDIACUDA drivertoensureproperoperation: TheNVIDIAPersistenceDaemonshouldbeautomaticallystartedforPOWER9 installations.Checkthatitisrunningwiththefollowingcommand: systemctlstatusnvidia-persistencedIfitisnot active,runthefollowingcommand: sudosystemctlenablenvidia-persistenced DisableaudevruleinstalledbydefaultinsomeLinuxdistributionsthat causehot-pluggablememorytobeautomaticallyonlinedwhenitisphysically probed.ThisbehaviorpreventsNVIDIAsoftwarefrombringingNVIDIAdevice memoryonlinewithnon-defaultsettings.Thisudevrulemustbedisabledin orderfortheNVIDIACUDAdrivertofunctionproperlyonPOWER9systems. OnRedHatEnterpriseLinux8.1,thisrulecanbefoundin: /lib/udev/rules.d/40-redhat.rules OnUbuntu18.04,thisrulecanbefoundin: /lib/udev/rules.d/40-vm-hotadd.rules Therulegenerallytakesaformwhereitdetectstheadditionofamemory blockandchangesthe'state'attributetoonline.Forexample,inRHEL8, therulelookslikethis: SUBSYSTEM=="memory",ACTION=="add",PROGRAM="/bin/uname-p",RESULT!="s390*",ATTR{state}=="offline",ATTR{state}="online"This rulemustbedisabledbycopyingthefileto /etc/udev/rules.dandcommentingout,removing,or changingthehot-pluggablememoryruleinthe/etccopyso thatitdoesnotapplytoPOWER9NVIDIAsystems.Forexample,onRHEL7.5 andearlier: sudocp/lib/udev/rules.d/40-redhat.rules/etc/udev/rules.d sudosed-i'/SUBSYSTEM=="memory",ACTION=="add"/d'/etc/udev/rules.d/40-redhat.rules OnRHEL7.6andlaterversions: sudocp/lib/udev/rules.d/40-redhat.rules/etc/udev/rules.d sudosed-i's/SUBSYSTEM!="memory",.*GOTO="memory_hotplug_end"/SUBSYSTEM=="*",GOTO="memory_hotplug_end"/'/etc/udev/rules.d/40-redhat.rules Youwillneedtorebootthesystemtoinitializetheabovechanges. Note:ForNUMAbestpracticesonIBMNewellPOWER9,seeNUMABestPractices. 12.2. RecommendedActions Otheractionsarerecommendedtoverifytheintegrityoftheinstallation. 12.2.1. InstallPersistenceDaemon NVIDIAisprovidingauser-spacedaemononLinuxtosupportpersistenceofdriverstate acrossCUDAjobruns.Thedaemonapproachprovidesamoreelegantandrobustsolutionto thisproblemthanpersistencemode.FormoredetailsontheNVIDIAPersistenceDaemon, seethedocumentationhere. TheNVIDIAPersistenceDaemoncanbestartedastherootuserbyrunning: /usr/bin/nvidia-persistenced--verboseThiscommandshouldberun onboot.ConsultyourLinuxdistribution'sinitdocumentationfordetailsonhowto automatethis. 12.2.2. InstallWritableSamples CUDASamplesarenowlocatedinhttps://github.com/nvidia/cuda-samples,whichincludesinstructionsforobtaining,building,andrunning thesamples. 12.2.3. VerifytheInstallation Beforecontinuing,itisimportanttoverifythattheCUDAtoolkitcanfindand communicatecorrectlywiththeCUDA-capablehardware.Todothis,youneedtocompile andrunsomeofthesampleprograms,locatedinhttps://github.com/nvidia/cuda-samples. Note:EnsurethePATHand,ifusingtherunfileinstallationmethod,LD_LIBRARY_PATHvariablesaresetcorrectly. 12.2.3.1. VerifytheDriverVersion Ifyouinstalledthedriver,verifythatthecorrectversionofitisloaded.Ifyoudidnotinstallthedriver,orareusing anoperatingsystemwherethedriverisnotloadedviaakernelmodule,suchasL4T,skipthisstep. Whenthedriverisloaded,thedriverversioncanbefoundbyexecutingthecommand cat/proc/driver/nvidia/versionNotethatthiscommandwillnot workonaniGPU/dGPUsystem. 12.2.3.2. RunningtheBinaries Aftercompilation,findandrundeviceQueryfromhttps://github.com/nvidia/cuda-samples.IftheCUDA softwareisinstalledandconfiguredcorrectly,theoutputfordeviceQuery shouldlooksimilartothatshowninFigure1. Figure1.ValidResultsfromdeviceQueryCUDASample Theexactappearanceandtheoutputlinesmightbedifferentonyoursystem.Theimportantoutcomesarethatadevicewas found(thefirsthighlightedline),thatthedevicematchestheoneonyoursystem(thesecondhighlightedline),andthat thetestpassed(thefinalhighlightedline). IfaCUDA-capabledeviceandtheCUDADriverareinstalledbutdeviceQueryreportsthatnoCUDA-capabledevicesarepresent,thislikelymeansthatthe/dev/nvidia*filesaremissingorhavethewrongpermissions. OnsystemswhereSELinuxisenabled,youmightneedtotemporarilydisable thissecurityfeaturetorundeviceQuery.Todothis,type: setenforce0fromthecommandlineasthesuperuser. RunningthebandwidthTestprogramensuresthatthesystemandtheCUDA-capabledeviceareabletocommunicatecorrectly.ItsoutputisshowninFigure2. Figure2.ValidResultsfrombandwidthTestCUDASample NotethatthemeasurementsforyourCUDA-capabledevicedescriptionwillvaryfromsystemtosystem.Theimportantpointis thatyouobtainmeasurements,andthatthesecond-to-lastline(inFigure2)confirmsthatallnecessarytestspassed. Shouldthetestsnotpass,makesureyouhaveaCUDA-capableNVIDIAGPUonyoursystemandmakesureitisproperlyinstalled. Ifyourunintodifficultieswiththelinkstep(suchaslibrariesnotbeingfound),consult theLinuxReleaseNotesfoundinhttps://github.com/nvidia/cuda-samples. 12.2.4. InstallNsightEclipsePlugins ToinstallNsightEclipseplugins,aninstallationscriptisprovided: /usr/local/cuda-11.6/bin/nsight_ee_plugins_manage.shinstallRefer toNsightEclipsePluginsInstallationGuideformoredetails. 12.3. OptionalActions OtheroptionsarenotnecessarytousetheCUDAToolkit,butareavailabletoprovideadditionalfeatures. 12.3.1. InstallThird-partyLibraries SomeCUDAsamplesusethird-partylibrarieswhichmaynotbeinstalledbydefaultonyoursystem.Thesesamplesattemptto detectanyrequiredlibrarieswhenbuilding. Ifalibraryisnotdetected,itwaivesitselfandwarnsyouwhichlibraryismissing.Tobuildandrunthesesamples,you mustinstallthemissinglibraries.ThesedependenciesmaybeinstallediftheRPMorDebcuda-samples-11-6packageisused.Incaseswherethesedependenciesarenotinstalled,followtheinstructionsbelow. RHEL7/CentOS7 sudoyuminstallfreeglut-devellibX11-devellibXi-devellibXmu-devel\ makemesa-libGLU-develfreeimage-devel RHEL8/CentOS8 sudodnfinstallfreeglut-devellibX11-devellibXi-devellibXmu-devel\ makemesa-libGLU-develfreeimage-devel Fedora sudodnfinstallfreeglut-devellibX11-devellibXi-devellibXmu-devel\ makemesa-libGLU-develfreeimage-devel SLES sudozypperinstalllibglut3libX11-devellibXi6libXmu6libGLU1make OpenSUSE sudozypperinstallfreeglut-devellibX11-devellibXi-devellibXmu-devel\ makeMesa-libGL-develfreeimage-devel Ubuntu sudoapt-getinstallg++freeglut3-devbuild-essentiallibx11-dev\ libxmu-devlibxi-devlibglu1-mesalibglu1-mesa-devlibfreeimage-dev Debian sudoapt-getinstallg++freeglut3-devbuild-essentiallibx11-dev\ libxmu-devlibxi-devlibglu1-mesalibglu1-mesa-devlibfreeimage-dev 12.3.2. InstalltheSourceCodeforcuda-gdb Thecuda-gdbsourcemustbeexplicitlyselectedforinstallationwiththe runfileinstallationmethod.Duringtheinstallation,inthecomponentselectionpage, expandthecomponent"CUDATools11.0"andselectcuda-gdb-srcfor installation.Itisuncheckedbydefault. Toobtainacopyofthesourcecodeforcuda-gdbusingtheRPMandDebian installationmethods,thecuda-gdb-srcpackagemustbeinstalled. Thesourcecodeisinstalledasatarballinthe/usr/local/cuda-11.6/extrasdirectory. 12.3.3. SelecttheActiveVersionofCUDA Forapplicationsthatrelyonthesymlinks/usr/local/cudaand /usr/local/cuda-MAJOR,youmaywishtochangetoadifferent installedversionofCUDAusingtheprovidedalternatives. ToshowtheactiveversionofCUDAandallavailableversions: update-alternatives--displaycuda ToshowtheactiveminorversionofagivenmajorCUDArelease: update-alternatives--displaycuda-11 ToupdatetheactiveversionofCUDA: sudoupdate-alternatives--configcuda 13. AdvancedSetup Belowisinformationonsomeadvancedsetupscenarioswhicharenotcoveredinthebasicinstructionsabove. Table6.AdvancedSetupScenarioswhenInstallingCUDA Scenario Instructions InstallCUDAusingthePackageManagerinstallationmethodwithout installingtheNVIDIAGLlibraries. FedoraInstallCUDAusingthefollowingcommand:sudodnfinstallcuda-toolkit-11-6\ nvidia-driver-cudaakmod-nvidiaFollowtheinstructionsheretoensurethatNouveauisdisabled. Ifperforminganupgradeoverapreviousinstallation,theNVIDIA kernelmodulemayneedtoberebuiltbyfollowingtheinstructions here. OpenSUSE/SLESOnsomesystemconfigurationstheNVIDIAGLlibrariesmayneedtobe lockedbeforeinstallationusing: sudozypperaddlocknvidia-glG04InstallCUDAusingthefollowingcommand:sudozypperinstall--no-recommendscuda-toolkit-11-6\ nvidia-computeG04\ nvidia-gfxG04-kmp-defaultFollowtheinstructionsheretoensurethatNouveauisdisabled. UbuntuThisfunctionalityisn'tsupportedonUbuntu.Instead,thedriver packagesintegratewiththeBumblebeeframeworktoprovidea solutionforuserswhowishtocontrolwhatapplicationstheNVIDIA driversareusedfor.SeeUbuntu'sBumblebeewikiformoreinformation. UpgradefromaRPM/Debdriverinstallationwhichincludesthe diagnosticdriverpackagestoadriverinstallationwhichdoesnot includethediagnosticdriverpackages. RHEL/CentOSRemovediagnosticpackagesusingthefollowingcommand:sudoyumremovecuda-drivers-diagnostic\ xorg-x11-drv-nvidia-diagnosticFollowtheinstructionsheretocontinueinstallationasnormal. FedoraRemovediagnosticpackagesusingthefollowingcommand:sudodnfremovecuda-drivers-diagnostic\ xorg-x11-drv-nvidia-diagnosticFollowtheinstructionsheretocontinueinstallationasnormal. OpenSUSE/SLESRemovediagnosticpackagesusingthefollowingcommand:sudozypperremovecuda-drivers-diagnostic\ nvidia-diagnosticG04Followtheinstructionsheretocontinueinstallationasnormal. UbuntuRemovediagnosticpackagesusingthefollowingcommand:sudoapt-getpurgecuda-drivers-diagnostic\ nvidia-384-diagnosticFollowtheinstructionsheretocontinueinstallationasnormal. UseaspecificGPUforrenderingthedisplay. AddorreplaceaDeviceentryinyour xorg.conffile,locatedat /etc/X11/xorg.conf.TheDeviceentryshould resemblethefollowing: Section"Device" Identifier"Device0" Driver"driver_name" VendorName"vendor_name" BusID"bus_id" EndSection The detailswillyouwillneedtoadddifferonacase-by-casebasis.For example,ifyouhavetwoNVIDIAGPUsandyouwantthefirstGPUtobe usedfordisplay,youwouldreplace"driver_name"with "nvidia","vendor_name"with "NVIDIACorporation"and"bus_id" withtheBusIDoftheGPU. TheBusIDwillresemble"PCI:00:02.0" andcanbefoundbyrunninglspci. InstallCUDAtoaspecificdirectoryusingthePackageManagerinstallationmethod. RPMTheRPMpackagesdon'tsupportcustominstalllocationsthroughthe packagemanagers(YumandZypper),butitispossibletoinstallthe RPMpackagestoacustomlocationusingrpm's --relocateparameter: sudorpm--install--relocate/usr/local/cuda-11.6=/new/toolkitpackage.rpmYouwillneedtoinstallthepackagesinthecorrectdependency order;thistaskisnormallytakencareofbythepackagemanagers. Forexample,ifpackage"foo"hasadependencyonpackage"bar",you shouldinstallpackage"bar"first,andpackage"foo"second.You cancheckthedependenciesofaRPMpackageasfollows: rpm-qRppackage.rpmNotethatthedriverpackagescannotberelocated.DebTheDebpackagesdonotsupportcustominstalllocations.Itis howeverpossibletoextractthecontentsoftheDebpackagesand movethefilestothedesiredinstalllocation.Seethenext scenarioformoredetailsonextractingDebpackages. Extractthecontentsoftheinstallers. RunfileTheRunfilecanbeextractedintothestandaloneToolkitandDriver Runfilesbyusingthe--extractparameter.The ToolkitstandaloneRunfilescanbefurtherextractedbyrunning: ./runfile.run--tarmxvfTheDriverRunfilecanbeextractedbyrunning:./runfile.run-xRPMTheRPMpackagescanbeextractedbyrunning:rpm2cpiopackage.rpm|cpio-idmvDebTheDebpackagescanbeextractedbyrunning:dpkg-deb-xpackage.deboutput_dir ModifyUbuntu'saptpackagemanagertoqueryspecificarchitecturesforspecificrepositories. Thisisusefulwhenaforeignarchitecturehasbeenadded,causing"404NotFound"errorstoappearwhentherepositorymeta-data isupdated. Eachrepositoryyouwishtorestricttospecificarchitecturesmusthaveitssources.listentrymodified.Thisisdonebymodifyingthe/etc/apt/sources.listfileandanyfilescontainingrepositoriesyouwishtorestrictunderthe/etc/apt/sources.list.d/directory.Normally,itissufficienttomodifyonlytheentriesin/etc/apt/sources.list Anarchitecture-restrictedrepositoryentrylookslike: deb[arch=,] Forexample,ifyouwantedtorestrictarepositorytoonlytheamd64andi386architectures,itwouldlooklike: deb[arch=amd64,i386] Itisnotnecessarytorestrictthedeb-srcrepositories,astheserepositoriesdon'tprovidearchitecture-specificpackages. Formoredetails,seethesources.listmanpage. Thenvidia.kokernelmodulefailstoload,sayingsomesymbolsareunknown. Forexample: nvidia:Unknownsymboldrm_open(err0) Checktoseeifthereareanyoptionallyinstallablemodulesthatmightprovidethesesymbolswhicharenotcurrentlyinstalled. Fortheexampleofthedrm_opensymbol,checktoseeifthereareanypackageswhichprovidedrm_openandarenotalreadyinstalled.Forinstance,onUbuntu 14.04,thelinux-image-extrapackageprovidestheDRMkernelmodule(whichprovidesdrm_open).Thispackageisoptionaleventhoughthekernelheaders reflecttheavailabilityofDRMregardlessofwhetherthispackageisinstalledornot. TherunfileinstallerfailstoextractduetolimitedspaceintheTMPdirectory. ThiscanoccuronsystemswithlimitedstorageintheTMPdirectory (usually/tmp),oronsystemswhichuseatmpfsin memorytohandletemporarystorage.Inthiscase,the --tmpdircommand-lineoptionshouldbeusedto instructtherunfiletouseadirectorywithsufficientspaceto extractinto.Moreinformationonthisoptioncanbefoundhere. Re-enableWaylandafterinstallingtheRPMdriveronFedora. WaylandisdisabledduringinstallationoftheFedoradriverRPMdue tocompatabilityissues.Tore-enableWayland,commentoutthisline in/etc/gdm/custom.conf: WaylandEnable=false Incaseoftheerror:E:Failedtofetchfile:/var/cuda-repo Filenotfound DebianandUbuntuThiscanoccurwheninstallingCUDAafter uninstallingadifferentversion.Usethefollowingcommandbefore installation: sudorm-v/var/lib/apt/lists/*cuda*/var/lib/apt/lists/*nvidia* 14. FrequentlyAskedQuestions HowdoIinstalltheToolkitinadifferentlocation? TheRunfileinstallationaskswhereyouwishtoinstalltheToolkitduringan interactiveinstall.Ifinstallingusinganon-interactiveinstall,youcanusethe --toolkitpathparametertochangetheinstalllocation: ./runfile.run--silent\ --toolkit--toolkitpath=/my/new/toolkit TheRPMandDebpackagescannotbeinstalledtoacustominstalllocationdirectlyusingthepackagemanagers.Seethe"Install CUDAtoaspecificdirectoryusingthePackageManagerinstallationmethod"scenariointheAdvancedSetupsectionformoreinformation. WhydoIsee"nvcc:Nosuchfileordirectory"whenItrytobuildaCUDAapplication? YourPATHenvironmentvariableisnotsetupcorrectly.EnsurethatyourPATHincludes thebindirectorywhereyouinstalledtheToolkit,usually /usr/local/cuda-11.6/bin. exportPATH=/usr/local/cuda-11.6/bin${PATH:+:${PATH}} WhydoIsee"errorwhileloadingsharedlibraries::cannotopensharedobjectfile:Nosuchfileordirectory" whenItrytorunaCUDAapplicationthatusesaCUDAlibrary? YourLD_LIBRARY_PATHenvironmentvariableisnotsetupcorrectly.Ensurethatyour LD_LIBRARY_PATHincludestheliband/orlib64directorywhereyouinstalledthe Toolkit,usually/usr/local/cuda-11.6/lib{,64}: exportLD_LIBRARY_PATH=/usr/local/cuda-11.6/lib\ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} WhydoIseemultiple"404NotFound"errorswhenupdatingmyrepositorymeta-dataonUbuntu? Theseerrorsoccurafteraddingaforeignarchitecturebecauseaptisattemptingto queryforeacharchitecturewithineachrepositorylistedinthesystem's sources.listfile.Repositoriesthatdonothostpackagesforthenewlyadded architecturewillpresentthiserror.Whilenoisy,theerroritselfdoesnoharm. PleaseseetheAdvancedSetupsectionfor detailsonhowtomodifyyoursources.listfiletopreventthese errors. HowcanItellXtoignoreaGPUforcompute-onlyuse? TomakesureXdoesn'tuseacertainGPUfordisplay,youneedtospecifywhichotherGPUtousefordisplay.Formoreinformation,pleaserefertothe"UseaspecificGPUforrenderingthedisplay"scenario intheAdvancedSetupsection. Whydoesn'tthecuda-repopackageinstalltheCUDAToolkitandDrivers? WhenusingRPMorDeb,thedownloadedpackageisarepositorypackage. Suchapackageonlyinformsthepackagemanagerwheretofindtheactualinstallationpackages,butwillnotinstallthem. SeethePackageManagerInstallationsectionformoredetails. HowdoIgetCUDAtoworkonalaptopwithaniGPUandadGPUrunningUbuntu14.04? AfterinstallingCUDA,setthedrivervaluefortheinteldevicein /etc/X11/xorg.confto'modesetting'asshown below: Section"Device" Identifier"intel" Driver"modesetting" ... EndSection TopreventUbuntufromrevertingthechangeinxorg.conf,edit /etc/default/grubtoadd"nogpumanager"to GRUB_CMDLINE_LINUX_DEFAULT. Runthefollowingcommandtoupdategrubbeforerebooting: sudoupdate-grub WhatdoIdoifthedisplaydoesnotload,orCUDAdoesnotwork,afterperformingasystemupdate? SystemupdatesmayincludeanupdatedLinuxkernel.Inmanycases,anewLinuxkernelwillbeinstalledwithoutproperlyupdating therequiredLinuxkernelheadersanddevelopmentpackages.ToensuretheCUDAdrivercontinuestoworkwhenperforminga systemupdate,rerunthecommandsintheKernelHeadersandDevelopmentPackagessection. Additionally,onFedora,theAkmodsframeworkwillsometimesfailtocorrectlyrebuild theNVIDIAkernelmodulepackageswhenanewLinuxkernelisinstalled.Whenthis happens,itisusuallysufficienttoinvokeAkmodsmanuallyandregeneratethe modulemappingfilesbyrunningthefollowingcommandsinavirtualconsole,and thenrebooting:sudoakmods--force sudodepmodYoucanreach avirtualconsolebyhittingctrl+alt+f2atthesametime. HowdoIinstallaCUDAdriverwithaversionlessthan367usinganetworkrepo? ToinstallaCUDAdriverataversionearlierthan367usinganetworkrepo,therequiredpackageswillneedtobeexplicitly installedatthedesiredversion.Forexample,toinstall352.99,insteadofinstallingthecuda-driversmetapackageatversion 352.99,youwillneedtoinstallallrequiredpackagesofcuda-driversatversion352.99. HowdoIinstallanolderCUDAversionusinganetworkrepo? Dependingonyoursystemconfiguration,youmaynotbeabletoinstalloldversionsofCUDAusingthecudametapackage.In ordertoinstallaspecificversionofCUDA,youmayneedtospecifyallofthepackagesthatwouldnormallybeinstalled bythecudametapackageattheversionyouwanttoinstall. Ifyouareusingyumtoinstallcertainpackagesatanolderversion,thedependencies maynotresolveasexpected.Inthiscaseyoumayneedtopass "--setopt=obsoletes=0"toyumtoallowaninstallofpackages whichareobsoletedatalaterversionthanyouaretryingtoinstall. WhydoestheinstallationonSUSEinstalltheMesa-dri-nouveaudependency? ThisdependencycomesfromtheSUSErepositoriesandshouldn'taffecttheuseofthe NVIDIAdriverortheCUDAToolkit.Todisablethisdependency,youcanlockthat packagewiththefollowing command:sudozypperalMesa-dri-nouveau 15. AdditionalConsiderations NowthatyouhaveCUDA-capablehardwareandtheNVIDIACUDAToolkitinstalled,youcanexamine andenjoythenumerousincludedprograms.TobeginusingCUDAtoacceleratethe performanceofyourownapplications,consulttheCUDAC++Programming Guide,locatedin/usr/local/cuda-11.6/doc. AnumberofhelpfuldevelopmenttoolsareincludedintheCUDAToolkittoassistyouasyou developyourCUDAprograms,suchasNVIDIA® Nsight™EclipseEdition,NVIDIAVisualProfiler,CUDA-GDB,and CUDA-MEMCHECK. Fortechnicalsupportonprogrammingquestions,consultandparticipateinthedeveloperforumsathttps://developer.nvidia.com/cuda/. 16. RemovingCUDAToolkitandDriver FollowthebelowstepstoproperlyuninstalltheCUDAToolkitandNVIDIADriversfrom yoursystem.Thesestepswillensurethattheuninstallationwillbeclean. RHEL8/CentOS8 ToremoveCUDAToolkit: sudodnfremove"cuda*""*cublas*""*cufft*""*cufile*""*curand*"\ "*cusolver*""*cusparse*""*gds-tools*""*npp*""*nvjpeg*""nsight*" ToremoveNVIDIADrivers:sudodnfremovenvidia-driverTo resetthemodulestream: sudodnfmoduleresetnvidia-driver RHEL7/CentOS7 ToremoveCUDAToolkit: sudoyumremove"cuda*""*cublas*""*cufft*""*cufile*""*curand*"\ "*cusolver*""*cusparse*""*gds-tools*""*npp*""*nvjpeg*""nsight*" ToremoveNVIDIADrivers:sudoyumremove"*nvidia*" Fedora ToremoveCUDAToolkit: sudodnfremove"cuda*""*cublas*""*cufft*""*cufile*""*curand*"\ "*cusolver*""*cusparse*""*gds-tools*""*npp*""*nvjpeg*""nsight*" Toremove3rdpartyNVIDIADrivers: sudodnfremove"*nvidia*"ToremoveNVIDIADrivers: sudodnfremovenvidia-driverToresetthemodulestream: sudodnfmoduleresetnvidia-driver OpenSUSE/SLES ToremoveCUDAToolkit: sudozypperremove"cuda*""*cublas*""*cufft*""*cufile*""*curand*"\ "*cusolver*""*cusparse*""*gds-tools*""*npp*""*nvjpeg*""nsight*" ToremoveNVIDIADrivers:sudozypperremove"*nvidia*" UbuntuandDebian ToremoveCUDAToolkit: sudoapt-get--purgeremove"*cuda*""*cublas*""*cufft*""*cufile*""*curand*"\ "*cusolver*""*cusparse*""*gds-tools*""*npp*""*nvjpeg*""nsight*"To removeNVIDIADrivers: sudoapt-get--purgeremove"*nvidia*" Tocleanupthe uninstall:sudoapt-getautoremove Notices Notice Thisdocumentisprovidedforinformation purposesonlyandshallnotberegardedasawarrantyofa certainfunctionality,condition,orqualityofaproduct. NVIDIACorporation(“NVIDIA”)makesnorepresentationsor warranties,expressedorimplied,astotheaccuracyor completenessoftheinformationcontainedinthisdocument andassumesnoresponsibilityforanyerrorscontained herein.NVIDIAshallhavenoliabilityfortheconsequences oruseofsuchinformationorforanyinfringementof patentsorotherrightsofthirdpartiesthatmayresult fromitsuse.Thisdocumentisnotacommitmenttodevelop, release,ordeliveranyMaterial(definedbelow),code,or functionality. NVIDIAreservestherighttomakecorrections,modifications, enhancements,improvements,andanyotherchangestothis document,atanytimewithoutnotice. Customershouldobtainthelatestrelevantinformationbefore placingordersandshouldverifythatsuchinformationis currentandcomplete. NVIDIAproductsaresoldsubjecttotheNVIDIAstandardtermsand conditionsofsalesuppliedatthetimeoforder acknowledgement,unlessotherwiseagreedinanindividual salesagreementsignedbyauthorizedrepresentativesof NVIDIAandcustomer(“TermsofSale”).NVIDIAhereby expresslyobjectstoapplyinganycustomergeneraltermsand conditionswithregardstothepurchaseoftheNVIDIA productreferencedinthisdocument.Nocontractual obligationsareformedeitherdirectlyorindirectlybythis document. NVIDIAproductsarenotdesigned,authorized,orwarrantedtobe suitableforuseinmedical,military,aircraft,space,or lifesupportequipment,norinapplicationswherefailureor malfunctionoftheNVIDIAproductcanreasonablybeexpected toresultinpersonalinjury,death,orpropertyor environmentaldamage.NVIDIAacceptsnoliabilityfor inclusionand/oruseofNVIDIAproductsinsuchequipmentor applicationsandthereforesuchinclusionand/oruseisat customer’sownrisk. NVIDIAmakesnorepresentationorwarrantythatproductsbasedon thisdocumentwillbesuitableforanyspecifieduse. Testingofallparametersofeachproductisnotnecessarily performedbyNVIDIA.Itiscustomer’ssoleresponsibilityto evaluateanddeterminetheapplicabilityofanyinformation containedinthisdocument,ensuretheproductissuitable andfitfortheapplicationplannedbycustomer,andperform thenecessarytestingfortheapplicationinordertoavoid adefaultoftheapplicationortheproduct.Weaknessesin customer’sproductdesignsmayaffectthequalityand reliabilityoftheNVIDIAproductandmayresultin additionalordifferentconditionsand/orrequirements beyondthosecontainedinthisdocument.NVIDIAacceptsno liabilityrelatedtoanydefault,damage,costs,orproblem whichmaybebasedonorattributableto:(i)theuseofthe NVIDIAproductinanymannerthatiscontrarytothis documentor(ii)customerproductdesigns. Nolicense,eitherexpressedorimplied,isgrantedunderanyNVIDIA patentright,copyright,orotherNVIDIAintellectual propertyrightunderthisdocument.Informationpublishedby NVIDIAregardingthird-partyproductsorservicesdoesnot constitutealicensefromNVIDIAtousesuchproductsor servicesorawarrantyorendorsementthereof.Useofsuch informationmayrequirealicensefromathirdpartyunder thepatentsorotherintellectualpropertyrightsofthe thirdparty,oralicensefromNVIDIAunderthepatentsor otherintellectualpropertyrightsofNVIDIA. Reproductionofinformationinthisdocumentispermissibleonlyif approvedinadvancebyNVIDIAinwriting,reproducedwithout alterationandinfullcompliancewithallapplicableexport lawsandregulations,andaccompaniedbyallassociated conditions,limitations,andnotices. THISDOCUMENTANDALLNVIDIADESIGNSPECIFICATIONS,REFERENCE BOARDS,FILES,DRAWINGS,DIAGNOSTICS,LISTS,ANDOTHER DOCUMENTS(TOGETHERANDSEPARATELY,“MATERIALS”)AREBEING PROVIDED“ASIS.”NVIDIAMAKESNOWARRANTIES,EXPRESSED, IMPLIED,STATUTORY,OROTHERWISEWITHRESPECTTOTHE MATERIALS,ANDEXPRESSLYDISCLAIMSALLIMPLIEDWARRANTIESOF NONINFRINGEMENT,MERCHANTABILITY,ANDFITNESSFORA PARTICULARPURPOSE.TOTHEEXTENTNOTPROHIBITEDBYLAW,IN NOEVENTWILLNVIDIABELIABLEFORANYDAMAGES,INCLUDING WITHOUTLIMITATIONANYDIRECT,INDIRECT,SPECIAL, INCIDENTAL,PUNITIVE,ORCONSEQUENTIALDAMAGES,HOWEVER CAUSEDANDREGARDLESSOFTHETHEORYOFLIABILITY,ARISING OUTOFANYUSEOFTHISDOCUMENT,EVENIFNVIDIAHASBEEN ADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES.Notwithstanding anydamagesthatcustomermightincurforanyreason whatsoever,NVIDIA’saggregateandcumulativeliability towardscustomerfortheproductsdescribedhereinshallbe limitedinaccordancewiththeTermsofSaleforthe product. OpenCL OpenCLisatrademarkofAppleInc.usedunderlicensetotheKhronosGroupInc. Trademarks NVIDIAandtheNVIDIAlogoaretrademarksorregisteredtrademarksofNVIDIACorporation intheU.S.andothercountries.Othercompanyandproductnamesmaybetrademarksof therespectivecompanieswithwhichtheyareassociated. Copyright ©2009-2022NVIDIACorporation& affiliates.Allrightsreserved. ThisproductincludessoftwaredevelopedbytheSyncroSoftSRL(http://www.sync.ro/).



請為這篇文章評分?