Skip to content

Instantly share code, notes, and snippets.

@Melonangie
Last active February 26, 2024 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Melonangie/b7dc06f425f5b25786e3ddfffbe0e069 to your computer and use it in GitHub Desktop.
Save Melonangie/b7dc06f425f5b25786e3ddfffbe0e069 to your computer and use it in GitHub Desktop.
Setup M15R6 Nvidia for Data Science - Using the Nvidia Data Science Stack https://github.com/NVIDIA/data-science-stack
git clone https://github.com/NVIDIA/data-science-stack
cd data-science-stack
./data-science-stack setup-system
sudo reboot
  • Update and source ~/.zshrc
export PATH=/usr/local/cuda/bin:$PATH
export PATH=/usr/local/cuda-12.3/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-12.3/lib64\
                         ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
                         export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_HOME=/usr/local/cuda                         
cd data-science-stack
touch enviroment.yml
echo 'name: data-science-stack' >> environment.yml
conda env create --name data-science-stack -f environment.yml
conda activate data-science-stack
./data-science-stack build-conda-env data-science-stack
conda install jupyter
./data-science-stack run-jupyter data-science-stack
sudo apt -y install g++ freeglut3-dev libx11-dev libxmu-dev libxi-dev libglu1-mesa-dev libfreeimage-dev libglfw3-dev nvidia-cuda-toolkit nvidia-gds
sudo apt -y install cudnn-cuda-12
sudo apt -y install libcudnn9-samples
sudo cp -r /usr/src/cudnn_samples_v9 ~/cudnn_samples_v9
cd ~/cudnn_samples_v9/mnistCUDNN && make clean && make && ./mnistCUDNN
  • Sign in, select leatest version, agree, select the leatest version, leatest deb for ubuntu 22 and cuda 12
cd ~/Downloads
os="ubuntu2204"
tag="8.6.1-cuda-12.0"
sudo dpkg -i nv-tensorrt-local-repo-${os}-${tag}_1.0-1_amd64.deb
sudo cp /var/nv-tensorrt-local-repo-${os}-${tag}/*-keyring.gpg /usr/share/keyrings/
sudo apt -y update && sudo apt -y install tensorrt
dpkg-query -W tensorrt

Disable a udev rule

sudo cp /lib/udev/rules.d/40-vm-hotadd.rules /etc/udev/rules.d
sudo sed -i '/SUBSYSTEM=="memory", ACTION=="add"/d' /etc/udev/rules.d/40-vm-hotadd.rules
sudo reboot
  • Get PCI ID lspci -d 8086::0300
  • Create conf file sudo touch /etc/X11/xorg.conf
  • Add content sudo nvim /etc/X11/xorg.conf
Section "Device"
    Identifier "Device0"
    BusID "PCI:0:2:0"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Device0"
EndSection
  • Create udev rules file sudo touch /lib/udev/rules.d/80-nvidia-pm.rules
  • Add content sudo nvim /lib/udev/rules.d/80-nvidia-pm.rules
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"

# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"

# Enable runtime PM for NVIDIA VGA controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"

# Enable runtime PM for NVIDIA Audio controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", TEST=="power/control", ATTR{power/control}="auto"
  • Reboot sudo reboot

Next Steps

Configure Ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment