Set Up Ubuntu Machine for Machine Learning

Created at

2025.2.25

Environment

  • Dell XPS 8920
    • RAM 16GB
    • Intel Core i7-7700 3.60GHz
  • Ubuntu Desktop 24.04.2 LTS

Install Packages for NVIDIA GPU

GPU Driver

You can check the available drivers for Ubuntu desktop with the following command.

terminal
$ sudo ubuntu-drivers list

All you have to do is to run this command to install the appropriate driver if you don't specify driver's version.

terminal
$ sudo ubuntu-drivers install

ref. NVIDIA drivers installation | Ubuntu

You can explore the appropriate version of your GPU in this site.

Download The Official NVIDIA Drivers | NVIDIA

CUDA Toolkit

(for Ubuntu 24.04 x86_64)

terminal
$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
$ sudo dpkg -i cuda-keyring_1.1-1_all.deb
$ sudo apt-get update
$ sudo apt-get -y install cuda-toolkit-12-8

ref. CUDA Toolkit 12.8 Downloads | NVIDIA Developer

Install Python

Pyenv

First, install pyenv and set the path to ~/.zshrc or the profile of using shell.

terminal
$ curl -fsSL https://pyenv.run | bash

Miniconda

After restart your shell, install miniconda with pyenv.

terminal
// Install
$ pyenv install miniconda3-latest

// Switch Python Environment
$ pyenv global miniconda3-latest

// Check the version
$ pyenv versions
  system
* miniconda3-latest (set by /home/mktia/.pyenv/version)

If you use zsh, you also must set the path with the following command.

terminal
$ conda init zsh

ref. miniconda - Unable to activate environment conda - prompted to Run 'conda init' before 'conda activate' but it doesn't work - Stack Overflow

mktia's note

Research & Engineering / Blockchain / Web Dev

© 2017-2025 mktia. All rights reserved.