{"id":394,"date":"2020-04-01T14:19:52","date_gmt":"2020-04-01T14:19:52","guid":{"rendered":"https:\/\/carson.fenimorefamily.com\/?p=394"},"modified":"2020-04-11T11:47:29","modified_gmt":"2020-04-11T11:47:29","slug":"gpus-are-cool","status":"publish","type":"post","link":"https:\/\/carson.fenimorefamily.com\/?p=394","title":{"rendered":"GPUs Are Cool"},"content":{"rendered":"\n<p>Expect no witty sayings or clever analyses here &#8211; I just think GPUs are cool.  And here are a few reasons why:<\/p>\n\n\n\n<p><strong>Exhibit A: Machine Learning<\/strong>   Training a standard feed forward neural net on CIFAR-10 progresses at 50usec\/sample; my 2.4 Ghz i7 takes almost 500usec\/sample.  The total set takes around 5 min to train on the GPU vs over a 35 min on my CPU.  On long tasks this means a difference of days to weeks.<\/p>\n\n\n\n<p><strong>Exhibit B: Video transcoding<\/strong> In order to make backups of all my blu-ray disks, I rip and transcode them using ffmpeg or handbrake.  Normally Im lucky to get a few dozen frames per second &#8211; completely making out my CPU during the process.   By compiling ffmpeg to include nvenc\/cuda support I get 456 fps (19x faster).  As the screenshots show, my avg cpu usage was below 20% &#8211; and even GPU usage stayed under 10%.  Video quality was superb (i couldnt tell the difference). <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ffmpeg -vsync 0 -hwaccel cuvid -i 00800.m2ts -c:a copy -c:v h264_nvenc -b:v 5M prince_egypt.mp4<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-gallery columns-2 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"627\" src=\"https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_cpu_load.png\" alt=\"\" data-id=\"398\" data-link=\"https:\/\/carson.fenimorefamily.com\/?attachment_id=398\" class=\"wp-image-398\" srcset=\"https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_cpu_load.png 800w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_cpu_load-300x235.png 300w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_cpu_load-768x602.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"blocks-gallery-item__caption\">CPU Load During NVENC encoding<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"766\" height=\"529\" src=\"https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_gpu_load.png\" alt=\"\" data-id=\"399\" data-link=\"https:\/\/carson.fenimorefamily.com\/?attachment_id=399\" class=\"wp-image-399\" srcset=\"https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_gpu_load.png 766w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_gpu_load-300x207.png 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><figcaption class=\"blocks-gallery-item__caption\">GPU Load During NVENC encoding<\/figcaption><\/figure><\/li><\/ul><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"544\" src=\"https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_raw-1024x544.png\" alt=\"\" class=\"wp-image-400\" srcset=\"https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_raw-1024x544.png 1024w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_raw-300x159.png 300w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_raw-768x408.png 768w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_raw-1536x816.png 1536w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_raw.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>RAW frame from blu-ray<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"553\" src=\"https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_nvenc-1024x553.png\" alt=\"\" class=\"wp-image-401\" srcset=\"https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_nvenc-1024x553.png 1024w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_nvenc-300x162.png 300w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_nvenc-768x415.png 768w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_nvenc-1536x830.png 1536w, https:\/\/carson.fenimorefamily.com\/wp-content\/uploads\/2020\/04\/princeegypt_5_29_nvenc.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Same frame after ffmpeg\/nvenc transcoding<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>My setup:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>GPU: RTX 2070 Super (8GB ram) <\/li><li>CPU: i7-8700K (6 core HT @3.7Ghz) <\/li><li>RAM: 32GB<\/li><li>Disk: 1TB PM981 (NVME) <\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Expect no witty sayings or clever analyses here &#8211; I just think GPUs are cool. And here are a few reasons why: Exhibit A: Machine Learning Training a standard feed forward neural net on CIFAR-10 progresses at 50usec\/sample; my 2.4 Ghz i7 takes almost 500usec\/sample. The total set takes around 5 min to train on &hellip; <a href=\"https:\/\/carson.fenimorefamily.com\/?p=394\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">GPUs Are Cool<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,19],"tags":[],"class_list":["post-394","post","type-post","status-publish","format-standard","hentry","category-deep-learning","category-video"],"_links":{"self":[{"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=\/wp\/v2\/posts\/394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=394"}],"version-history":[{"count":3,"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=\/wp\/v2\/posts\/394\/revisions"}],"predecessor-version":[{"id":403,"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=\/wp\/v2\/posts\/394\/revisions\/403"}],"wp:attachment":[{"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carson.fenimorefamily.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}