Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_wordproof_timestamp is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_oembed_550980641807f5d2d921ceef288a50d2 is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_oembed_time_550980641807f5d2d921ceef288a50d2 is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Eseguire programmi CUDA su GPU AMD con il nuovo toolkit SCALE

Eseguire programmi CUDA su GPU AMD con il nuovo toolkit SCALE

Come portare il codice dei programmi NVIDIA CUDA sulle GPU AMD utilizzando l'innovativo toolkit SCALE.

CUDA, acronimo di Compute Unified Device Architecture, è un framework di programmazione sviluppato da NVIDIA che consente agli sviluppatori di sfruttare la potenza di calcolo delle GPU per eseguire operazioni non correlate con la generazione di elementi visuali. Con CUDA si possono scrivere software in grado di eseguire calcoli intensivi in parallelo, utilizzando i numerosi core presenti nelle GPU NVIDIA.

Per questo si parla di GPGPU (General-Purpose GPU): il chip grafico è utilizzato per il calcolo generico, sfruttando le migliori prestazioni che può assicurare rispetto alle classiche GPU.

Caratteristiche di CUDA

CUDA estende il linguaggio C/C++ con alcune caratteristiche specifiche per la programmazione delle GPU. Offre tante librerie pre-ottimizzate per vari ambiti: ricordiamo quelle per la matematica lineare (cuBLAS), la trasformata di Fourier (cuFFT) e il deep learning (cuDNN). Tra gli strumenti di sviluppo, CUDA integra debugger e profiler che facilitano lo sviluppo e l’ottimizzazione delle applicazioni in esecuzione lato GPU.

Le GPGPU sono utilizzate in numerosi settori, tra cui machine learning e intelligenza artificiale (per l’addestramento e l’inferenza dei modelli), simulazioni scientifiche, finanza, imaging e video, crittografia. I vantaggi rispetto alle CPU sono tangibili sia dal punto di vista energetico che delle prestazioni.

Cos’è il toolkit SCALE: porta i programmi CUDA su GPU AMD senza necessità di modifiche

NVIDIA ha in passato ripetutamente messo i bastoni tra le ruote ai progetti alternativi che miravano a portare i programmi CUDA su piattaforme diverse rispetto alle sue.

La startup britannica Spectral Compute ha recentemente annunciato lo sviluppo di un toolkit innovativo chiamato SCALE, che permette di eseguire codice CUDA sulle GPU AMD senza necessità di modifiche.

Il toolkit SCALE è progettato per funzionare in modo simile al toolkit CUDA di NVIDIA, ma con una significativa differenza: la capacità di generare binari per GPU non NVIDIA durante la compilazione del codice CUDA. Questo significa che con SCALE è possibile colmare il divario di compatibilità tra i programmi CUDA generici e altri fornitori di hardware, permettendo di utilizzare un unico codice funzionante su una varietà di piattaforme hardware.

Michael Sondergaard, CEO di Spectral Compute, ha spiegato la filosofia alla base dello sviluppo di SCALE: “quando scriviamo il codice una volta sola, dovrebbe essere possibile compilarlo ed eseguirlo su qualsiasi piattaforma hardware. Questo è stato possibile per molti anni con le CPU, quindi perché non possiamo farlo con le GPU?”

Funzionalità di SCALE

Il principale vantaggio di SCALE è la sua capacità di accettare programmi CUDA così come sono, compresi quelli che utilizzano il codice intermedio PTX asm inline. Il compilatore SCALE supporta le stesse opzioni della riga di comando e il dialetto CUDA di nvcc, il che lo rende un sostituto diretto e facile da integrare nei flussi di lavoro esistenti. Inoltre, SCALE si presenta come un’installazione del CUDA Toolkit di NVIDIA, permettendo agli strumenti di build e agli script esistenti, come cmake, di funzionare senza problemi.

SCALE si distingue dalle altre soluzioni cross-platform per la sua capacità di compilare programmi CUDA senza necessità di portarli su altri linguaggi. Questa caratteristica consente agli sviluppatori di mantenere una base di codice unica per diverse piattaforme GPU, riducendo la complessità e i costi di sviluppo.

Attualmente, SCALE supporta GPU AMD come gfx1030 (Navi 21, RDNA 2.0) e gfx1100 (Navi 31, RDNA 3.0). Il supporto per alcune GPU, come gfx1010 e gfx1101, non è ancora definitivo ma i test in itinere non sembrano evidenziare problemi. Spectral Compute sta lavorando per estendere il supporto ad altre GPU come AMD le gfx900 (Vega 10, GCN 5.0).

Come iniziare

Per cominciare a utilizzare SCALE, gli utenti possono consultare il tutorial disponibile sul sito ufficiale ed esaminare gli esempi forniti. SCALE è attualmente disponibile come pacchetto .deb o come tarball per i sistemi operativi Linux.

Prima di tutto, è necessario configurare il repository ROCm 6.0.2. Si può farlo seguendo questi passaggi su Ubuntu e distribuzioni derivate da Debian:

sudo mkdir --parents --mode=0755 /etc/apt/keyrings
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.0.2 jammy main" \
| sudo tee --append /etc/apt/sources.list.d/rocm.list
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
| sudo tee /etc/apt/preferences.d/rocm-pin-600
sudo apt update

È quindi possibile scaricare e installare SCALE, con il download e l’installazione a partire dal pacchetto .deb:

wget https://dist.scale-lang.com/scale-free-1.0.0.0-Ubuntu22.04.deb
sudo apt-get install ./scale-free-1.0.0.0-Ubuntu22.04.deb

Nel comando che segue, per non avere problemi con i permessi, è necessario sostituire il nome dell’utente in uso a youruser:

sudo usermod -a -G render youruser

L’aggiornamento del kernel Linux è necessario soltanto sulle versioni di Debian e Ubuntu piuttosto vecchie.

Conclusioni

SCALE rappresenta una soluzione promettente per sviluppatori e ingegneri che cercano di sfruttare le capacità di diverse GPU senza dover riscrivere il codice per ciascuna piattaforma.

L’integrazione fluida con gli strumenti di build esistenti e il supporto per le API CUDA garantiscono una transizione agevole per gli sviluppatori che hanno già familiarità con l’ecosistema CUDA.

La validazione del progetto attraverso test automatizzati su progetti open source, conferma l’affidabilità di SCALE nel gestire applicazioni complesse.

In sintesi, SCALE non solo facilita l’accesso alle potenzialità delle GPU AMD, ma offre anche una piattaforma versatile e in continua evoluzione, contribuendo a ridurre le barriere tra diversi ecosistemi hardware e software.

L’immagine in apertura è tratta dal sito ufficiale NVidia.

Ti consigliamo anche

Link copiato negli appunti