CUDA Simply Explained - GPU vs CPU Parallel Computing for Beginners

Python Simplified December 25, 2021
Video Thumbnail
Python Simplified Logo

Python Simplified

@pythonsimplified

About

Hi everyone! My name is Mariya and I'm a software developer from Sofia, Bulgaria. I film programming tutorials about Computer Science Concepts, GUI Applications, Machine Learning and Artificial Intelligence, Automation and Web Scraping, Data Science and even Math! 🤓 I'm here to help you with your programming journey (in particular - your Python programming journey 😉) and show you how many beautiful and powerful things we can do with code! 💪💪💪

Video Description

In this tutorial, we will talk about CUDA and how it helps us accelerate the speed of our programs. Additionally, we will discuss the difference between processors (CPUs) and graphic cards (GPUs) and how come we can use both to process code. By the end of this video - we will install CUDA and perform a quick speed test comparing the speed of our GPU with the speed of our CPU. We will create 2 extremely large data structures with PyTorch and we will multiply one by the other to test the performance. Specifically, I'll be comparing Nvidia's GeForce RTX 3090 GPU with Intel's i9-12900K 12th-Gen Alder Lake Processor (with DDR5 memory). I'll be posting some more advanced benchmarks in the next few tutorials, as the code I'm demonstrating in this video is 100% beginner-friendly! ⏲️ Time Stamps ⏲️ ***************************************** 00:00 - what is CUDA? 00:47 - how processors (CPU) operate? 01:42 - CPU multitasking 03:16 - how graphic cards (GPU) operate? 04:02 - how come GPUs can run code faster than CPUs? 04:59 - benefits of using CUDA 06:03 - verify our GPU is capable of CUDA 06:48 - install CUDA with Anaconda and PyTorch 09:22 - verify if CUDA installation was successful 10:32 - CPU vs GPU speed test with PyTorch 14:20 - freeze CPU with torch.cuda.synchronize() 15:51 - speed test results 17:55 - CUDA for systems with multiple GPUs 18:28 - next tutorials and thanks for watching! 🔗 Important Links 🔗 ***************************************** ⭐ My Anaconda Tutorial for Beginners: https://youtu.be/MUZtVEDKXsk ⭐ My CUDA vs. TensorRT Tutorial for Beginners: https://youtu.be/iFADsRDJhDM ⭐ CUDA Enabled GPUS: https://developer.nvidia.com/cuda-gpus ⭐ Complete Notebook Code: https://github.com/MariyaSha/CUDA_speedtest 💻 Install with VENV instead of Anaconda (LINUX) 💻 ***************************************** ❗install venv: $ sudo apt-get install -y python3-venv 🥇create working environment: $ python3 -m venv my_env 🥈activate working environment: $ source my_env/bin/activate 🥉install PIP3 and PyTorch+CUDA: (my_env) $ sudo apt install python3-pip (my_env) $ pip3 install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio==0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html 🏆more information about VENV: https://docs.python.org/3/library/venv.html 🏆more information about installing Pytorch: https://pytorch.org/get-started/locally/ 🙏SPECIAL THANK YOU 🙏 ***************************************** Thank you so much to Robert from Nvidia for helping me with the speed test code! Thank you to SFX Buzz for the scratched record sound: https://www.sfxbuzz.com/ Thank you to Flat Icon for the beautiful icon graphics: https://www.flaticon.com/

You May Also Like

Boost Your CUDA Performance

AI-recommended products based on this video

Loading...
AocBook 15.6'' FHD Laptop, Intel N95, Nvidia GTX 1060 4GB, 32GB DDR4 RAM, M.2 SSD, Sleek Notebook with Type-C, HDMI, RJ45 Ethernet, Backlit Keyboard, Fingerprint (32GB DDR4 | 1TB SSD)

AocBook 15.6'' FHD Laptop, Intel N95, Nvidia GTX 1060 4GB, 32GB DDR4 RAM, M.2 SSD, Sleek Notebook with Type-C, HDMI, RJ45 Ethernet, Backlit Keyboard, Fingerprint (32GB DDR4 | 1TB SSD)

(3)
$749.00
FREE delivery Fri, Jun 20
Loading...
acer Nitro 50 N50-620-UA91 Gaming Desktop | 11th Gen Intel Core i5-11400F 6-Core Processor | NVIDIA GeForce GTX 1650 | 8GB DDR4 | 512GB NVMe M.2 SSD | Intel Wi-Fi 6 AX201 | Keyboard and Mouse

acer Nitro 50 N50-620-UA91 Gaming Desktop | 11th Gen Intel Core i5-11400F 6-Core Processor | NVIDIA GeForce GTX 1650 | 8GB DDR4 | 512GB NVMe M.2 SSD | Intel Wi-Fi 6 AX201 | Keyboard and Mouse

(283)
$1,658.99
Loading...
EZDIY-FAB RTX 3000 Series 12 Pin to Dual 8 Pin PCIe Sleeved Extension Cable 300 MM- Connector for NVIDIA Ampere GEFORCE RTX 3060ti 3070 3080 FE Funder Edition- White

EZDIY-FAB RTX 3000 Series 12 Pin to Dual 8 Pin PCIe Sleeved Extension Cable 300 MM- Connector for NVIDIA Ampere GEFORCE RTX 3060ti 3070 3080 FE Funder Edition- White

(122)
$15.99
FREE delivery Mon, Feb 16 on your first order
Loading...
MSI Gaming GeForce RTX 3070 8GB GDRR6 256-Bit HDMI/DP Tri-Frozr 2 TORX Fan 4.0 Ampere Architecture RGB OC Graphics Card (RTX 3070 Gaming X Trio)

MSI Gaming GeForce RTX 3070 8GB GDRR6 256-Bit HDMI/DP Tri-Frozr 2 TORX Fan 4.0 Ampere Architecture RGB OC Graphics Card (RTX 3070 Gaming X Trio)

(420)
$1,201.78$549.99
FREE delivery Feb 20 - 23
Loading...
MSI Gaming RTX 5070 Ti 16G Gaming Trio OC Graphics Card (16GB GDDR7, 256-bit, Extreme Performance: 2580, DisplayPort x 3 2.1a, HDMI 2.1b, NVIDIA Blackwell Architecture)

MSI Gaming RTX 5070 Ti 16G Gaming Trio OC Graphics Card (16GB GDDR7, 256-bit, Extreme Performance: 2580, DisplayPort x 3 2.1a, HDMI 2.1b, NVIDIA Blackwell Architecture)

(98)
$1,244.99
FREE delivery Wed, Jan 7
50+ bought in past month
Loading...
MSI Gaming RTX 5070 Ti 16G Inspire 3X OC Plus Graphics Card (16GB GDDR7, 256-bit, Extreme Clock 2497 MHz, DisplayPort x 3 2.1a, HDMI 2.1b, NVIDIA Blackwell Architecture)

MSI Gaming RTX 5070 Ti 16G Inspire 3X OC Plus Graphics Card (16GB GDDR7, 256-bit, Extreme Clock 2497 MHz, DisplayPort x 3 2.1a, HDMI 2.1b, NVIDIA Blackwell Architecture)

(3)
$4,463.28
Loading...
Corsair Vengeance LPX 32GB (2 X 16GB) DDR4 3200 (PC4-25600) C16 1.35V Desktop Memory - Black
Best Seller

Corsair Vengeance LPX 32GB (2 X 16GB) DDR4 3200 (PC4-25600) C16 1.35V Desktop Memory - Black

(16,675)
$112.99$101.69
FREE delivery Sun, Aug 10
500+ bought in past month
Loading...
Motherboard Fit for Gigabyte Z490 AORUS Master LGA 1200 ATX Gaming Motherboard Support I9-10900K I7-10700K I5-10600K DDR4 3×M.2 1×PCI-E X16

Motherboard Fit for Gigabyte Z490 AORUS Master LGA 1200 ATX Gaming Motherboard Support I9-10900K I7-10700K I5-10600K DDR4 3×M.2 1×PCI-E X16

(0)
$666.12
FREE delivery Oct 31 - Nov 21
Loading...
CORSAIR Hydro X Series iCUE Link XH405i Custom Cooling Kit – Hardline Water Cooling Loop – XC7 Elite CPU Water Block – XD5 Elite D5 Pump Res – XR5 360mm Radiator – 3X QX120 RGB Fans

CORSAIR Hydro X Series iCUE Link XH405i Custom Cooling Kit – Hardline Water Cooling Loop – XC7 Elite CPU Water Block – XD5 Elite D5 Pump Res – XR5 360mm Radiator – 3X QX120 RGB Fans

(235)
$879.99
FREE delivery Sun, Aug 24
Loading...
Corsair RM1000e Fully Modular Low-Noise ATX Power Supply - Dual EPS12V Connectors - 105°C-Rated Capacitors - 80 Plus Gold Efficiency - Modern Standby Support - Black

Corsair RM1000e Fully Modular Low-Noise ATX Power Supply - Dual EPS12V Connectors - 105°C-Rated Capacitors - 80 Plus Gold Efficiency - Modern Standby Support - Black

(41)
$219.19$204.66
FREE delivery Oct 15 - 22
Loading...
Skytech Archangel Gaming PC Desktop – AMD Ryzen 5 3600 3.6 GHz, NVIDIA RTX 3060, 1TB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

Skytech Archangel Gaming PC Desktop – AMD Ryzen 5 3600 3.6 GHz, NVIDIA RTX 3060, 1TB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

(31)
$2,657.01$2,656.90
FREE delivery Feb 24 - Mar 3
Loading...
Skytech Blaze 3.0 Gaming PC Desktop – Intel Core i5 12400F 2.5 GHz, NVIDIA RTX 3060, 500GB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

Skytech Blaze 3.0 Gaming PC Desktop – Intel Core i5 12400F 2.5 GHz, NVIDIA RTX 3060, 500GB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

(786)
$1,414.11
FREE delivery Thu, Feb 19Only 4 left in stock.
Loading...
Gaming Mini PC N2 Pro, Ryzen 7 6800H, 32GB DDR5 512GB M.2 NVME SSD, Radeon 680M Mini Computers, Uual USB4 8K UHD, Quad Display, WiFi 6E, BT-5.2, Mini Desktop PC/11 Pro/Office

Gaming Mini PC N2 Pro, Ryzen 7 6800H, 32GB DDR5 512GB M.2 NVME SSD, Radeon 680M Mini Computers, Uual USB4 8K UHD, Quad Display, WiFi 6E, BT-5.2, Mini Desktop PC/11 Pro/Office

(56)
$589.99
FREE delivery Sat, Jan 3
Loading...
BOSGAME P2 Plus Mini PC - Intel Core i7-12700H, 32GB DDR5, 512GB NVMe SSD | Thunderbolt 4, Triple 4K Display| Dual 2.5G LAN, WiFi 6, Bluetooth 5.2 | Win11 Pro Desktops for Work Gaming

BOSGAME P2 Plus Mini PC - Intel Core i7-12700H, 32GB DDR5, 512GB NVMe SSD | Thunderbolt 4, Triple 4K Display| Dual 2.5G LAN, WiFi 6, Bluetooth 5.2 | Win11 Pro Desktops for Work Gaming

(113)
$699.99
FREE delivery Sat, Jan 3
Loading...
Thermalright Aqua Elite 240 V3 Liquid CPU Cooler, 240 Cooling Row Size, 2 x 120mm PWM Fans, S-FDB Bearings,for AMD/AM4/AM5, Intel LGA1150/1151/1155/1156/1200/2011/1700,Desktop CPU Cooler AIO

Thermalright Aqua Elite 240 V3 Liquid CPU Cooler, 240 Cooling Row Size, 2 x 120mm PWM Fans, S-FDB Bearings,for AMD/AM4/AM5, Intel LGA1150/1151/1155/1156/1200/2011/1700,Desktop CPU Cooler AIO

(169)
$61.90
FREE delivery Sun, Aug 24
100+ bought in past month
Loading...
MSI MAG CORELIQUID A15 240 - AIO ARGB CPU Liquid Cooler - 240mm Radiator - AM5, LGA 1851 Ready - Dual 120mm ARGB PWM Fans, Black

MSI MAG CORELIQUID A15 240 - AIO ARGB CPU Liquid Cooler - 240mm Radiator - AM5, LGA 1851 Ready - Dual 120mm ARGB PWM Fans, Black

(21)
$89.99$85.49
FREE delivery Sat, Jan 3
Loading...
MSI MAG Coreliquid A13 360 - AIO ARGB CPU Liquid Cooler - 360mm Radiator - LGA 1851 Ready - Triple 120mm ARGB PWM Fans, Black

MSI MAG Coreliquid A13 360 - AIO ARGB CPU Liquid Cooler - 360mm Radiator - LGA 1851 Ready - Triple 120mm ARGB PWM Fans, Black

(174)
$99.99
FREE delivery Sat, Jan 3
50+ bought in past month