Skip to main content

GQC Ubuntu Setup

Document is created based on Ubuntu 20.04LTS 64bit

Download and install Ubuntu

  1. Download ubuntu 20.04LTS 64bit from Ubuntu 20.04.5 LTS (Focal Fossa) from direct download link
  2. Install it by burning into a DVD or through a bootable USB stick.
  3. Use following credentials (if appropriate):
    • Username: ubuntu
    • Password: Ubuntu2@22

Dual Boot or Multiple Drives

If installing Ubuntu alongside Windows, either on the same drive or on a separate drive, make note of these possible deviations:

  • If using multiple drives, ensure the boot manager/boot loader is installed on the proper drive.
  • If installing on a new empty drive, make sure you format the drive first and create a partition before attempting to install the OS.

Setup the environment

  1. Setup Git SSH keys to access gqc repos.

  2. Create the folder structure for storing code repos..

    1. ~/git/public
    2. ~/git/projects
    3. ~/git/gqc
  3. Install VSCode and set it up for C development.

Python

Refer to Python Development Doc for instructions on configuring virtualenvwrapper.

Install CUDA

Here for the MSI system, the target platform was chosen. Here is the link

  1. Follow the steps shown in the prompt exactly.

  2. DO NOT SKIP/MODIFY ANY STEP

  3. Follow the instructions in the link.

    1. Complete the pre-installation steps
    2. To install the cuda toolkit, follow steps mentioned heretarget platform
  4. Setting up Secure Boot

    1. During the installation process, cuda will prompt you to Enable MOK Secure Boot on the system.
    2. Follow instructions on the screen and enter a password of your choice.
    3. During the reboot, the system give you a prompt.
    4. Follow instructions in this GIST, install Nvidia driver on Ubuntu with Secure Boot (github.com)

Troubleshooting GPU drivers

  1. We had an issue once with nvidia not getting detected due to an unknown reason. Following are the steps that fixed it.

    1. The sudo apt purge command to remove the existing GPU libs failed due to a dependency issue (might be a cyclic dependency)
    2. sudo dpkg --remove --force-all <package_name> on all the libs causing the dependency issues fixed the problem with purging.
    3. Installed the nvidia driver version 535 from ppa database. (The provided link provides two methods of installation. Instructions can be litte unclear. Make sure you only install the driver through on method)
  2. nvidia-smi failing to load with the following error:

    Failed to initialize NVML: Driver/library version mismatch
    NVML library version: 535.129
    • The reason could be a driver update.
    • Simply rebooting the MSI machine fixed this

Install VSCode extensions

  1. Jupyter (Microsoft) – Jupyter notebook support.
  2. markdownlint (David Anson) – Markdown linting and style checking. Not strictly necessary for Python development, but useful for Markdown documentation.
  3. Python (Microsoft) – Linting, Debugging (multi-threaded, remote), Intellisense, Jupyter Notebooks, code formatting, refactoring, unit tests, and more.
  4. Python Docstring Generator (Nils Werner) – Automatically generates detailed docstrings for python functions.
  5. Python Indent (Kevin Rose) – Correct python indentation.
  6. Tabnine Autocomplete AI (TabNine) - JavaScript, Python, Java, Typescript & all other languages - AI Code completion plugin.
  7. Code Spell Checker (Street Side Software) – Spell checker for VS Code. This was suggested as a replacement for Microsoft's deprecated plugin: Link
  8. VSCode Map Preview - Visual Studio Marketplace: Link
  9. Markdown All in One - Link